当前位置: 首页>>代码示例>>PHP>>正文


PHP orders::productionTargetInReset方法代码示例

本文整理汇总了PHP中orders::productionTargetInReset方法的典型用法代码示例。如果您正苦于以下问题:PHP orders::productionTargetInReset方法的具体用法?PHP orders::productionTargetInReset怎么用?PHP orders::productionTargetInReset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在orders的用法示例。


在下文中一共展示了orders::productionTargetInReset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: elseif

 if ($order_type == 'SP') {
     $class_jo->updateItemStockStatus($oiid, 'D');
     if ($oi['status'] != $new_status) {
         //PRODUCT IS NOT YET MOVED TO IN HH TAB
         $class_jo->updateItemStatus($oiid, $new_status, 'auto-set');
         if ($oi['status'] < 4) {
             $class_jo->productionTargetInReset($oi);
         }
     }
 } elseif ($order_type == 'JG') {
     $class_o->updateProductStockStatus($oiid, 'D');
     if ($oi['status'] != $new_status) {
         //PRODUCT IS NOT YET MOVED TO IN HH TAB
         $class_o->updateProductStatus($oiid, $new_status, 'auto-set');
         if ($oi['status'] < 4) {
             $class_o->productionTargetInReset($oi);
         }
     }
 }
 //IF SOURCE ORDER STATUS IS (NEW/SOURCING) OR (READY AND PI IS NOT YET PRINTED)
 if (in_array($oi['status'], $oi_status_to_reset_stock_status) || $oi['status'] == '3' && $oi['print_count'] == 0) {
     //CHECK STOCK STATUS TO DECIDE WHAT STOCK SHOULD BE READDED
     if ($oi['stock_status'] == 'R') {
         //ADD BACK ELEMENTS STOCK AUTOMATICALLY
         $eu = countElementsUsage($oi);
         foreach ($eu as $e_id => $e_qty) {
             if (!in_array($elements_categories[$e_id], $STOCKLESS_ELEMENTS_CATEGORY)) {
                 $stock_id = $e_id;
                 $order_qty = $oi['order_quantity'] * $e_qty;
                 $class_es->addStockByPieces($whid_elements, $e_id, $order_qty, 'ADD-EL ' . $order_type . '-' . $oiid);
                 $elements_stock[$stock_id] += $order_qty;
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:31,代码来源:process-open-orders.php

示例2: updateStatus

 function updateStatus($items_id, $new_status, $updater = '', $add_to_prod_target = true)
 {
     use_class('production_target');
     $pt = new production_target();
     list($new_status, $sub_status) = explode('-', $new_status);
     $item = $this->retrieveDetail($items_id);
     $is_outsourced = $this->isOutsourceOrder($item['trans_type'], $item['trans_id']);
     $timestamp = date('Y-m-d H:i:s');
     $sub_status = trim(strtoupper($sub_status));
     if ($new_status == '10') {
         $this->doCancelOrders($items_id, $item['status'], $updater);
     } else {
         if ($add_to_prod_target) {
             if (!$is_outsourced) {
                 //outsourcing orders should never affect the Finish KPI Graphs
                 if ($new_status == '5') {
                     $pt->addDataToField($timestamp, 'finish', $item['quantity']);
                 }
             }
             if ($new_status == '6') {
                 $pt->addDataToField($timestamp, 'package', $item['quantity']);
             }
             if ($new_status == '7') {
                 $pt->addDataToField($timestamp, 'sent', $item['quantity']);
             }
         }
         if ($new_status == '4' && $sub_status != '') {
             $set_prod_status = ", prod_status = '" . $sub_status . "'";
         }
         //PS: please don't set empty prod_status when it updated to status > 4,...
         //...since this will used for check whether order could transferred to DP or not...
         //...when real order taken over by HH while order still on production
         tep_db_query("UPDATE depot_orders SET status='{$new_status}' {$set_prod_status} WHERE depot_orders_id={$items_id}");
         $save_main_status_history = true;
         //if ( ( in_array($item['status'], array('1','3','4','5')) && $new_status=='4' ) && ( $sub_status!='' && ( trim(strtoupper($item['prod_status'])) != $sub_status ) ) ) {
         /*
         $item['status'] = 1 is included here to also save prod. status history when there's real order cancelled/taken over by hh caused using depot hh stock
         while real order is already processed in production, finish, or in package. The first status created was 1.
         */
         //replace using below, allowing all process which set to production to have a chance saving the prod. status history
         if ($new_status == '4' && $sub_status != '' && trim(strtoupper($item['prod_status'])) != $sub_status) {
             $psh = array();
             $psh['orders_items_id'] = $items_id;
             $psh['type'] = 'DP';
             $psh['status'] = $sub_status;
             $psh['status_quantity'] = $item['quantity'];
             $psh['status_date'] = $timestamp;
             $psh['update_by'] = $updater;
             saveProductionStatusHistory($psh);
             if ($item['status'] == '4') {
                 $save_main_status_history = false;
             }
         }
         if ($save_main_status_history) {
             $sda = array();
             $sda['depot_orders_id'] = $items_id;
             $sda['status'] = $new_status;
             $sda['update_time'] = $timestamp;
             $sda['update_by'] = $updater;
             tep_db_perform('depot_orders_status_history', $sda);
         }
         if (!$is_outsourced) {
             if ($new_status == '2' && $item['stock_status'] != 'S' && $item['stock_status'] != 'W') {
                 $this->updateStockStatus($items_id, false);
                 $this->prodStatusReset($items_id);
                 $this->eanPrintedReset($items_id);
                 //$this->printCountReset($items_id);    //now we don't need to reset print_count for reprint pi when move to ready again.
             } elseif ($new_status == '3' && $item['stock_status'] == 'S' || $new_status == '4' && $item['stock_status'] == 'W') {
                 $eu = $this->countElementsUsage($item['products_id'], $item['articles_id']);
                 if (count($eu) > 0) {
                     $jng_warehouses_id = '1';
                     use_class('elements_stock');
                     $class_es = new elements_stock();
                     foreach ($eu as $elements_id => $euqty) {
                         $reduce_amount = $item['quantity'] * $euqty;
                         $class_es->reduceStockByPieces($jng_warehouses_id, $elements_id, $reduce_amount, 'RED DP-' . $items_id);
                     }
                 }
                 $this->updateStockStatus($items_id, 'R');
             }
         }
     }
     switch ($item['trans_type']) {
         case 'SP':
             use_class('jng_sp_orders');
             $class_jo = new jng_sp_orders();
             $item_sp = $class_jo->retrieveItemDetail($item['trans_id']);
             if ($item['status'] == '1' && ($new_status == '2' || $new_status == '3')) {
                 $class_jo->productionTargetIn($timestamp, $item_sp);
             } elseif ($new_status == '6') {
                 $class_jo->productionTargetOut($timestamp, $item_sp);
             } elseif ($new_status == '12') {
                 $class_jo->productionTargetInReset($item_sp);
             }
             break;
         case 'JG':
             use_class('orders');
             $class_o = new orders();
             $item_jg = $class_o->retrieveProductDetail($item['trans_id']);
             if ($item['status'] == '1' && ($new_status == '2' || $new_status == '3')) {
//.........这里部分代码省略.........
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:101,代码来源:depot_orders.php


注:本文中的orders::productionTargetInReset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。