feat: add assessment workbench and September reconciliation
Preserve August hydrogen revision and September audit evidence; calculate interrupted vehicle history across all prior months. Record remaining carry-policy and layout-baseline discrepancies.
This commit is contained in:
+12
-3
@@ -87,7 +87,7 @@ def calc_jan_carryover(G1):
|
||||
g['cum_a'] = g['实际']
|
||||
g['cum_q'] = g['实际'] >= g['应考核'] and g['应考核'] > 0
|
||||
|
||||
def calc_month(month, G_all, all_data, G_prev, G_cur):
|
||||
def calc_month(month, G_all, all_data, G_prev, G_cur, *, cumulative_history=False):
|
||||
"""通用月计算: 结转/补发/累计补发/当月"""
|
||||
prev_m = month - 1
|
||||
days_m = DAYS[month]
|
||||
@@ -100,8 +100,17 @@ def calc_month(month, G_all, all_data, G_prev, G_cur):
|
||||
gp = G_prev.get(k)
|
||||
|
||||
# 累计
|
||||
cum_t = (gp['cum_t'] if gp else 0) + gm['应考核']
|
||||
cum_a = (gp['cum_a'] if gp else 0) + gm['实际']
|
||||
if cumulative_history:
|
||||
# Historical backpay scans all prior months, so its qualifying
|
||||
# mileage must cover that same vehicle/owner history, including
|
||||
# periods before an interruption. Do not reset at a missing month.
|
||||
history = [G_all[m][k] for m in range(1, month) if k in G_all.get(m, {})]
|
||||
cum_t = sum(g['应考核'] for g in history) + gm['应考核']
|
||||
cum_a = sum(g['实际'] for g in history) + gm['实际']
|
||||
else:
|
||||
# Retained for reproducing already-settled legacy workbooks.
|
||||
cum_t = (gp['cum_t'] if gp else 0) + gm['应考核']
|
||||
cum_a = (gp['cum_a'] if gp else 0) + gm['实际']
|
||||
cum_q = cum_a >= cum_t and cum_t > 0
|
||||
|
||||
# 结转: carry × 1 (整月, 不折算)
|
||||
|
||||
Reference in New Issue
Block a user