fix(工资核算): 排除起付比例中的历史发货
旧应收已经由期初余额承接,启用前发货再次进入分母, 会使新业务足额回款仍未达到起付门槛。 将销售额日期范围与 FIFO 的启用边界保持一致, 补充普通历史日期及二月末的两项回归用例。
This commit is contained in:
1 parent
108bf87225
commit
019817d6dc
2 files changed
+60
-2
No files matched your search
@@ -25,7 +25,7 @@ from app.services import audit_service, formula, payroll_months
|
||||
from app.services.audit_service import AuditRecord
|
||||
from app.services.param_service import resolve_snapshot
|
||||
from app.services.tplus.calculation_preview import _parameters
|
||||
from app.services.tplus.fifo import _beneficiary, amount_text, money, preview_group
|
||||
from app.services.tplus.fifo import START, _beneficiary, amount_text, money, preview_group
|
||||
from app.services.tplus.workbench import digest
|
||||
|
||||
|
||||
@@ -308,11 +308,13 @@ def _calculate_month(session, business, record, month, reason=None):
|
||||
}
|
||||
if set(previous) - current.keys():
|
||||
raise BadRequestError("历史已核算事件发生变化,请核对更正或调整,不可直接覆盖")
|
||||
# 启用前的发货由期初应收承接,不再进入新业务的起付比例分母。
|
||||
sales = sum(
|
||||
(
|
||||
money(s["amount"])
|
||||
for s in values["shipments"]
|
||||
if s["date"] <= until.isoformat() and not s.get("performance_excluded")
|
||||
if START.isoformat() <= s["date"] <= until.isoformat()
|
||||
and not s.get("performance_excluded")
|
||||
),
|
||||
Decimal(0),
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user