Exemplo n.º 1
0
 $ypos += (count($values) + 0.5) * $lineheight;
 $lineheight = 4;
 $pdf->SetXY($xpos, $ypos);
 $pdf->setFont('Arial', 'B', '10');
 $pdf->Cell(70, $lineheight, 'Artikel:');
 //Products
 $pdf->setFont('Arial', '', '10');
 $pmax = 3;
 $pcol1 = array();
 $pcol2 = array();
 $item_counter = 0;
 foreach ($items as $item) {
     if ($item_counter < 12) {
         if ($type == 'sp') {
             //PROCESS ITEMS SP
             if (!$class_jo->statusIsCancelled($item['status']) && in_array($item['jng_sp_orders_items_id'], $items_array)) {
                 $ptext = intval($item['order_quantity']) . ' x ' . $item['article_number'];
                 //Go to col 2 when total items > pmax
                 //if(count($pcol1)<$pmax) $pcol1[] = $ptext;
                 //else $pcol2[] = $ptext;
                 //Go to col 2 on even counter
                 $item_counter++;
                 if ($item_counter % 2 != 0) {
                     $pcol1[] = $ptext;
                 } else {
                     $pcol2[] = $ptext;
                 }
             }
         } else {
             //PROCESS ITEMS JNG
             if (!$class_o->productStatusIsCancelled($item['status']) && in_array($item['orders_products_id'], $items_array)) {
Exemplo n.º 2
0
$class_payone = new payone();
//SP SETTING
salesPartnerCombo();
//AJAX ACTION
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'LOADUNSUBMITTEDORDERS') {
        $orders = $class_payone->newSPorders($jng_sp_id);
        $result = $class_payone->drawListTable($orders);
    } elseif ($_POST['me_action'] == 'AUTHORIZATION') {
        $process_method = 'authorization';
        $order_id = tep_db_prepare_input($_POST['orders_id']);
        $order = $class_jo->retrieveDetail($order_id);
        $items = $class_jo->retrieveItems($order_id);
        $cust = $class_jcust->retrieveDetail(null, $order['jng_sp_id'], $order['customer_billing_id']);
        foreach ($items as $key => $i) {
            if ($class_jo->statusIsCancelled($i['status'])) {
                unset($items[$key]);
            }
        }
        $payi = new payone_invoice();
        $payi->createFromOrderSP($order, $items);
        if (count($order) == 0 || count($items) == 0 || $payi->detail['invoice_complete_status'] != '0') {
            $result = "{$order_id},1";
        } else {
            //--PREPARE PARAMETERS
            $request = array();
            //--STANDARD PARAMETERS
            $request['mid'] = PAYONE_MERCHANT_ID;
            $request['portalid'] = PAYONE_PORTAL_ID;
            $request['key'] = md5(PAYONE_PORTAL_KEY);
            $request['mode'] = PAYONE_MODE;
Exemplo n.º 3
0
     $result .= printPackageTip(EAN_MISMATCH_ERROR, $item['products_ean'], $ean_scan);
 } else {
     if ($item['status'] < intval($old_status)) {
         //If product status is not yet finish
         $errinfo = $template_error_not_finish;
         $result .= printPackageTip('E', $box_date, $errinfo, $sp_name);
     } elseif ($item['status'] == $old_status) {
         //If product status is finish
         //$order = $class_jo->retrieveDetail($item['jng_sp_orders_id']);
         $order_date = strtotime($order['order_date']);
         $box_date = date('d. M', $order_date);
         //Retrieve all products from the order
         $items = $class_jo->retrieveItems($order['jng_sp_orders_id']);
         foreach ($items as $key => $i) {
             //Exclude any canceled products
             $iscanceled = $class_jo->statusIsCancelled($i['status']);
             if ($iscanceled) {
                 unset($items[$key]);
             }
         }
         if ($item['order_item_total'] == '1' || count($items) == 1) {
             //If order only consist of 1 product
             $packages = $class_jp->getUsablePackages($order['jng_sp_id']);
             if (count($packages) == 0) {
                 //If no usable package found for this SP, create 1
                 $package_id = $class_jp->createNew($order['jng_sp_id']);
             } else {
                 //If usable package found fo this SP, use it
                 $package_id = $packages[0]['jng_sp_packages_id'];
             }
             //Add product to package and update product status
 $xml_content .= writeXMLline('NECKERMANN_POS_REF', $i['article_reference_number'], 4);
 $xml_content .= writeXMLclose('ARTICLE_DATA', 3);
 //Quantity
 $xml_content .= writeXMLopen('QUANTITY', 3);
 if ($i['status'] == '9' || $i['status'] == '11') {
     if ($i['order_quantity'] > 0) {
         $items_confirmed[] = $i['jng_sp_orders_items_id'];
     }
     $xml_content .= writeXMLline('SHIP_QUANTITY', $i['order_quantity'], 4);
     if ($i['cancel_quantity'] > 0) {
         $qty_cancel_confirmed[] = $i['jng_sp_orders_items_id'];
         $xml_content .= writeXMLline('DIFF_QUANTITY', $i['cancel_quantity'], 4);
         $cancel_status = $i['cancel_quantity_status'] == 'J' ? 'BST' : 'KDW';
         $xml_content .= writeXMLline('DIFF_CAUSE_ID', $cancel_status, 4);
     }
 } elseif ($class_jo->statusIsCancelled($i['status'])) {
     $items_confirmed[] = $i['jng_sp_orders_items_id'];
     if ($i['cancel_quantity'] > 0) {
         $qty_cancel_confirmed[] = $i['jng_sp_orders_items_id'];
         $cancel_quantity = $i['cancel_quantity'] + $i['order_quantity'];
     } else {
         $cancel_quantity = $i['order_quantity'];
     }
     $xml_content .= writeXMLline('SHIP_QUANTITY', '0', 4);
     $xml_content .= writeXMLline('DIFF_QUANTITY', $cancel_quantity, 4);
     $cancel_status = $i['cancel_status'] == 'J' ? 'BST' : 'KDW';
     $xml_content .= writeXMLline('DIFF_CAUSE_ID', $cancel_status, 4);
 }
 $xml_content .= writeXMLclose('QUANTITY', 3);
 //ITEMS close
 $xml_content .= writeXMLclose('ITEMS', 2);
 }
 $ts_counter++;
 $xml_content = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
 $xml_content .= writeXMLopen('ottopartner', 0, 'xmlns="http://www.ottogroupb2b.com/ottopartner"');
 $xml_content .= writeXMLline('LKZ', $sp_data[$jng_sp_id]['jng_id'], 1);
 $xml_content .= writeXMLopen('OrderStates', 1);
 $xml_content .= writeXMLopen('OrderState', 2);
 $xml_content .= writeXMLline('order-no', $o['order_id'], 3);
 $xml_content .= writeXMLopen('product-line-items', 3);
 $items = $data_sp['items'][$o['jng_sp_orders_id']];
 $items_confirmed = array();
 foreach ($items as $i) {
     $items_confirmed[] = $i['jng_sp_orders_items_id'];
     $xml_content .= writeXMLopen('product-line-item', 4);
     $xml_content .= writeXMLline('position', $i['position'], 5);
     $status = $class_jo->statusIsCancelled($i['status']) ? 'cancel' : 'sent';
     $xml_content .= writeXMLline('order-status', $status, 5);
     $xml_content .= writeXMLline('quantity', intval($i['order_quantity']), 5);
     $xml_content .= writeXMLline('ModificationDate', ottodeDateFormat($timestamp), 5);
     $xml_content .= writeXMLclose('product-line-item', 4);
 }
 $xml_content .= writeXMLclose('product-line-items', 3);
 $xml_content .= writeXMLclose('OrderState', 2);
 $xml_content .= writeXMLclose('OrderStates', 1);
 $xml_content .= writeXMLclose('ottopartner', 0);
 //CREATE XML ON SERVER
 $fn_counter = str_pad($ts_counter, 2, '0', STR_PAD_LEFT);
 $xml_filename = $sp_data[$jng_sp_id]['jng_id'] . '_orderstatus_' . $ts_period . $fn_counter . '.xml';
 $xmlfullpath = SP_OTTODE_UPLOAD_PATH_STATES . $xml_filename;
 $file = fopen($xmlfullpath, 'w');
 $success = fwrite($file, $xml_content) !== false;
Exemplo n.º 6
0
         $o['status'] = $itemStatus[$row['status']];
         $action = '';
         if ($row['status'] == '9' || $row['status'] == '11') {
             $returnable = $row['order_quantity'];
             $return_data = $class_jo->retrieveReturnItem($row['jng_sp_orders_items_id']);
             if (!is_null($return_data)) {
                 foreach ($return_data as $rd) {
                     $returnable -= $rd['return_quantity'];
                 }
             }
             if ($returnable > 0) {
                 $action .= '<input type="button" class="actbtn" name="return" value="Return" title="Returned by customer" />';
             } else {
                 $action .= ' <span class="green">Returned</span> ';
             }
         } elseif ($class_jo->statusIsCancelled($row['status'])) {
             $action .= ' <span class="green">Cancelled</span> ';
         } else {
             $action .= '<input type="button" class="actbtn" name="cancel" value="Cancel" title="Cancel this product" />';
         }
         //Default Row Action Value (id, status, stock status)
         $action .= '<input type="hidden" id="oiid-' . $row['jng_sp_orders_items_id'] . '" name="oi_id" value="' . $row['jng_sp_orders_items_id'] . '" >';
         $action .= '<input type="hidden" name="oi_status" value="' . $row['status'] . '" >';
         $action .= '<input type="hidden" name="oi_qty" value="' . $row['order_quantity'] . '" >';
         $o['t'] = $action;
         $orders_result[] = $o;
     }
     $result .= '<h3>Search Result:</h3>';
     $result .= tep_draw_table('spo sticky-tablehead', $orders_result);
     //$result .= '<div><input type="button" name="search_more" value="Show More Results" /></div>';
 }