|
@@ -240,13 +240,36 @@ class Sale extends BaseController{
|
|
]);
|
|
]);
|
|
if($vali->check($post)==false) return error_show(1004,$vali->getError());
|
|
if($vali->check($post)==false) return error_show(1004,$vali->getError());
|
|
$qrdinf =Db::name("qrd_info")->where(["sequenceNo|cxCode"=>$post['orderCode'],"status"=>1,"is_del"=>0])->column("sequenceNo");
|
|
$qrdinf =Db::name("qrd_info")->where(["sequenceNo|cxCode"=>$post['orderCode'],"status"=>1,"is_del"=>0])->column("sequenceNo");
|
|
- if(!empty($qrdinf))return error_show(1005,"结算存在对账中的订单".implode(",",$qrdinf));
|
|
|
|
|
|
+ if(!empty($qrdinf)){
|
|
|
|
+ $asscoinfo =Db::name("assoc")->where(["ocderCode"=>$qrdinf,"status"=>[1,2],"is_del"=>0])->column("viceCode","type");
|
|
|
|
+ $message="该销售订单在结算中已参与了以下业务,请全部解除后在申请,";
|
|
|
|
+ if(isset($asscoinfo[1]))$message.="开票申请编号:".$asscoinfo[1]."\r\n";
|
|
|
|
+ if(isset($asscoinfo[2]))$message.="资金认领编号:".$asscoinfo[2]."\r\n";
|
|
|
|
+ return error_show(1005,$message);
|
|
|
|
+ }
|
|
$cgdinfo =Db::name("cgd_info")->where(["cxCode"=>$post['orderCode'],"status"=>1,"is_del"=>0])->column("sequenceNo");
|
|
$cgdinfo =Db::name("cgd_info")->where(["cxCode"=>$post['orderCode'],"status"=>1,"is_del"=>0])->column("sequenceNo");
|
|
- if(!empty($cgdinfo))return error_show(1005,"结算存在对账中的采购订单".implode(",",$cgdinfo));
|
|
|
|
|
|
+ if(!empty($cgdinfo)){
|
|
|
|
+ $message="该销售采购订单在结算中已参与了以下业务,请全部解除后在申请,";
|
|
|
|
+ $payinfo = Db::name("pay_info")->where(["cgdNo"=>$cgdinfo,"status"=>1,"is_del"=>0])->column("payNo");
|
|
|
|
+ if(!empty($payinfo))$message.="对账单编号:".implode(",",$payinfo)."\n";
|
|
|
|
+ $hp = Db::name("pay_invoice")->where(["payNo"=>$payinfo,"is_del"=>0,"status"=>[1,2,3,4]])->column("hpNo");
|
|
|
|
+ if(!empty($hp))$message.="对账单回票编号:".implode(",",$hp)."\n";
|
|
|
|
+ $paydz = Db::name("pay_payment")->where(["payNo"=>$payinfo,"is_del"=>0,"status"=>[1,2,3,4]])->column("dzNo");
|
|
|
|
+ if(!empty($paydz))$message.="对账单付款编号:".implode(",",$paydz)."\n";
|
|
|
|
+ return error_show(1005,$message);
|
|
|
|
+ }
|
|
if($post['isCgd']==1){
|
|
if($post['isCgd']==1){
|
|
- $cgdinfo =Db::name("cgd_info")->where(["qrdCode"=>$post['orderCode'],"status"=>1,"is_del"=>0])->column
|
|
|
|
- ("sequenceNo");
|
|
|
|
- if(!empty($cgdinfo))return error_show(1005,"结算存在对账中的采购订单".implode(",",$cgdinfo));
|
|
|
|
|
|
+ $cgdinfo =Db::name("cgd_info")->where(["qrdCode"=>$post['orderCode'],"status"=>1,"is_del"=>0])->column("sequenceNo");
|
|
|
|
+ if(!empty($cgdinfo)){
|
|
|
|
+ $message="该销售采购订单在结算中已参与了以下业务,请全部解除后在申请,";
|
|
|
|
+ $payinfo = Db::name("pay_info")->where(["cgdNo"=>$cgdinfo,"status"=>1,"is_del"=>0])->column("payNo");
|
|
|
|
+ if(!empty($payinfo))$message.="对账单编号:".implode(",",$payinfo)."\n";
|
|
|
|
+ $hp = Db::name("pay_invoice")->where(["payNo"=>$payinfo,"is_del"=>0,"status"=>[1,2,3,4]])->column("hpNo");
|
|
|
|
+ if(!empty($hp))$message.="对账单回票编号:".implode(",",$hp)."\n";
|
|
|
|
+ $paydz = Db::name("pay_payment")->where(["payNo"=>$payinfo,"is_del"=>0,"status"=>[1,2,3,4]])->column("dzNo");
|
|
|
|
+ if(!empty($paydz))$message.="对账单付款编号:".implode(",",$paydz)."\n";
|
|
|
|
+ return error_show(1005,$message);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return app_show(0,"不存在对账订单");
|
|
return app_show(0,"不存在对账订单");
|
|
}
|
|
}
|