echo $xmlResult;
        if(count($orders_confirmed)>0) {
            $sda = array('idcode_ship'=>$asn_number);
            $filter = "jng_sp_id=5 AND jng_sp_orders_id IN (".implode(',', $orders_confirmed).")";
            tep_db_perform('jng_sp_orders', $sda, 'update', $filter);
        }
        if(count($items_confirmed)>0) $class_jo->confirmOrderDelivery($items_confirmed);
        exit;
    } else {
        $messagebox->add('Update ASN Failed! Only XML and Excel File are allowed, please check your file: '.$file['type']);
    }
}
*/
if (isset($_FILES['amvdasn'])) {
    $spid = tep_db_prepare_input($_POST['spid']);
    $unconfirmed_orders = $class_jo->getUnconfirmedOrders($spid);
    if (count($unconfirmed_orders) > 0) {
        $po_list = array();
        foreach ($unconfirmed_orders as $order) {
            if (!in_array($order['order_id'], $po_list)) {
                $po_list[] = $order['order_id'];
            }
        }
        die('Some POs are not yet confirmed:<br />' . implode('<br />' . $po_list));
    }
    $datefilter = generateMysqlDateFromGerman(tep_db_prepare_input($_POST['datefilter']));
    $amvdsl = loadAMVDsendList($spid, $datefilter);
    $orders_products = $amvdsl['orders_products'];
    //echo '<pre>'; var_dump($orders_products); echo '</pre>';
    $file = $_FILES['amvdasn'];
    $columns = array();
//so in minutes 10 and 40 we will confirm the orders
if (in_array(date('i'), $RUNTIME)) {
    use_class('jng_sp');
    use_class('jng_sp_upload');
    use_class('jng_sp_orders');
    use_class('products_ean');
    $class_sp = new jng_sp();
    $class_ju = new jng_sp_upload();
    $class_jo = new jng_sp_orders();
    $class_ean = new products_ean();
    $jng_sp_active = $class_sp->retrieveList("active_status=1");
    $logger->write("Task 1 (CHECK UNCONFIRMED ORDERS) - Start");
    foreach ($jng_sp_active as $temp_sp) {
        $jng_sp_id = $temp_sp['jng_sp_id'];
        $jng_sp_name = $temp_sp['name'];
        $orders = $class_jo->getUnconfirmedOrders($jng_sp_id);
        if (count($orders) == 0) {
            $logger->write("There is no new order to confirm");
        } else {
            switch ($jng_sp_id) {
                case '2':
                    $need_jms_upload = false;
                    $orders_confirmed = 0;
                    //1 XML FILE PER ORDER
                    $ts_counter_key = '';
                    foreach ($orders as $counter => $o) {
                        $timestamp = time();
                        $ts_period = date('YmdHis', $timestamp);
                        if ($ts_counter_key != $ts_period) {
                            $ts_counter_key = $ts_period;
                            $ts_counter = 0;
Ejemplo n.º 3
0
        $sp_orders .= $class_jo->manageOrderList($jng_sp_id, $status, $ean_list, $date_range_start, $date_range_end, $brand_id, $cat_id, $orders_no_arr);
        if ($status == '10') {
            $sp_orders .= '<div style="margin:20px 0;">&nbsp;</div>';
            $sp_orders .= $class_jo->manageOrderReturnList($jng_sp_id);
        }
    }
    echo utf8_encode($sp_orders);
    exit;
}
//START TEMPLATE
//$class_jo->checkAndSetCompleteOrders();
$statusName = $class_jo->statusNameShort();
$status_counter = $class_jo->statusCounter($jng_sp_id, $statusNameShow, $ean_list, $date_range_start, $date_range_end, $brand_id, $cat_id, $orders_no_arr);
$main_link = '?open=sp-orders&amp;status=';
$content = '';
$unconfirmed_orders = $class_jo->getUnconfirmedOrders('0');
$topbutton = '';
if (count($unconfirmed_orders) > 0) {
    $topbutton .= '<input type="button" class="red" name="confirmorders" value="You have unconfirmed Orders. Click here to Confirm Now." onclick="location.href=\'?open=sp-orders-confirmer\';" />';
}
if ($topbutton != '') {
    $content .= '<div style="text-align:center;">' . $topbutton . '</div>';
}
$content .= '<div style="margin-bottom:20px;text-align:center;">';
$content .= '<input type="button" id="togglethumbs" value="Toggle Product Thumbnails" title="Show or hide product thumbnails for each items" />';
//$content .= '<input type="button" id="showelements" value="Show Used Elements" title="Show all elements used by all products in current Status Tab" />';
$content .= '<input type="button" id="tabreload" value="Reload Tab" title="Reload Current Tab" />';
$content .= '<span><a href="?open=elements-picking-list&amp;hidemenu=true" class="view_webpage"></a><input type="button" id="showpickinglist" value="Elements Pick List" title="Print Elements Pick List for Sourcing (J&G and SP orders)" /></span>';
//$content .= '<span><a href="?open=sp-orders-search&amp;hidemenu=true" class="view_webpage"></a><input type="button" id="searchorders" value="Search Orders" title="Search Orders by specific information" /></span>';
$content .= '<span><a href="?open=outsourcing-overview&amp;hidemenu=true" class="view_webpage"></a><input type="button" id="outsourcingoview" value="Outsourcing Overview" title="Amazon orders outsourcing products overview" /></span>';
$content .= $additional_action_button;