新增打款确认优化

master
chenzhi 3 years ago
parent 8afbda9a1a
commit 4d8e7de144

@ -586,7 +586,7 @@ class CompanyStatementOfflineController extends ThinkController
,'pay_time'=>strtotime($payment_time)
];
$unPayData = SM("company_statement_info_part","tab_")
$unPayData = M("company_statement_info_part","tab_")
->field("sum(statement_money) statement_money,info_id")
->where(["pay_status"=>0])
->group("info_id")
@ -597,7 +597,7 @@ class CompanyStatementOfflineController extends ThinkController
$handleData[$value['info_id']] = $value['statement_money'];
}
$payData = SM("company_statement_info_part","tab_")
$payData = M("company_statement_info_part","tab_")
->field("sum(statement_money) statement_money,info_id")
->group("info_id")
->select();
@ -613,11 +613,16 @@ class CompanyStatementOfflineController extends ThinkController
$time = date("Y-m-d H:i:s",time());
$unPayAmount = $value['statement_money']-$handlePayData[$value['id']];
$saveData['remark'] = $value['remark'];
$partInfo = M("company_statement_info_part","tab_")->where(['info_id'=>$value['id']])->order("id desc")->find();
$partCompanyInfo = json_decode($partInfo['company_info'],true);
$saveData['company_info'] = $partInfo['company_info'];
if($handleData[$value['id']]) {
$saveData['remark'] = "{$value['remark']} {$_SESSION['onethink_admin']['user_auth']['username']}于{$time}已打款{$handleData[$value['id']]},剩余{$unPayAmount}";
$saveData['remark'] .= ";{$_SESSION['onethink_admin']['user_auth']['username']}于{$time}向({$partCompanyInfo['payee_name']}/{$partCompanyInfo['opening_bank']}/{$partCompanyInfo['bank_account']})打款{$handleData[$value['id']]},剩余{$unPayAmount}";
}
SM("company_statement_info_part","tab_")
M("company_statement_info_part","tab_")
->where(['info_id'=>$value['id'],'pay_status'=>['neq',1]])
->save(["pay_status"=>1,'pay_time'=>strtotime($payment_time)]);
@ -629,7 +634,8 @@ class CompanyStatementOfflineController extends ThinkController
"pay_status"=>1,
"pay_info"=>json_encode(["payment_user"=>$_SESSION['onethink_admin']['user_auth']["username"],"payment_time"=>$payment_time]),
"remark"=>$saveData['remark'],
'pay_time'=>strtotime($payment_time)
'pay_time'=>strtotime($payment_time),
'company_info'=>$partInfo['company_info']
]);
} else {
$companyStatementInfo->where(['id'=>$value['id']])->save($saveData);

@ -779,6 +779,9 @@ class CompanyStatementPoolController extends ThinkController
$cline = $line+1;
if($is_export){
$v['statement_money'] = "=ROUND(";
$v['remark'] = str_replace(";","\n",$v['remark']);
}else{
$v['remark'] = str_replace(";","<br>",$v['remark']);
}
$handle_data = $this->changeDataStruct($v['statement_info'],$is_export,$week_line);
$v['statement_info'] = $handle_data;

@ -207,7 +207,7 @@
</if>
<td rowspan="{$com.row}"><if condition="$com['is_payment'] eq 1"><else /></if></td>
<if condition="!$is_special_export"><td rowspan="{$com.row}"><if condition="$com['st'] eq 0"><else /></if></td></if>
<if condition="!$is_special_export"><td rowspan="{$com.row}">{$com.remark}</td></if>
<if condition="!$is_special_export"><td rowspan="{$com.row}" style="text-align: left;max-width: 370px;">{$com.remark}</td></if>
<if condition="!$is_export">
<td rowspan="{$com.row}">

Loading…
Cancel
Save