|
@@ -187,9 +187,12 @@ class Purchin extends Base
|
|
return error_show(1005,"未找到采购单数据");
|
|
return error_show(1005,"未找到采购单数据");
|
|
}
|
|
}
|
|
if($cgdinfo['status']==0){
|
|
if($cgdinfo['status']==0){
|
|
- return error_show(1005,"采购单未发货");
|
|
|
|
|
|
+ return error_show(1005,"采购单未确认");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ $isreturn = cgd_sale_return($cgdNo);
|
|
|
|
+ if($isreturn){
|
|
|
|
+ return error_show(1005, "关联销售单存在退货单正在进行");
|
|
|
|
+ }
|
|
$wsm_in_code = makeNo("CF");
|
|
$wsm_in_code = makeNo("CF");
|
|
$bn_code = makeNo("BN");
|
|
$bn_code = makeNo("BN");
|
|
$wsminfo = Db::name("warehouse_info")->where(["wsm_code"=>$cgdinfo['wsm_code'],"is_del"=>0])->find();
|
|
$wsminfo = Db::name("warehouse_info")->where(["wsm_code"=>$cgdinfo['wsm_code'],"is_del"=>0])->find();
|
|
@@ -373,10 +376,10 @@ class Purchin extends Base
|
|
if($cgdinfo['send_status']==3 && $cgdinfo['order_type']!=1){
|
|
if($cgdinfo['send_status']==3 && $cgdinfo['order_type']!=1){
|
|
$send=Db::name("order_send")->where(["cgdNo"=>$cgdNo,"status"=>1])->column("outCode");
|
|
$send=Db::name("order_send")->where(["cgdNo"=>$cgdNo,"status"=>1])->column("outCode");
|
|
if(!empty($send)){
|
|
if(!empty($send)){
|
|
- $out =Db::name("order_out")->where(["outCode"=>$send,"status"=>0])->select()->toArray();
|
|
|
|
|
|
+ $out =Db::name("order_out")->where(["outCode"=>$send,"status"=>0,"is_del"=>0])->select()
|
|
|
|
+ ->toArray();
|
|
if(!empty($out)){
|
|
if(!empty($out)){
|
|
- $up =Db::name("order_out")->where(["outCode"=>$send,"status"=>0])->update
|
|
|
|
- (["status"=>1,'wsm_code'=>$cgdinfo['wsm_code'],"updatetime"=>date('Y-m-d H:i:s')]);
|
|
|
|
|
|
+ $up =Db::name("order_out")->where(["outCode"=>$send,"status"=>0,"is_del"=>0])->update(["status"=>1,'wsm_code'=>$cgdinfo['wsm_code'],"updatetime"=>date('Y-m-d H:i:s')]);
|
|
if($up==false){
|
|
if($up==false){
|
|
Db::rollback();
|
|
Db::rollback();
|
|
return error_show(1004,"出库单出库失败");
|
|
return error_show(1004,"出库单出库失败");
|