记账凭证

This commit is contained in:
CRM8000 2024-11-22 09:57:24 +08:00
parent 14f439405c
commit 15de9f612d

View File

@ -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