$result['oi_id'] = $items_id; $result['old_status'] = $old_status; $result['new_status'] = $item['status']; $result['msg_sukses'] = ''; $result['msg_errors'] = oiErrorStatus($items_id, $item['status'], $old_status); } ajaxReturn($result); exit; } elseif ($_POST['me_action'] == 'CREATENEWPACKAGE') { $package_code = tep_db_prepare_input($_POST['package_code']); use_class('jng_sp_packages'); $class_jp = new jng_sp_packages(); $newpackage = $class_jp->createNew($jng_sp_id, $package_code); $usable_packages = $class_jp->getUsablePackages($jng_sp_id); $packages = '<h3>'; $packages .= 'Package: ' . $class_jp->packageCombo($usable_packages, 'package', $newpackage, 'id="selpack" style="background:#fcc;"'); $packages .= ' <input type="button" class="actbtn" name="addall2pack" value="Add all products to this Package" title="Add all listed products to the selected package" />'; $packages .= '</h3>'; echo $packages; exit; } elseif ($_POST['me_action'] == 'ADDTOPACKAGE') { $items_id = tep_db_prepare_input($_POST['oi_id']); $package_id = tep_db_prepare_input($_POST['package_id']); $old_status = '5'; $new_status = '6'; $item = $class_jo->retrieveItemDetail($items_id); if ($item['status'] == $old_status) { use_class('jng_sp_packages'); $class_jp = new jng_sp_packages(); $class_jp->addItem($package_id, $items_id); $class_jo->updateItemStatus($items_id, $new_status, $session_userinfo['username']);
function manageOrderList($jng_sp_id, $status, $ean_list = null, $date_start = null, $date_end = null, $brand_id = null, $cat_id = null, $orders_no = '') { global $STOCKLESS_ELEMENTS_CATEGORY, $PROD_SUBSTATUS_USE_LINE; $USE_ORDER_FILTER_TO_ALLOW_PRINTING_PI = false; $show_stock_status = $status == '1' || $status == '2' || $status == '3' || $status == '4' || $status == '8'; $orders_items = $this->retrieveOrdersItems($jng_sp_id, $status, $ean_list, $date_start, $date_end, $brand_id, $cat_id, $orders_no); list($status, $sub_status) = explode('-', $status); if ($status == '10') { $cancel = $this->retrieveCancelList($jng_sp_id); if (count($cancel) > 0) { foreach ($cancel as $c) { $orders_items[] = $c; } } } $orders = array(); $result = $this->manageOrderList_drawFilter($jng_sp_id, $ean_list, $date_start, $date_end, $brand_id, $cat_id, $orders_no); if ($status == '1') { //Check if there are orders below the shipping window $orders_hidden_by_shipping_window = $this->statusCounterQuery($jng_sp_id, $status, true, $ean_list, $date_start, $date_end, $brand_id, '', '', '', null, $orders_no); if ($orders_hidden_by_shipping_window > 0) { $result .= '<h3 class="red">' . $orders_hidden_by_shipping_window . ' rows are hidden due to their long Shipping Window</h3>'; } } if ($status == '10') { $result .= '<h2>Cancelled Products <a href="?open=sp-orders-cancel&hidemenu=true" class="view_webpage" title="Cancel Products"></a><input type="button" id="btn_canceladd" name="canceladd" value="Add" /></h2>'; } if (count($orders_items) > 0) { $class_pm = new products_minierp(); $header = array(); //$header['d'] = (($status < 2) OR ($status > 7)) ? 'Date' : 'Lead Time'; $header['d'] = $status > 9 ? 'Date' : 'Lead Time'; if ($status <= 9) { $header['d2'] = 'Cycle Time'; } // $header['d2'] = ($status=='10') ? 'Cancel' : '<abbr title="Reported Shipping Date">RSD</abbr>'; //if (!(($status < 2) OR ($status > 7))) $header['d2'] = 'Started Date'; $header['l'] = 'SP'; $header['c'] = 'Customer / Order No'; $header['o'] = 'Order ID'; $header['a'] = 'Article No'; $header['p'] = 'Price'; $header['q'] = 'Qty'; $header['m'] = 'Margin'; if ($show_stock_status) { $header['s'] = $status == '8' ? 'Status' : 'Stock'; } if ($status == '3') { $header['pc1'] = '<abbr title="PI has been sent to PRINTER by MC">P</abbr>'; $header['pc2'] = '<abbr title="PI has been SCANNED for EAN label in MC">S</abbr>'; } $sub_status = trim($sub_status); $sub_prod_show_line_only = in_array($sub_status[0], $PROD_SUBSTATUS_USE_LINE); if ($status == '4' && $sub_prod_show_line_only) { $header['g'] = 'Status'; } $header['t'] = 'Action'; //$orders[] = $o; $orders_vorkasse_unpaid = array(); $orders_sent_unconfirmed = array(); $show_btn_inprod = false; $show_btn_insrcn = false; if ($status == '5' || $status == '14') { //Query Package for Finish and Return Products $package_type = $status == '14' ? 'R' : null; use_class('jng_sp_packages'); $class_jp = new jng_sp_packages(); $usable_packages = $class_jp->getUsablePackages($jng_sp_id, $package_type); $packages_exist = count($usable_packages) > 0; } $timestamp = date('Y-m-d H:i:s'); $order_pi_print_count = array(); $order_pi_ready = array(); $order_pi_collection = array(); $order_pi_unscanned = array(); foreach ($orders_items as $oiid => $row) { $oid = $row['jng_sp_orders_id']; $products_id = $row['products_id']; $articles_id = $row['products_articles_id']; $order_pi_print_count[$oid][$oiid] = $row['print_count']; $order_pi_unscanned[$oid][$oiid] = $row['print_confirmed']; $obj_product = new Product($products_id); if (!isset($order_pi_collection[$oid])) { $order_pi_ready[$oid] = false; $order_pi_collection[$oid] = array(); } $order_pi_collection[$oid][] = $row['jng_sp_orders_items_id']; if (count($order_pi_collection[$oid]) == $row['order_item_total']) { $order_pi_ready[$oid] = true; if (orderItemHaveStatus($oid, 10, 'SP')) { $order_pi_ready[$oid] = false; } } /* ### CHANGED THIS TO USING invoice balance, SINCE PREPAYMENT PREAUTH COULD ALSO PROCESSED WHEN 'U-Underpaid' BUT THEN THERES CANCEL CONFIRMED AND MAKE STATUS BECOME 'P-Paid OR O-Overpaid' ### $order_vorkasse_unpaid = (strtoupper($row['payment_method'])==strtoupper(PAYMENT_METHOD_PREPAYMENT) && $row['invoice_complete_status']!='P' && $row['invoice_complete_status']!='O' && $row['invoice_complete_status']!='1'); */ $order_vorkasse_unpaid = strtoupper($row['payment_method']) == strtoupper(PAYMENT_METHOD_PREPAYMENT) && !conditionPrepaymentIsPaid($row); $order_sent_unconfirmed = $row['status'] == '9' && $row['confirm_delivery'] == '0'; $o = array(); $order_date = strtotime($row['order_date']); /* $date_used = ($status < 3) ? strtotime($row['status_date']) : strtotime($row['prod_target_in']); if (($status < 2) OR ($status > 7)) { $value_date = date('d-M-y', $order_date); } else { $value_date = displayLeadTime($row['prod_target_in'], $date_used); } $o['d'] = $value_date; */ $o['d'] = $order_vorkasse_unpaid || $status > 9 ? date('d-M-y', $order_date) : displayLeadTime($row['leadtime_start_date'], strtotime($row['leadtime_start_date'])); if ($status <= 9 && !$order_vorkasse_unpaid) { $previous_moved_date = $status == 4 ? $row['status_date_prod'] : $row['status_date']; $o['d2'] = displayCycleTime($previous_moved_date); } // if($status=='10') { // $o['d2'] = date('d-M-y', strtotime($row['status_date'])); // } else { // $o['d2'] = $this->reportedShippingDate($order_date, $status, $row['delivery_time'], $row['delivery_replacement_time']); // if($row['service_code']!='' && $row['service_code']!='ZRE') { // $title = 'Use Service Code: '.$row['service_code']; // $new = '<div style="border-bottom:1px solid #f00;text-decoration:blink;cursor:pointer;color:#f00;" title="'.$title.'" onclick="alert(\''.$title.'\');" '; // $old = '<div '; // $o['d2'] = str_replace($old, $new, $o['d2']); // } // } // if (!(($status < 2) OR ($status > 7))) $o['d2'] = date('d-M-y', $date_used); $o['l'] = $row['package_prefix']; $cust = '<a href="?open=sp-customer&id=' . $row['jng_sp_customers_id'] . '&hidemenu=true" class="view_webpage" >' . $row['customer_name'] . '</a>'; $crown_img_col = array('V' => 'vip', 'B' => 'black'); if ($row['list_type'] != '' && array_key_exists($row['list_type'], $crown_img_col)) { $crown_img_title = array('V' => 'VIP Customer', 'B' => 'Blacklist Customer'); $crown_img = '<a href="?open=sp-customers-special-detail&id=' . $row['jng_sp_customers_id'] . '&hidemenu=true" class="view_webpage">'; $crown_img .= '<img src="images/list-' . $crown_img_col[$row['list_type']] . '.gif" title="' . $crown_img_title[$row['list_type']] . '" />'; $crown_img .= '</a> '; $cust = $crown_img . $cust; } $cust .= ' <sup>' . $row['customers_order_count'] . '</sup>'; $jng_sp_orders_items_id = 'SP-' . $row['jng_sp_orders_items_id']; $jng_sp_orders_items_id = '<a href="?open=sp-order-history&oi_id=' . $row['jng_sp_orders_items_id'] . '&hidemenu=true" class="view_webpage">' . $jng_sp_orders_items_id . '</a>'; $order_no = $row['order_id']; if ($order_no == '') { $order_no = 'J&G ID: ' . $row['jng_sp_orders_id']; } $order_no = '<a href="?open=customer-care-order-detail&source=SP&id=' . $row['jng_sp_orders_id'] . '&hidemenu=true" class="view_webpage">' . $order_no . '</a>'; if ($row['order_item_total'] > 1) { $jng_sp_orders_items_id .= ' <sup>' . $row['order_item_count'] . '/' . $row['order_item_total'] . '</sup>'; } if ($row['cod_costs'] > 0) { $order_no = '<img src="images/list-cod.gif" title="COD Method" /> ' . $order_no; } $o['c'] = $cust . '<br /><small>order no:</small> ' . $order_no; $o['o'] = $jng_sp_orders_items_id; //$diamond_icon = ($obj_product->brand_id == 14) ? drawDiamondIcon('Diamond Product', ' ') : ''; $diamond_icon = $obj_product->isUsingDiamond() ? drawDiamondIcon('Diamond Product', ' ') : ''; $gold_icon = drawGoldIcon($obj_product->metal_stamp_code, $obj_product->metal_stamp_info, '', ' '); $article = '<div><a href="?open=product-detail&products_id=' . $products_id . '" target="_blank" title="View Product Detail">' . $row['article_number'] . '</a></div>'; $icons = $gold_icon . $diamond_icon; $pimg = webImageSource($row['products_image'], '500'); if ($pimg != '') { $thumb = '<div class="thumb" thumbid="' . "{$products_id}-{$articles_id}-{$jng_sp_id}" . '"><a href="' . $pimg . '" class="view_image" title="Click to view larger image">' . webImage($row['products_image'], '80', '80', '', 'img-border img-padding') . '</a></div>'; $article = $thumb . $article; } $o['a'] = drawTableArticleInfoWithIcons($article, $icons); $o['p'] = $row['price']; $qty = intval($row['order_quantity']); $o['q'] = $qty; $mat_exp = $row['material_expenses'] > 0 ? $row['material_expenses'] : $row['current_mat_exp']; $margin = number_format($class_pm->calculateMargin($row['price'], $mat_exp), 1) . '%'; $o['m'] = '<span class="' . ($class_pm->priceMargindIsGood($row['price'], $margin) ? 'green' : 'red') . '">' . $margin . '</span>'; // $el_link = '<a href="?open=elements-stock&products_id='.$products_id.'&hidemenu=true" class="view_webpage"></a>'; //PREVIOUS $el_link = '<a href="?open=products-elements-stock&products_id=' . $products_id . '&paid=' . $row['products_articles_id'] . '&qty=' . $qty . '&status=' . $row['stock_status'] . '&hidemenu=true" class="view_webpage"></a>'; $pr_link = '<a href="javascript:void();" onclick="alert(\'Please use Finish Good Stock\');"></a>'; $dp_link = '<a href="javascript:void();" onclick="alert(\'Please use Depot Stock\');"></a>'; switch ($row['stock_status']) { case '0': $stock_status = '<strong class="red">!</strong>'; if ($status == '8') { //$do_status = statusNameShort($row['depot_orders_status']); $do_status = $row['depot_orders_status'] == '4' && isset($row['depot_orders_prod_status']) && $row['depot_orders_prod_status'] != '' ? statusNameProduction($row['depot_orders_prod_status'], false, true) : statusNameShort($row['depot_orders_status']); if (!is_array($do_status)) { //$stock_status = '<span class="red">'.$do_status.'</span>'; $stock_status = '<a href="?open=depot-order&id=' . $row['depot_orders_id'] . '&hidemenu=true" title="MMO product, current status is ' . $do_status . '" class="red view_webpage">' . $do_status . '</a>'; } } break; case 'R': $show_btn_inprod = true; $stock_status = $el_link . '<abbr title="Element Stock OK, Ready for Production" class="green">OK</abbr>'; break; case 'S': $show_btn_insrcn = true; $stock_status = $el_link . '<abbr title="Element Stock Need Sourcing" class="red">NS</abbr>'; break; case 'P': $show_btn_inprod = true; $stock_status = $pr_link . '<abbr title="Use Finished Goods Stock" class="green">FG</abbr>'; break; case 'D': if (is_null($row['depot_orders_id'])) { $stock_status = $dp_link . '<abbr title="Use Depot Stock" class="green">DS</abbr>'; } else { $stock_status = '<a href="?open=depot-order&id=' . $row['depot_orders_id'] . '&hidemenu=true" class="green view_webpage">DS</a>'; } break; case 'W': $stock_status = $el_link . '<abbr title="Product is using Wholesale Element" class="red">WP</abbr>'; break; default: $stock_status = '<strong class="red">?</strong>'; } if ($show_stock_status) { $o['s'] = $stock_status; } if ($status == '3') { $o['pc1'] = $row['print_count'] > 0 ? '<img title="Printed ' . $row['print_count'] . ' time(s)" src="images/icon-tick.png">' : '<img title="Not yet printed" src="images/icon-tick-dis.png">'; $o['pc2'] = $row['print_confirmed'] > 0 ? '<img title="Scanned ' . $row['print_confirmed'] . ' time(s)" src="images/icon-tick.png">' : '<img title="Not yet scanned" src="images/icon-tick-dis.png">'; } if ($status == '4' && $sub_prod_show_line_only) { $o['g'] = isset($row['prod_status']) && $row['prod_status'] != '' ? strtoupper(statusNameProduction($row['prod_status'], true)) : ''; } $action = ''; //late button $nolate_buttons = in_array($row['jng_sp_id'], $this->sp_nolatebtns); $delay_info_sent = $this->isDelayInfoSent($row['jng_sp_orders_items_id']); $nmi_tolerance = 2; //tolerance in days before showing NMI=>LATE button in Sourcing Tab $rsd_plain = $this->reportedShippingDate($order_date, $status, $row['delivery_time'], $row['delivery_replacement_time'], true); $disabled = 'disabled="disabled"'; $delay_class = ''; if ($nolate_buttons) { $delay_class = ' red'; } else { if ($delay_info_sent) { $delay_class = ' green'; } else { if ($row['status'] != '2') { $disabled = ''; } else { if (time() > $rsd_plain + ($nmi_tolerance + 1) * 24 * 60 * 60) { $disabled = ''; } } } } $late_button = '<input type="button" class="actbtn' . $delay_class . '" name="delay" value="LATE" title="Inform SP/Cust about delivery delay" ' . $disabled . ' />'; if ($row['status'] == '1') { if (!$order_vorkasse_unpaid) { if ($row['stock_status'] == 'P' || $row['stock_status'] == 'R' || $row['stock_status'] == 'W') { $action .= '<input type="button" class="actbtn green" name="3" value="Ready" title="Set to Ready for Production" style="width:70px;" />'; } elseif ($row['stock_status'] == 'S') { $action .= '<input type="button" class="actbtn red" name="2" value="Sourcing" title="Set to In Sourcing" style="width:70px;" />'; } $action .= '<input type="button" class="actbtn" name="10" value="Cancel" title="Cancel this product" />'; } else { if ($row['jng_sp_id'] == '8') { $action .= '<span class="green">Waiting Payment Status</span>'; } else { if ($row['last_sent_date'] == '') { $action .= '<span class="green">Reminder Not Sent</span>'; /* if(!in_array($row['orders_id'],$orders_vorkasse_notice)) { $orders_vorkasse_notice[] = $row['orders_id']; $action .= '<input type="button" class="actbtn" name="reminder" value="Reminder" title="Send payment reminder to customer" />'; } else { $action .= '<input type="button" value="Reminder" disabled="disabled" />'; } */ } else { $overtime = strtotime($row['last_sent_date']) < strtotime('-' . PAYMENT_METHOD_BANK_TRANSFER_OVERDUE); if ($row['sent_count'] > 1) { $action .= '<span class="red">Cancel Notification Sent</span>'; } else { $action .= '<span class="blue">Reminder Sent</span>'; } /* if(!in_array($row['orders_id'],$orders_vorkasse_notice) && $overtime) { $orders_vorkasse_notice[] = $row['orders_id']; $action .= '<input type="button" class="actbtn red" name="unpaidcancel" value="CANCEL" title="Cancel order and send email notification to customer" />'; } else { $btn_text = ($overtime) ? 'CANCEL' : 'Reminder Sent'; $action .= '<input type="button" value="'.$btn_text.'" disabled="disabled" />'; } */ } } } } // if($row['status']<='2') $action .= '<input type="button" class="actbtn" name="3" value="Ready" title="Set to Ready for Production" />'; if ($row['status'] == '2') { $action .= '<input type="button" class="actbtn" name="3" value="Ready" title="Set to Ready for Production" />'; $action .= $late_button; $action .= '<input type="button" class="actbtn" name="1" value="N" title="Set back to New" />'; $action .= '<input type="button" class="actbtn" name="10" value="C" title="Cancel this product" />'; } /* if($row['status']=='1') { $action .= '<input type="button" class="actbtn" name="2" value="Sourcing" title="Set to In Sourcing" />'; $action .= '<input type="button" class="actbtn" name="10" value="C" title="Cancel this product" />'; } */ if ($row['status'] == '3') { //$action .= '<input type="button" class="actbtn" name="4" value="PI & Set2Prod" title="Print PI and Set to In Production" />'; //$action .= $late_button; if (!$USE_ORDER_FILTER_TO_ALLOW_PRINTING_PI) { $hid = ''; $action .= '<input type="button" class="actbtn" name="printpi" value="Print PI" title="Print Production Instruction" ' . $hid . '/>'; $action .= '<input type="hidden" name="oi_id_cols" value="' . $row['jng_sp_orders_items_id'] . '" />'; } //$action .= '<input type="button" class="actbtn" name="1" value="N" title="Set back to New" />'; $action .= '<input type="button" class="actbtn" name="10" value="C" title="Cancel this product" />'; $action .= '<input type="button" class="actbtn" name="2" value="S" title="Set to In Sourcing" />'; } if ($row['status'] == '4') { $action .= '<input type="button" class="actbtn" name="5" value="Finish" title="Set to Finish" />'; $action .= $late_button; $action .= '<input type="button" class="actbtn" name="4" value="PI" title="Reprint Production Instruction" />'; $action .= '<input type="button" class="actbtn" name="2" value="S" title="Set to In Sourcing" />'; $action .= '<input type="button" class="actbtn" name="10" value="C" title="Cancel this product" />'; $prod_sub_status = getProductionSubStatus(4); if (count($prod_sub_status) > 0) { $action .= '<br/>'; } foreach ($prod_sub_status as $pss => $pss_name) { if (in_array($pss, $PROD_SUBSTATUS_USE_LINE)) { continue; } if ($pss == $sub_status[0]) { continue; } $action .= '<input type="button" class="actbtn" name="4-' . $pss . '" value="' . $pss . '" title="Moved to ' . $pss_name . '" />'; } } if ($row['status'] == '5') { //$action .= '<input type="button" class="actbtn" name="6" value="Package" title="Add to Selected Package" '.((!$packages_exist) ? 'style="display:none;"' : '').'/>'; $action .= '<input type="button" class="actbtn" name="4-P" value="Prod" title="Set back to Production" />'; $action .= $late_button; } if ($row['status'] == '8') { $action .= '<input type="button" class="actbtn" name="10" value="Cancel" title="Cancel this product" />'; } if ($row['status'] == '10') { $action .= '<input type="button" class="actbtn" name="1" value="Revive" title="Revive this product as New" />'; } if ($row['status'] == '14') { $action .= '<input type="button" class="actbtn" name="16" value="Package" title="Add to Selected Package" ' . (!$packages_exist ? 'style="display:none;"' : '') . '/>'; $action .= '<input type="button" class="actbtn" name="15" value="Keep" title="Set to Keep" />'; } if ($row['status'] == '15') { $action .= '<input type="button" class="actbtn" name="14" value="Return" title="Set Back to Return" />'; } if ($row['confirm_delivery'] == '1' && $row['status'] < 14) { $action = '<div class="green">confirmed</div>'; } //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="csl_type" value="' . $row['list_type'] . '" />'; if ($show_stock_status) { $action .= '<input type="hidden" name="oi_stock_status" value="' . $row['stock_status'] . '" >'; } $o['t'] = $action; if ($order_vorkasse_unpaid) { $orders_vorkasse_unpaid[$row['jng_sp_orders_items_id']] = $o; } elseif ($order_sent_unconfirmed) { $orders_sent_unconfirmed[$row['jng_sp_orders_items_id']] = $o; } else { $orders[$row['jng_sp_orders_items_id']] = $o; } } $buttons = ''; switch ($status) { case '1': //hide by request of markus so pic must check line by line //if($show_btn_inprod && $show_btn_insrcn) $buttons .= '<input type="button" class="grpbtn button" name="stockstatusall" value="Set ALL" title="Set all product status according to the stock status" />'; //if($show_btn_insrcn) $buttons .= '<input type="button" class="grpbtn button" name="stockstatusns" value="Set all NS to Sourcing" title="Set all product with status NS to In Sourcing" />'; //hide by request of markus so pic must check line by line //if($show_btn_inprod && $show_btn_insrcn) $buttons .= '<input type="button" class="grpbtn button" name="stockstatusall" value="Set ALL" title="Set all product status according to the stock status" />'; //if($show_btn_insrcn) $buttons .= '<input type="button" class="grpbtn button" name="stockstatusns" value="Set all NS to Sourcing" title="Set all product with status NS to In Sourcing" />'; case '2': //hide by request of markus so pic must check line by line //if($show_btn_inprod) $buttons .= '<input type="button" class="grpbtn button" name="stockstatusok" value="Set all OK/FG to Ready" title="Set all product with status OK/FG to Ready for Production" />'; break; case '3': //hide due to printing PI is now done per order //$buttons .= 'Product Amount: <input type="text" class="iwbutton" id="pi_print_amount" name="ppa" value="10" title="Set number of products to print" style="width:50px;text-align=center;" />'; //$buttons .= ' <input type="button" class="grpbtn button" name="printmultpi" value="Print PI and set to Production" title="Print Production Instruction of a set number of products" />'; //if(!$USE_ORDER_FILTER_TO_ALLOW_PRINTING_PI) { // $buttons .= '<input type="button" class="grpbtn button" name="togglehideoi" value="Toggle Printed" title="Show or hide already printed items" />'; //} else { $buttons .= '<div>'; $buttons .= '<input type="button" id="btn-reprint-pi-now" class="button help" value="REPRINT NOW for All Already Printed, Unscanned PI (0)" title="Reprint automatically NOW for all PI which<br/><strong>Already printed but not EAN scanned yet</strong>"/> '; $buttons .= '<input type="button" id="btn-reprint-pi-nextbatch" class="button help" value="REPRINT ON NEXT BATCH for All Already Printed, Unscanned PI (0)" title="Reprint ON NEXT BATCH print PI for all PI which<br/><strong>Already printed but not EAN scanned yet</strong>"/><br/><br/>'; $buttons .= '</div>'; $buttons .= '<table class="form" border="0" cellpadding="0" cellspacing="0"><tr>'; $buttons .= '<td class="bold">Show Products</td>'; $buttons .= '<td style="padding-left:30px;"><input id="rb-orf-2" type="radio" class="readyfilter" name="readyfilter" value="2"/></td>'; $buttons .= '<td><label for="rb-orf-2">Unprinted <span id="orfc-up">(0)</span></label></td>'; //$buttons .= '<td style="padding-left:30px;"><input id="rb-orf-1" type="radio" class="readyfilter" name="readyfilter" value="1" /></td>'; //$buttons .= '<td><label for="rb-orf-1">Ready to be printed <span id="orfc-rp">(0)</span></label></td>'; $buttons .= '<td style="padding-left:30px;"><input id="rb-orf-4" type="radio" class="readyfilter" name="readyfilter" value="4" /></td>'; $buttons .= '<td><label for="rb-orf-4">Already Printed <span id="orfc-ap">(0)</span></label></td>'; $buttons .= '<td style="padding-left:30px;"><input id="rb-orf-5" type="radio" class="readyfilter" name="readyfilter" value="5" /></td>'; $buttons .= '<td><label for="rb-orf-5">Already Printed, Unscanned <span id="orfc-apun">(0)</span></label></td>'; $buttons .= '<td style="padding-left:30px;"><input id="rb-orf-3" type="radio" class="readyfilter" name="readyfilter" value="3" checked="checked" /></td>'; $buttons .= '<td><label class="bold" for="rb-orf-3">All <span id="orfc-al">(0)</span></label></td>'; $buttons .= '</tr></table>'; //} break; case '5': $jp_mb = new messagebox(); $jp_mb->add('Package Management is prohibited here, please <a href="?open=packaging" class="bold">click here and use module Packaging Process</a>'); $buttons = $jp_mb->build(); break; case '14': if ($jng_sp_id == '0') { $jp_mb = new messagebox(); $jp_mb->add('You must select a Sales Partner before managing packages for ' . ($status == '5' ? 'finished' : 'returned') . ' products, please change the <strong>All Sales Partners</strong> filter to a specific SP.', 'green'); $buttons = $jp_mb->build(); } else { if ($packages_exist) { $packages = '<h3>'; $packages .= 'Package: ' . $class_jp->packageCombo($usable_packages, 'package', '', 'id="selpack"'); $packages .= ' <input type="button" class="pkgbtn" name="addall2pack" value="Add all products to this Package" title="Add all listed products to the selected package" />'; $packages .= '</h3>'; } else { $packages = '<h3>Please create a new package</h3>'; } $buttons .= '<div style="float:right;"><input type="button" class="pkgbtn button" name="createnewpackage" value="Create New Package" title="Create a new package for shipping" /></div>'; $buttons .= '<div id="pack_cont" style="padding:10px 0px;">' . $packages . '</div>'; } break; case '16': if ($jng_sp_id == '0') { //$buttons .= '<input type="button" class="button grpbtn" name="printpackagechecklist" value="Print Checklist" title="Print Package Checklist" />'; $buttons .= '<input type="button" class="button grpbtn" name="printpackagefakeinvoice" value="Print Invoice" title="Print Fake Invoice for Bali Customs" />'; $buttons .= '<input type="button" class="button grpbtn" name="sendpackage" value="Send to Bali" title="Send this Package to Bali" />'; } else { $jp_mb = new messagebox(); $jp_mb->add('Please change the SP filter to <strong>All Sales Partners</strong> to continue.', 'green'); $buttons = $jp_mb->build(); } break; } $barcode_rule1 = $status == 3; $barcode_rule2 = $status == 4; //$barcode_rule2 = ($status==5 && $jng_sp_id!='0'); if ($barcode_rule1 || $barcode_rule2) { $style = $status == 5 && !$packages_exist ? 'style="display:none;"' : ''; //$buttons .= '<input type="button" class="button barcode-form-trigger" value="BARCODE ENTRY" '.$style.' />'; } if ($buttons != '') { $buttons = '<div class="spb" style="margin-bottom:10px;"><input type="hidden" name="grp_status" value="' . $status . '" />' . $buttons . '</div>'; } $result .= '<div id="sp-orders-' . $status . '">'; $result .= $buttons; //DRAW MANUALLY $orders_total = count($orders); $orders_sent_unconfirmed_total = count($orders_sent_unconfirmed); $orders_vorkasse_unpaid_total = count($orders_vorkasse_unpaid); if ($status == '9') { if ($orders_sent_unconfirmed_total > 0) { $result .= '<h3 class="red">Unconfirmed to Sales Partner (' . $orders_sent_unconfirmed_total . ')</h3>'; $result .= $this->drawTableListProduct($header, $orders_sent_unconfirmed, $orders_items); $result .= '<div> </div>'; } $result .= '<h3 class="green">Recently Confirmed to Sales Partner (' . $orders_total . ')</h3>'; } if ($orders_total > 0) { $result .= $this->drawTableListProduct($header, $orders, $orders_items, $USE_ORDER_FILTER_TO_ALLOW_PRINTING_PI, 5, $order_pi_print_count, $order_pi_ready, $order_pi_collection, $order_pi_unscanned); $result .= '<div> </div>'; } if ($orders_vorkasse_unpaid_total > 0) { $header['d'] = 'Date'; unset($header['d2']); $result .= '<h3 class="red">Unpaid Prepayment (' . $orders_vorkasse_unpaid_total . ')<span class="notice"> - No need to process these orders</span></h3>'; $result .= $this->drawTableListProduct($header, $orders_vorkasse_unpaid, $orders_items, $USE_ORDER_FILTER_TO_ALLOW_PRINTING_PI, 4); } if ($status == '5') { $result .= '<div id="crnew-pack-form" style="display:none;">'; $result .= 'Leave blank to use auto-generated code<br />'; $result .= '<input type="text" id="crnew-pack-form-pcode" value="" class="iwbutton" />'; $result .= '<input type="button" id="crnew-pack-form-submit" value="Create!" class="button" />'; $result .= '</div>'; } $result .= '</div>'; } else { $result .= '<h3 style="margin:0;">No Orders in this status</h3>'; } return $result; }