本文整理汇总了PHP中orders::updateProductStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP orders::updateProductStatus方法的具体用法?PHP orders::updateProductStatus怎么用?PHP orders::updateProductStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类orders
的用法示例。
在下文中一共展示了orders::updateProductStatus方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$class_jo = new jng_sp_orders();
foreach ($pack as $p) {
$items = $class_jp->sendPackage($p['packages_id']);
foreach ($items as $items_id) {
$class_jo->updateItemStatus($items_id, '7', $session_userinfo['username']);
}
}
} elseif ($type == 'J') {
use_class('minierp_packages');
$class_mp = new minierp_packages();
use_class('orders');
$class_o = new orders();
foreach ($pack as $p) {
$items = $class_mp->sendPackage($p['packages_id']);
foreach ($items as $items_id) {
$class_o->updateProductStatus($items_id, '7', $session_userinfo['username']);
}
}
} else {
use_class('depot_orders');
$class_do = new depot_orders();
foreach ($pack as $p) {
$class_do->packageSetSent($p['packages_id'], $session_userinfo['username']);
}
}
}
echo utf8_encode($logistic_id);
} elseif ($_POST['me_action'] == 'SAVELOG') {
use_class('products_minierp');
$class_pm = new products_minierp();
$bgst = $class_pm->retrieveBestGoodSettings();
示例2: elseif
$logger->write('sent first reminder ' . $logger_oid);
}
} elseif ($o['sent_count'] == '1') {
//Cancel Notification (orders are not canceled yet at this step)
if ($need_resend) {
$order->sendPrepaymentAutoCancelNotification();
$logger->write('sent cancel notification ' . $logger_oid);
}
} elseif ($o['sent_count'] == '2') {
//Cancel order and invoice
if ($last_sent_date_timestamp < strtotime('-' . $tolerance_before_really_cancelling_orders)) {
//default cancel status
if ($o['order_type'] == Order::ORDER_TYPE_JULIE_GRACE) {
$status = '12';
foreach ($items_id as $item_id) {
$class_o->updateProductStatus($item_id, $status, 'auto-set');
}
} elseif ($o['order_type'] == Order::ORDER_TYPE_SALES_PARTNER) {
$status = '10';
foreach ($items_id as $item_id) {
$class_jo->updateItemStatus($item_id, $status, 'auto-set');
}
}
$logger->write('canceled ' . $logger_oid);
if (count($invoice->detail) > 0) {
//status 3 = INVOICE CANCELED
$invoice->updateCompleteStatus('3');
$logger->write('canceled invoice ' . $invoice->detail['invoice_id']);
}
}
}
示例3: explode
//Handle update special production sub status like :
//4-P (Pullrack),
//4-S7 (Solder Setting Line 7),
//4-A (Ampol & QC),
//4-L (Laboratory)
$status_new_tmp = explode('-', $status_new);
$sub_status = $status_new_tmp[1];
if ($status_current != '4' && $status_current != '3') {
$result['status'] = 'BADSTATUS';
$result['result_msg'] = oiErrorStatus($status_current);
} elseif ($item['prod_status'] == $sub_status) {
$result['status'] = 'BADSTATUS';
$result['result_msg'] = oiErrorStatus($item['prod_status']);
} else {
$result['status'] = 'UPDATED';
$class_o->updateProductStatus($item_id, $status_new, $user_name);
}
} else {
//Handle update status
$result['status'] = 'UPDATED';
$class_o->updateProductStatus($item_id, $status_new, $user_name);
if ($status_current == '4' && $status_new == '5' && $item['prod_status'] != '') {
tep_db_perform('orders_products', array('prod_status' => ''), 'update', "orders_products_id='{$item_id}'");
}
if ($status_current == '4' && $status_new == '5' && $at_machine > 0) {
//IF PRODUCT IS FINISH, ALSO SET ANTITARNISH USAGE FOR NON OXIDIZED PRODUCTS
$silver_usage = $class_o->calcSilverUsage($item_id);
antitarnishUsageAdd($at_machine, $silver_usage);
}
}
}
示例4: elseif
$items_mmo[] = $oiid;
} elseif ($oi['mode'] == modeKey('MTO')) {
$items_mto[] = $oiid;
}
} elseif ($oi['is_outsourced']) {
//Handle orders for outsourced products with no stock
if ($oi['status'] == '8' && $oi['shipping_window_is_opened']) {
//no stock and shipping windows is already opened
if ($oi['order_item_total'] == 1) {
//SET AS MTO IF SINGLE PRODUCT ORDER
//stop waiting and move products back to New to become MTO
$items_mto[] = $oiid;
if ($order_type == 'SP') {
$class_jo->updateItemStatus($oiid, '1', 'auto-set');
} elseif ($order_type == 'JG') {
$class_o->updateProductStatus($oiid, '1', 'auto-set');
}
} else {
$items_mmo[] = $oiid;
$item_do = $class_do->transferFromRealOrder(SEGMENT_ID_HAMBURG, $order_type, $oiid);
}
} else {
//keep waiting if shipping window is not yet opened
//check if product is not yet moved to Depot/Mixed
if ($oi['status'] != '8') {
//set order as DSO and move items to Depot/Mixed
$items_dso[] = $oiid;
if ($order_type == 'SP') {
$class_jo->updateItemStatus($oiid, '8', 'auto-set');
} elseif ($order_type == 'JG') {
$class_o->updateProductStatus($oiid, '8', 'auto-set');
示例5: explode
$idcr = explode('|', $_POST['idcode_ret']);
$update_counter = array();
foreach ($reference as $i => $ref) {
$shipment_id = $ref;
$shipment_date = $date[$i];
$cancel_status = $cancel[$i];
$idcode_ship = $idcs[$i];
$idcode_ret = $idcr[$i];
if ($shipment_id != '') {
if (substr($ref, 0, 2) == 'JG') {
$order_id = substr($ref, 2);
$idcounter = 'JG' . $order_id;
$items = $class_o->retrieveProducts($order_id);
foreach ($items as $item) {
if ($item['status'] == $REQUIRED_STATUS) {
$class_o->updateProductStatus($item['orders_products_id'], $UPDATED_STATUS, $username);
}
if ($item['status'] == $REQUIRED_STATUS || $item['status'] == $UPDATED_STATUS) {
$update_counter[] = $idcounter;
}
}
} else {
$items = $class_jo->retrieveItems($shipment_id, true);
$idcounter = 'SP' . $shipment_id;
foreach ($items as $item) {
if ($item['status'] == $REQUIRED_STATUS) {
$osda = array('shipment_date' => $shipment_date, 'idcode_ship' => $idcode_ship, 'idcode_ret' => $idcode_ret);
tep_db_perform('jng_sp_orders', $osda, 'update', "shipment_id='{$shipment_id}'");
$class_jo->updateItemStatus($item['jng_sp_orders_items_id'], $UPDATED_STATUS, $username);
}
if ($item['status'] == $REQUIRED_STATUS || $item['status'] == $UPDATED_STATUS) {
示例6: foreach
$any_deletion_failed = false;
foreach ($products as $key => $p) {
$opid = $p['orders_products_id'];
$deleted = $class_dti->deleteCommissionCancel($opid);
if (!$deleted) {
unset($products[$key]);
$any_deletion_failed = true;
}
}
}
if (count($products) == 0) {
$result = '<h3 class="red">REVIVE FAILED!</h3><div>ALL Commissions cancellation are already reported to Partner</div>';
} else {
foreach ($products as $p) {
$opid = $p['orders_products_id'];
$class_o->updateProductStatus($opid, '1', $session_userinfo['username']);
}
$comment = 'Order is revived due to late payment';
$class_o->updateOrderStatus($order_id, '1', $comment);
$result = '<h3 class="green">REVIVE Successfully!</h3><div><a href="">Click here to refresh Order detail and view changes</a></div>';
if ($any_deletion_failed) {
$result .= '<div class="red">However, some Commissions cancellation are already reported to Partner, this products is not reviveable.</div>';
}
}
}
echo utf8_encode($result);
exit;
} elseif ($_POST['me_action'] == 'UPDATECUSTOMERSPECIALLIST') {
$customers_id = tep_db_prepare_input($_POST['customers_id']);
$status = tep_db_prepare_input($_POST['status']);
$class_csl->addCustomer($status, $customers_id);
示例7: printPackageTip
$items[$key]['products_ean'] = $class_ean->getEAN($i['products_id'], $i['products_articles_id']);
}
}
if ($item['order_item_total'] == '1' || count($items) == 1) {
//If order only consist of 1 product
$packages = $class_mp->getUsablePackages();
if (count($packages) == 0) {
//If no usable package found for JNG, create 1
$package_id = $class_mp->createNew();
} else {
//If usable package found fo JNG, use it
$package_id = $packages[0]['packages_id'];
}
//Add product to package and update product status
$class_mp->addItem($package_id, $id);
$class_o->updateProductStatus($id, $new_status, $session_userinfo['username']);
$result .= printPackageTip('P', $box_date, '', $sp_name, $sp_class);
saveIDforPrintingOrderLabel($id_raw);
$result .= '<input type="hidden" id="print_order_id" value="' . $id_raw . '" />';
} else {
//If order has more than 1 product, check if all products status are finish
$orders_ready = true;
$cancelids = array();
foreach ($items as $i) {
if ($i['status'] != $old_status) {
$orders_ready = false;
}
}
if ($orders_ready) {
//If all products status are finish, request barcode entry of other products
$inwb = array();
示例8: elseif
// $thumbid = tep_db_prepare_input($_POST['thumbid']);
// list($pid, $article_id) = split('-', $thumbid);
// $tooltip_data = getTooltipThumbData($pid, $article_id);
// $tooltip = displayTooltipThumb($tooltip_data);
// $result = array();
// $result['tooltip'] = $tooltip;
// ajaxReturn($result);
// exit;
} elseif ($_POST['me_action'] == 'UPDATEOPSTATUS') {
$opid = tep_db_prepare_input($_POST['op_id']);
$old_status = tep_db_prepare_input($_POST['old_status']);
$new_status = tep_db_prepare_input($_POST['new_status']);
$product = $class_o->retrieveProductDetail($opid);
if ($product['status'] == $old_status) {
$status_to_alert_success = array('3', '4');
$class_o->updateProductStatus($opid, $new_status, $session_userinfo['username']);
if ($new_status == '5' || $new_status == '10' || $new_status == '1' && $old_status == '10') {
//set order waxing as new/finish/cancel following order product status
use_class('orders_waxing');
$class_ow = new orders_waxing();
$ow_data = $class_ow->retrieveByOrderProducts($opid);
$ow_status = $new_status == '10' ? '6' : $new_status;
if (count($ow_data) > 0) {
foreach ($ow_data as $ow) {
$waxing_id = $ow['orders_waxing_id'];
$class_ow->updateStatus($waxing_id, $ow_status, $session_userinfo['username']);
}
}
}
list($new_status, $sub_status) = explode('-', $new_status);
$status_name = $sub_status != '' ? subStatusNameShort($new_status, $sub_status) : $class_o->productStatusNameShort();
示例9: implode
echo implode(",", $success);
}
}
if (isset($_GET['type']) && isset($_GET['orders_id']) && isset($_GET['old_status']) && isset($_GET['new_status'])) {
$type = strtoupper($_GET['type']);
$orders_id = tep_db_prepare_input($_GET['orders_id']);
$old_status = tep_db_prepare_input($_GET['old_status']);
$new_status = tep_db_prepare_input($_GET['new_status']);
$updater = 'manual';
if ($type == 'JG') {
use_class('orders');
$class_o = new orders();
$items = $class_o->retrieveProducts($orders_id);
foreach ($items as $i) {
if ($i['status'] == $old_status) {
$class_o->updateProductStatus($i['orders_products_id'], $new_status, $updater);
}
}
echo '<pre>';
var_dump($_GET);
echo '</pre>';
echo '<br />';
echo '<br />';
echo 'UPDATED!';
} elseif ($type == 'SP') {
$allowed_sp_id = array('6');
use_class('jng_sp_orders');
$class_jo = new jng_sp_orders();
$order = $class_jo->retrieveDetail($orders_id);
if (in_array($order['jng_sp_id'], $allowed_sp_id)) {
$items = $class_jo->retrieveItems($orders_id);
示例10: substr
$result['IDCODE_SHIP'] = $idcode_ship;
$result['IDCODE_RET'] = $idcode_ret;
if ($SIMULATION) {
$result['STATUS'] = 'SIM';
} else {
$updated = false;
if (substr($shipment_id, 0, 2) == 'JG') {
$order_id = substr($shipment_id, 2);
$items = $class_o->retrieveProducts($order_id);
if (count($items) > 0) {
$updated = true;
$osda = array('idcode_ship' => $idcode_ship, 'idcode_ret' => $idcode_ret);
tep_db_perform('orders', $osda, 'update', "orders_id='{$order_id}'");
foreach ($items as $item) {
if (in_array($item['status'], $REQUIRED_STATUS)) {
$class_o->updateProductStatus($item['orders_products_id'], $UPDATED_STATUS, 'auto-set');
}
}
}
} else {
$items = $class_jo->retrieveItems($shipment_id, true);
if (count($items) > 0) {
$updated = true;
$osda = array('shipment_date' => $shipment_date, 'idcode_ship' => $idcode_ship, 'idcode_ret' => $idcode_ret);
tep_db_perform('jng_sp_orders', $osda, 'update', "shipment_id='{$shipment_id}'");
foreach ($items as $item) {
if (in_array($item['status'], $REQUIRED_STATUS)) {
$class_jo->updateItemStatus($item['jng_sp_orders_items_id'], $UPDATED_STATUS, 'auto-set');
}
}
}
示例11: array
} else {
$logger->write("There are {$items_total} items need to be confirmed");
//Group Items per Order
$orders_cancelled = array();
foreach ($items as $i) {
if (!isset($orders_cancelled[$i['orders_id']])) {
$orders_cancelled[$i['orders_id']] = array();
}
$orders_cancelled[$i['orders_id']][] = $i['orders_products_id'];
}
$orders_total = count($orders_cancelled);
$logger->write("Total orders are {$orders_total}, processing per order:");
foreach ($orders_cancelled as $oid => $opid_array) {
$logger->write("> Order ID {$oid}");
foreach ($opid_array as $opid) {
$class_o->updateProductStatus($opid, $cancel_status_confirmed, 'auto-set');
$logger->write(" JG-{$opid} updated to {$cancel_status_name}");
}
$order = new Order(Order::ORDER_TYPE_JULIE_GRACE, $oid);
$sent = $order->sendCancelNotification();
if ($sent) {
$logger->write(' Notification sent');
}
}
}
//SP CONFIRM ORDERS DELIVERY AND CANCELLATION
$logger->write('- Confirm delivery & cancel status to SP');
$data = array();
foreach ($sp_data as $jng_sp_id => $sp) {
$data[$jng_sp_id] = $class_jo->getUnconfirmedDelivery($jng_sp_id);
}
示例12: removeFromPackage
function removeFromPackage($logistic_id, $logistic_partner, $barcode_id, $new_status, $updated_by = '')
{
global $session_userinfo;
if ($updated_by == '') {
$updated_by = $session_userinfo['username'];
}
$tmp_bcid = explode('-', $barcode_id);
$type = strtoupper($tmp_bcid[0]);
$oiid = $tmp_bcid[1];
$table_name = '';
if ($type == 'SP') {
$table_name = 'jng_sp_packages_items';
$field = 'jng_sp_orders_items_id';
} elseif ($type == 'JG') {
$table_name = 'minierp_packages_products';
$field = 'orders_products_id';
} elseif ($type == 'DP') {
$table_name = 'depot_packages_contents';
$field = 'depot_orders_id';
}
$result = '<span>Order <strong>"' . $barcode_id . '"</strong> not found on any packages!</span>';
if ($table_name != '') {
$q_check = tep_db_query("SELECT * FROM {$table_name} WHERE {$field} = '{$oiid}'");
if (tep_db_num_rows($q_check) > 0) {
tep_db_query("DELETE FROM {$table_name} WHERE {$field} = '{$oiid}'");
//SAVE AS HISTORY
$dt_hist = array();
$dt_hist['type'] = $type;
$dt_hist['order_items_id'] = $oiid;
$dt_hist['removed_by'] = $updated_by;
$dt_hist['updated_to_status'] = $new_status;
tep_db_perform('minierp_packages_orders_excluded', $dt_hist);
if ($type == 'SP') {
use_class('jng_sp_orders');
$class_jo = new jng_sp_orders();
$class_jo->updateItemStatus($oiid, $new_status, $updated_by, 'J', false);
} elseif ($type == 'JG') {
use_class('orders');
$class_o = new orders();
$class_o->updateProductStatus($oiid, $new_status, $updated_by, 'J', false);
} elseif ($type == 'DP') {
use_class('depot_orders');
$class_do = new depot_orders();
$class_do->updateStatus($oiid, $new_status, $updated_by, false);
}
//REGENERATE LIST OF CONTENTS ON CERTAIN LOGISTIC PACKAGE
$this->generateContents($logistic_id, $logistic_partner);
$result = '<span class="green">Order <strong>"' . $barcode_id . '"</strong> successfully removed from package and set its status as complete!';
$result .= '<br/><br/><strong>PLEASE REPRINT updated Commercial Invoice for logistic process!</span></strong>';
}
}
return $result;
}