Browse Source

订单导入生成的采购单过滤

wufeng 2 years ago
parent
commit
9ec4024adf
2 changed files with 5 additions and 2 deletions
  1. 1 1
      app/admin/controller/Purch.php
  2. 4 1
      app/command/ImportOrderFromCHandleData.php

+ 1 - 1
app/admin/controller/Purch.php

@@ -24,7 +24,7 @@ class Purch extends Base
     public function  list(){
         $page = isset($this->post['page']) && $this->post['page'] !=="" ? intval($this->post['page']):"1";
         $size = isset($this->post['size']) && $this->post['size'] !=="" ? intval($this->post['size']):"10";
-        $where =[['is_del',"=",0]];
+        $where = [['is_del', "=", 0], ['order_type', '<>', 5]];//不显示类型为5即订单导入生成的采购单
         $bkcode = isset($this->post['bk_code']) && $this->post['bk_code']!="" ? trim($this->post['bk_code']):"";
         if($bkcode!=""){
             $where[]=['bkcode',"like", "%{$bkcode}%"];

+ 4 - 1
app/command/ImportOrderFromCHandleData.php

@@ -221,10 +221,12 @@ class ImportOrderFromCHandleData extends Command
                     }
                     if ($is_stock == 0) {
 
+                        //非库存品
                         $bol = $this->createCgd($cgd, $rm, $ri);
                         if ($bol == false) throw new Exception('订单创建失败');
 
                     } else {
+                        //库存品
                         $bol = $this->RelaCgd(['orderCode' => $orderCode, "good_num" => $good_num, "spuCode" => $spuCode, "companyNo" => $supplierNo]);
                         if ($bol == false) throw new Exception('库存商品关联采购单失败');
 
@@ -510,6 +512,7 @@ class ImportOrderFromCHandleData extends Command
     //创建.....
     private function RelaCgd(array $outinfo = [])
     {
+        //备库单
         $cgd = Db::name("order_bk")
             ->where([
                 ["spuCode", "=", $outinfo['spuCode']],
@@ -557,7 +560,7 @@ class ImportOrderFromCHandleData extends Command
             "send_num" => $outinfo['good_num'],
             "wsend_num" => 0,
             "remark" => $cgdinfo['remark'],
-            "status" => 3,
+            "status" => 3,//入库完成
             "lasttime" => $cgdinfo['lasttime'],
             "is_del" => 0,
             "order_type" => 5,