|
@@ -1013,7 +1013,10 @@ class Payment extends BaseController
|
|
|
if($payinfo==false){
|
|
|
return error_show(1004,"对账单数据未找到");
|
|
|
}
|
|
|
-
|
|
|
+ $result=$this->checkSupplier($payinfo['supplierNo']);
|
|
|
+ if($result['code']!=0){
|
|
|
+ return error_show($result['code'],$result['message']);
|
|
|
+ }
|
|
|
if($payinfo['status']!=2){
|
|
|
return error_show(1004,"对账单数据未完成审核");
|
|
|
}
|
|
@@ -1610,6 +1613,10 @@ class Payment extends BaseController
|
|
|
if($valide->check($param)==false)return error_show(1004,$valide->getError());
|
|
|
$hpinfo =Db::name("pay_invoice")->where([["hpNo","=",$param['hpNo']],["is_del","=",0]])->findOrEmpty();
|
|
|
if(empty($hpinfo)) return error_show(1004,"回票信息未找到");
|
|
|
+ $result=$this->checkSupplier($hpinfo['supplierNo']);
|
|
|
+ if($result['code']!=0){
|
|
|
+ return error_show($result['code'],$result['message']);
|
|
|
+ }
|
|
|
if($hpinfo['status']!=4)return error_show(1004,"回票信息流程未完成");
|
|
|
$isR=Db::name("pay_return")->where(["orderCode"=>$param['hpNo'],"status"=>[1,2],"is_del"=>0])->findOrEmpty();
|
|
|
if(!empty($isR))return error_show(1004,"回票信息退票流程已存在");
|
|
@@ -1753,6 +1760,10 @@ class Payment extends BaseController
|
|
|
if($valide->check($param)==false)return error_show(1004,$valide->getError());
|
|
|
$hpinfo =Db::name("pay_payment")->where([["dzNo","=",$param['dzNo']],["is_del","=",0]])->findOrEmpty();
|
|
|
if(empty($hpinfo)) return error_show(1004,"付款信息未找到");
|
|
|
+ $result=$this->checkSupplier($hpinfo['supplierNo']);
|
|
|
+ if($result['code']!=0){
|
|
|
+ return error_show($result['code'],$result['message']);
|
|
|
+ }
|
|
|
if(!in_array($hpinfo['status'],[3,4]))return error_show(1004,"付款信息流程未完成");
|
|
|
$isR=Db::name("pay_return")->where(["orderCode"=>$param['dzNo'],"status"=>[1,2],"is_del"=>0])->findOrEmpty();
|
|
|
if(!empty($isR))return error_show(1004,"付款信息退款流程已存在");
|
|
@@ -2007,4 +2018,18 @@ class Payment extends BaseController
|
|
|
excelExport("{$param['payNo']}对账采购单详情",array_keys($cgdlist[0]),$cgdlist);
|
|
|
}
|
|
|
|
|
|
+ /**校验供应商下面是否有操作账户
|
|
|
+ * @param $supplierNo 供应商账户
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ private function checkSupplier($supplierNo){
|
|
|
+ $companyinfo = UserHandle("/userCompanyBasicList", ["companyNo" =>$supplierNo]);
|
|
|
+ if ($companyinfo['code'] != 0) return ["code"=>$companyinfo['code'],"message"=> $companyinfo['message']];
|
|
|
+ if (!empty($companyinfo['data']) && $companyinfo['data']['count'] > 0) {
|
|
|
+ return ["code"=>1004,"message"=> "供应商公司存在操作账户,请用供应商账户操作"];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ return ["code"=>0,"message"=> "业务账户可操作"];
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|