0.2.43: historical NAV backfill without touching current holdings

The batch history import now also records each quarter's NAV in the
fund's valuation history: the old file's HLD rows are matched by issuer
and security name against the book as it exists today, matched rows
write that quarter's valuations, unmatched rows are counted and
reported, and nothing outside the round is created or modified. A
manually signed quarter is never overwritten.

The single-file wizard automatically takes the same history-only path
when the file is older than the fund's newest round. Previously that
import would regress position cost basis to the old file's values and
resurrect since-exited positions, corrupting the fund's Invested total.
This commit is contained in:
Jonathan Kirkwood
2026-08-11 12:32:57 -05:00
parent ae967494bd
commit ebafcf19d9
11 changed files with 376 additions and 10 deletions
+5
View File
@@ -393,6 +393,11 @@ class BatchCapitalFileResult(BaseModel):
updated: int = 0 # matched a statement already at this as-of date
skipped: list[str] = [] # roster names with no existing member (not created)
error: str | None = None # file-level failure (bad password, no ALLOC SI, etc.)
# NAV history leg: the quarter's valuation round written from the file's HLD sheet.
nav_status: str | None = None # added | updated | kept-signed | no-match | no-hld | error
nav_matched: int = 0 # HLD rows matched to positions in today's book
nav_unmatched: int = 0 # HLD rows with no current position (sold/renamed since)
nav_cents: int = 0 # the quarter's NAV as recorded (matched rows only)
class BatchCapitalImportResult(BaseModel):