feat: 对账小账本按归属日期统计

This commit is contained in:
souplearn
2026-07-25 05:08:43 +08:00
parent f73c3a1166
commit 2de4b9009a
2 changed files with 50 additions and 15 deletions
+15
View File
@@ -0,0 +1,15 @@
from app.routers import reconciliation
def test_fold_reported_good_quantity_rows_uses_allocation_month_for_latest_process_only():
rows = [
("嘉恒", "产品A", "1序", 7, 999),
("嘉恒", "产品A", "2序", 7, 350),
("嘉恒", "产品A", "2序", 8, 300),
]
latest_processes = {("嘉恒", "产品A"): {"2序"}}
totals = reconciliation._fold_reported_good_quantity_rows(rows, latest_processes)
assert totals[("嘉恒", "产品A", 7)] == 350
assert totals[("嘉恒", "产品A", 8)] == 300