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


PHP orders::productionTargetOut方法代码示例

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


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

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