提交 a144a437 authored 作者: chengye's avatar chengye 提交者: wangkr

调整明细细节

上级 b868b02f
......@@ -422,26 +422,26 @@ class Payment extends Base
if($this->checkFkStatus($post['payment_id'])) return json(['status'=>0,'message'=>'该缴费单已经创建付款单无法再次创建.']);
$account = EmAccount::get(['account_id'=>$payment->account_id]);
$em = \app\em\model\Em::with('rule')->get($account->em_id);
$station = (new \app\em\model\Em)->getBaseInfo($account->em_id);
if($user['is_admin']) $staffName = 'admin';
else $staffName = substr($staff->email,0,strpos($staff->email,'@'));
$invs = (new EmPayment())->getinvsInfo($payment->payment_id);
$amount = 0;
foreach ($invs as $inv){
$details = [];
foreach ($invs as $k => $inv){
$details[$k]['chargeType'] = "维护电费";
if($inv->payment_balance == 0){
$amount += 0;
$details[$k]['amount'] = 0;
} else if($inv->payment_amount == $inv->payment_balance){
$amount += $inv->payment_amount;
$details[$k]['amount'] = $inv->payment_amount;
} else {
$amount += $inv->payment_amount - $inv->payment_balance;
$details[$k]['amount'] = $inv->payment_amount - $inv->payment_balance;
}
$details[$k]['projectNumber'] = $this->getCbzxCode($inv->account_id);
$details[$k]['contractNumber'] = $this->getEmContract($inv->account_id);
$details[$k]['receipt'] = '';
}
$amount = round($amount,2);
$data = [
'title'=>$post['title'],
......@@ -454,15 +454,7 @@ class Payment extends Base
'remarks'=>$post['remark'],
'type'=>2,
'date'=>$post['date'],
'details'=>[
[
'chargeType'=>"维护电费",
'amount'=> $amount,
'projectNumber'=> $station->proj_number,
'contractNumber'=> $em->rule->pay_protocol_numb,
'receipt'=>''
]
]
'details'=> $details
];
foreach ($data as $k => $v){
......@@ -534,4 +526,6 @@ class Payment extends Base
$res = (new EmPaymentFk())->get(['payment_id'=>$payment_id]);
return $res ? true : false;
}
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论