|
@@ -148,8 +148,7 @@ class Resign extends Base
|
|
|
if($supplier==false) return error_show(1004,"未找到供应商数据");
|
|
|
$bk= Db::name("purchease")->where([["spuCode","=",$good_code],["status","<>",2],["is_del","=",0]])->find();
|
|
|
if($bk!=false) return error_show(1004,"存在未完成备库单数据");
|
|
|
- $cgd =Db::name("purchease_order")->where([["spuCode","=",$good_code],["status","in",[0,1]],["is_del","=",0]])
|
|
|
- ->find();
|
|
|
+ $cgd =Db::name("purchease_order")->where([["spuCode","=",$good_code],["status","in",[0,1]],["is_del","=",0]])->find();
|
|
|
if($cgd!=false) return error_show(1004,"存在未完成采购单数据");
|
|
|
//查验仓库库存数量
|
|
|
$stock =Db::name("good_stock")->alias("a")->leftJoin("warehouse_info b","a.wsm_code=b.wsm_code")->where
|
|
@@ -203,6 +202,15 @@ class Resign extends Base
|
|
|
ProcessOrder::AddProcess($token,$order);
|
|
|
$ste = ["order_code"=>$bk_code,"status"=>0,"action_remark"=>'',"action_type"=>"create"];
|
|
|
ActionLog::logAdd($token,$ste,"BHD",1,$info);
|
|
|
+
|
|
|
+ //台账记录
|
|
|
+ Db::name('standing_book')
|
|
|
+ ->insert([
|
|
|
+ 'standBookNo' => makeNo("IO"),
|
|
|
+ 'bk_code' => $bk_code,
|
|
|
+ 'addtime' => date('Y-m-d H:i:s'),
|
|
|
+ 'updatetime' => date('Y-m-d H:i:s')
|
|
|
+ ]);
|
|
|
return app_show(0,"新建成功",['bk_code'=>$bk_code]);
|
|
|
}else{
|
|
|
return error_show(1005,"新建失败");
|