瀏覽代碼

Merge branch 'dev_wf' of wugg/phpstock into version1.5

wufeng 2 年之前
父節點
當前提交
b0a88de469
共有 1 個文件被更改,包括 11 次插入2 次删除
  1. 11 2
      app/admin/controller/Reorder.php

+ 11 - 2
app/admin/controller/Reorder.php

@@ -946,6 +946,16 @@ class Reorder extends Base
                         "order_status" =>$orderinfo['status'],"before_status"=>$lor
                     ]);
 
+                    //对应采购单也要处理
+                    ProcessOrder::AddProcess(['id' => $this->uid, 'nickname' => $this->uname], [
+                        "order_type" => 'CGD',
+                        "order_code" => $cgd['cgdNo'],
+                        "order_id" => $cgd["id"],
+                        "order_status" => $cgd['status'],
+                        "before_status" => $lor,
+                        'holder_id' => Db::name('supplier')->where(['code' => $cgd['supplierNo'], 'is_del' => 0])->value('personid', 0)
+                    ]);
+
                     if($orderinfo['is_stock'] == 1 || $info['is_th'] == 0){
                         $wsmcode = $orderinfo['is_stock'] == 1 ? $cgd['wsm_code'] : $info['return_wsm'];
                         if ($wsmcode == "") {
@@ -1158,8 +1168,7 @@ class Reorder extends Base
         if($order['wsend_num']!=$order['good_num']){
         	  return error_show(1005,"订单未发货数量与总数不等,无法全退");
         }
-        $retrun =Db::name("sale_return")->where([["orderCode","=",$orderCode],["is_del","=",0],["status","<",4]])
-            ->count();
+        $retrun =Db::name("sale_return")->where([["orderCode","=",$orderCode],["is_del","=",0],["status","<",4]])->count();
         if($retrun>0){
             return error_show(1005,"存在退货订单数据");
         }