mirror of
https://gitee.com/crm8000/PSI
synced 2024-11-23 08:50:16 +00:00
记账凭证
This commit is contained in:
parent
14f439405c
commit
15de9f612d
@ -233,6 +233,24 @@ class VoucherDAO extends PSIBaseExDAO
|
||||
$billNumber = 0;
|
||||
}
|
||||
|
||||
$ignoreBalance = intval($bill["ignoreBalance"]) == 1;
|
||||
if (!$ignoreBalance) {
|
||||
// 检查分录金额合计是否相等
|
||||
$items = $bill["items"];
|
||||
$dbSum = 0;
|
||||
$crSum = 0;
|
||||
foreach ($items as $v) {
|
||||
$debit = floatval($v["debit"]);
|
||||
$credit = floatval($v["credit"]);
|
||||
|
||||
$dbSum += $debit;
|
||||
$crSum += $credit;
|
||||
}
|
||||
if ($dbSum != $crSum) {
|
||||
return $this->bad("分录金额合计不平,无法保存凭证");
|
||||
}
|
||||
}
|
||||
|
||||
// 检查orgId
|
||||
$sql = "select name
|
||||
from t_org
|
||||
|
Loading…
Reference in New Issue
Block a user