|
@@ -444,7 +444,7 @@ class Payment extends BaseController
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 对账付款状态审核 status 0 待提交 1 待采购审核 2 待财务审核 3 审核成功 4 采购驳回 5 财务驳回
|
|
|
+ * 对账付款状态审核 status 0 待提交 1 待买方审核 2 审核成功 3驳回
|
|
|
* @param \think\Request $request
|
|
|
* @return \think\Response
|
|
|
*/
|
|
@@ -477,7 +477,8 @@ class Payment extends BaseController
|
|
|
];
|
|
|
$result = Db::name("pay")->where("payNo","=",$payNo)->update($update);
|
|
|
if($result){
|
|
|
- if($status==4 || $status==5){
|
|
|
+
|
|
|
+ if($status==3){
|
|
|
$cgdup =Db::name("cgd_info")->where(["sequenceNo"=>$cgdNo,"status"=>1])->update(['status'=>0,"updatetime"=>date("Y-m-d H:i:s")]);
|
|
|
if($cgdup==false){
|
|
|
Db::rollback();
|
|
@@ -515,7 +516,7 @@ class Payment extends BaseController
|
|
|
if($data==false){
|
|
|
return error_show(1004,"未能找到对应数据");
|
|
|
}
|
|
|
- if($data['status']==3){
|
|
|
+ if($data['status']==2){
|
|
|
return error_show(1004,"对账单已审核通过");
|
|
|
}
|
|
|
$cgdNo = Db::name("pay_info")->where(["payNo"=>$payNo,"is_del"=>0])->column("cgdNo");
|
|
@@ -569,7 +570,7 @@ class Payment extends BaseController
|
|
|
}
|
|
|
$cgdNo =Db::name("pay_info")->where(["payNo"=>$payNo,"is_del"=>0])->column("cgdNo");
|
|
|
if(empty($cgdNo)) return error_show(1004,"未找到对账采购单信息");
|
|
|
- if($payinfo['status']!=3){
|
|
|
+ if($payinfo['status']!=2){
|
|
|
return error_show(1004,"对账未审核完成");
|
|
|
}
|
|
|
$pay_fee = isset($post['pay_fee'])&& $post['pay_fee']!="" ? floatval($post['pay_fee']) :"";
|
|
@@ -622,7 +623,7 @@ class Payment extends BaseController
|
|
|
|
|
|
/**
|
|
|
* 付款申请审核状态
|
|
|
- * 付款审核状态 0待发起 1待业务审核 2 待财务审核 3待付款回执 4 付款回执 5 业务驳回 6 财务驳回
|
|
|
+ * 付款审核状态 0待发起 1待业务审核 2 待回执 3付款完成 4 驳回
|
|
|
* @param int $id
|
|
|
* @return \think\Response
|
|
|
*/
|
|
@@ -637,7 +638,7 @@ class Payment extends BaseController
|
|
|
if($status==""){
|
|
|
return error_show(1004,"参数status 不能为空");
|
|
|
}
|
|
|
- if(!in_array($status,[0,1,2,3,4,5,6])){
|
|
|
+ if(!in_array($status,[0,1,2,3,4])){
|
|
|
return error_show(1004,"参数status 无效值");
|
|
|
}
|
|
|
|
|
@@ -651,7 +652,7 @@ class Payment extends BaseController
|
|
|
if($payinfo==false){
|
|
|
return error_show(1005,"未找到对账信息");
|
|
|
}
|
|
|
- if($payinfo['status']!=3){
|
|
|
+ if($payinfo['status']!=2){
|
|
|
return error_show(1005,"对账信息未完成审核");
|
|
|
}
|
|
|
$cgdNo =Db::name("pay_info")->where(["payNo"=>$payment['payNo'],"is_del"=>0])->column("cgdNo");
|
|
@@ -659,7 +660,7 @@ class Payment extends BaseController
|
|
|
$remark = isset($post['remark'])? trim($post['remark']) :"";
|
|
|
$image = isset($post['return_image'])? trim($post['return_image']) :"";
|
|
|
$return_time = isset($post['return_time'])? trim($post['return_time']) :"";
|
|
|
- if($status==4){
|
|
|
+ if($status==3){
|
|
|
if($image=="")return error_show(1005,"付款回单图片不能为空");
|
|
|
if($return_time=="")return error_show(1005,"付款回单时间不能为空");
|
|
|
if($payinfo['pay_fee']< $payment['pay_fee'])return error_show(1005,"对账付款申请金额有误,请确认对账申请金额");
|
|
@@ -670,8 +671,8 @@ class Payment extends BaseController
|
|
|
if($status==4) $mentupdate['return_time'] = $return_time;
|
|
|
$payup=Db::name("pay_payment")->where($payment)->update($mentupdate);
|
|
|
if($payup){
|
|
|
- if (in_array($status,[4,5,6])){
|
|
|
- if($status==4){ //审核通过 扣减对账付款中的金额 添加到已付金额
|
|
|
+ if (in_array($status,[3,4])){
|
|
|
+ if($status==3){ //审核通过 扣减对账付款中的金额 添加到已付金额
|
|
|
$payupdate =[
|
|
|
"apay_fee"=>$payinfo['apay_fee']+$payment['pay_fee'],
|
|
|
"pay_fee"=>$payinfo['pay_fee']-$payment['pay_fee'],
|
|
@@ -679,7 +680,7 @@ class Payment extends BaseController
|
|
|
"updatetime" => date("Y-m-d H:i:s")
|
|
|
];
|
|
|
}
|
|
|
- if($status==5||$status==6){//审核驳回 扣减对账付款中的金额 返回到待付金额中
|
|
|
+ if($status==4){//审核驳回 扣减对账付款中的金额 返回到待付金额中
|
|
|
$payupdate =[
|
|
|
"wpay_fee"=>$payinfo['wpay_fee']+$payment['pay_fee'],
|
|
|
"pay_fee"=>$payinfo['pay_fee']-$payment['pay_fee'],
|
|
@@ -738,13 +739,13 @@ class Payment extends BaseController
|
|
|
try{
|
|
|
$paym = Db::name("pay_payment")->where($payment)->update(["is_del"=>1,"updatetime"=>date("Y-m-d H:i:s")]);
|
|
|
if($paym){
|
|
|
- if(in_array($payment['status'],[1,2,3,4])){
|
|
|
- if(in_array($payment['status'],[1,2,3])){
|
|
|
+ if(in_array($payment['status'],[1,2,3])){
|
|
|
+ if(in_array($payment['status'],[1,2])){
|
|
|
$payinfo['wpay_fee']+=$payment['pay_fee'];
|
|
|
$payinfo['pay_fee']-=$payment['pay_fee'];
|
|
|
$payinfo['updatetime']=date("Y-m-d H:i:s");
|
|
|
}
|
|
|
- if($payment['status']==4){
|
|
|
+ if($payment['status']==3){
|
|
|
$payinfo['wpay_fee']+=$payment['pay_fee'];
|
|
|
$payinfo['apay_fee']-=$payment['pay_fee'];
|
|
|
$payinfo['pay_status']=$payinfo['apay_fee']==0? 1 : 2 ;
|
|
@@ -937,7 +938,7 @@ class Payment extends BaseController
|
|
|
if($payinfo==false){
|
|
|
return error_show(1004,"对账单数据未找到");
|
|
|
}
|
|
|
- if($payinfo['status']!=3){
|
|
|
+ if($payinfo['status']!=2){
|
|
|
return error_show(1004,"对账单数据未完成审核");
|
|
|
}
|
|
|
// $type = isset($post['invType']) && $post['invType']!="" ? intval($post['invType']):"";
|