Ally savings-only statements: separate account per savings number, own coverage row
build-container / build (push) Successful in 39s
build-container / build (push) Successful in 39s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1f556bccfa
commit
5425d9913a
2 files changed
+8
-4
No files matched your search
@@ -36,6 +36,7 @@ def coverage(sts):
|
||||
out = []
|
||||
for acct, lst in by.items():
|
||||
csv_only = all(s.kind == "csv" for s in lst)
|
||||
ends = {s.end.day for s in lst}; day = cfg.get(acct) or (ends.pop() if len(ends) == 1 and max(ends) < 28 else None) # accounts not in ACCOUNTS: reuse their usual closing day
|
||||
cells, first = {}, min((s.start or s.end) for s in lst)
|
||||
for mo in months:
|
||||
y, m = int(mo[:4]), int(mo[5:])
|
||||
@@ -44,7 +45,7 @@ def coverage(sts):
|
||||
cells[mo] = "have" if have else ("future" if (y, m) > (max(s.end for s in lst).year, max(s.end for s in lst).month) else ("none" if (y, m) < (first.year, first.month) else "missing"))
|
||||
continue
|
||||
have = any((s.end.year, s.end.month) == (y, m) for s in lst)
|
||||
due = dt.date(y, m, cfg.get(acct) or eom(y, m))
|
||||
due = dt.date(y, m, day or eom(y, m))
|
||||
started = (y, m) >= (min(s.end for s in lst).year, min(s.end for s in lst).month)
|
||||
cells[mo] = "have" if have else ("none" if not started else ("future" if due > today else "missing"))
|
||||
last = max(s.end for s in lst)
|
||||
@@ -52,8 +53,8 @@ def coverage(sts):
|
||||
nxt = f"Next download: from {last + dt.timedelta(days=1):%b %-d, %Y}"
|
||||
else:
|
||||
ny, nm = (last.year, last.month + 1) if last.month < 12 else (last.year + 1, 1)
|
||||
if cfg.get(acct) is None and last.day != eom(last.year, last.month): ny, nm = last.year, last.month
|
||||
nd = dt.date(ny, nm, cfg.get(acct) or eom(ny, nm))
|
||||
if day is None and last.day != eom(last.year, last.month): ny, nm = last.year, last.month
|
||||
nd = dt.date(ny, nm, day or eom(ny, nm))
|
||||
nxt = f"Next statement closes ~{nd:%b %-d, %Y}" + (" (ready to download)" if nd <= today else "")
|
||||
if acct in recent and recent[acct] > last: nxt += f" · recent activity loaded through {recent[acct]:%b %-d}"
|
||||
out.append(dict(account=acct, cells=cells, count=len(lst), through=f"{last:%b %-d, %Y}", next=nxt, kind="csv" if csv_only else "pdf"))
|
||||
|
||||
Reference in new issue
Block a user