提交 a264da3a authored 作者: chengye's avatar chengye

test

上级 a10677d3
......@@ -136,6 +136,8 @@ class WriteOff extends Controller
if($payment->balance == 0) continue;
foreach ($invs as $index => $inv) {
if ($inv->payment_balance == 0) continue;
$dk_balance = 0;
$balanceMode = new EmPaymentInvoiceBalance();
$balanceMode->payment_id = $payment->payment_id;
$balanceMode->invoice_id = $inv->invoice_id;
......@@ -143,7 +145,7 @@ class WriteOff extends Controller
//如果该缴费单可以完全消除当前账单额度
if ($payment->balance >= $inv->payment_balance) {
//单笔销账多少
$balanceMode->balance = $inv->payment_balance;
$balanceMode->balance = $dk_balance = $inv->payment_balance;
$payment->balance = $payment->balance - $inv->payment_balance;
//账单额度变化
......@@ -159,6 +161,8 @@ class WriteOff extends Controller
$inv->payment_balance = $inv->payment_balance - $payment->balance;
//缴费额度变化
$payment->balance = 0;
$dk_balance = $inv->balance;
}
//更新账单状态
......@@ -177,7 +181,7 @@ class WriteOff extends Controller
$result++;
$balanceMode->isUpdate(false)->save();
if($inv->is_pay != 1) $this->computerAmount($inv->account_id,$balanceMode->balance);
if($inv->is_pay != 1) $this->computerAmount($inv->account_id,$dk_balance);
}
}
$msg = $result == 0 ? '已审核,没有找到可销账的缴费单.' : '已审核,成功销账 '.$result.' 笔账单.';
......
......@@ -165,7 +165,7 @@
{/if}
{if $fk.oafk_numb == '' && check_ele_permission('payment/payoa') && $payment.status == 1}
<button class="layui-btn" lay-filter="pay" lay-submit="">
提交付款
付款
</button>
{elseif check_ele_permission('payment/checkPayment') && $payment.status == 0 /}
<button class="layui-btn" lay-filter="pass" lay-submit="">
......
......@@ -141,7 +141,7 @@
<div class="layui-form-item layui-col-md-offset4">
<button class="layui-btn" lay-filter="submit" lay-submit="">
创建
提交
</button>
</div>
</div>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论