From e1a24f6250f5e498e524ce14a5acbed5fc5c2a91 Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Tue, 22 Sep 2026 19:52:19 +0200 Subject: reports: income statement skips imported Stäng closings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- docs/DECISIONS.md | 10 +++++++++- docs/PROTOCOL.md | 6 +++++- docs/STATE.md | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index a0c613b..a109bda 100644 --- a/docs/DECISIONS.md +++ b/docs/DECISIONS.md @@ -333,7 +333,15 @@ kept verbatim from the STATE.md they were pruned from (2026-09-21). statement (Kapitas 2022-2026). **Decided 2026-09-19: no importer change.** Locked years stay locked and the source's closings stay in the books; the årsredovisning export flags incomplete jämförelsetal for those years and - points to the previous year's annual report. + points to the previous year's annual report. **Amended 2026-09-22**: the + income statement (and therefore INK2/SRU and the TUI resultatrapport) now + skips the same "Stäng ..." vouchers, so a year being declared shows its + real figures; the balance sheet keeps them (the result sits in 2099 and + must not be counted twice). The source's own #IB/#UB corrections that the + vouchers do not reproduce (e.g. Makandra's FY 2022/2023 result transfer + is 17 857.63 kr short of that year's P&L) remain a data divergence: the + derived balance sheet is off by that amount until a correction is booked + in the current year. 11. ~~SIE import only into an empty fiscal year; consider broader import.~~ Chronological multi-year import works (CRLF, `#RAR 0`, zero rows, `#IB` rule handled); each year must still target an empty fiscal year. Note: diff --git a/docs/PROTOCOL.md b/docs/PROTOCOL.md index 081eb6a..7d7a5e2 100644 --- a/docs/PROTOCOL.md +++ b/docs/PROTOCOL.md @@ -451,7 +451,11 @@ linked to that voucher and each item carries that `voucher_id`. | `sru.export` | `fiscal_year`, `adjustments?`, `submitter?`, `assisted?`, `audited?`, `ignore_unmapped?` | `INFO.SRU` + `BLANKETTER.SRU` (ISO-8859-1, base64) | All reports are pure reads, respect locks, and return JSON rows. Amounts are -öre. `report.general_ledger` (huvudbok) returns account blocks: +öre. `report.income_statement` (and therefore `sru.export` and the TUI +resultatrapport) ignores the source system's `"Stäng ..."` closing vouchers +in imported history years, where the P&L accounts are closed straight to +2099 and would otherwise net to zero; the K2 report uses the same rule. +`report.general_ledger` (huvudbok) returns account blocks: `{"fiscal_year","from","to","last_voucher":{...},"accounts":[{"account", "name","ib_ore","debit_ore","credit_ore","ub_ore","rows":[{"series", "number","date","description","row_description","debit_ore","credit_ore", diff --git a/docs/STATE.md b/docs/STATE.md index 4d448fe..19f22f6 100644 --- a/docs/STATE.md +++ b/docs/STATE.md @@ -14,6 +14,20 @@ unit tests and the docs consistency check. ## Resume here (2026-09-22) +- **Deklaration 2025/2026 (org 2, 2026-09-22)**: the imported year is closed + by the source's `Stäng intäktskonton/kostnadskonton`, so the resultatrapport + (and the INK2/SRU derived from it) showed 0. `report.income_statement` now + skips those vouchers (branch `eff/imported-closings`), which gives + **241 817,48 kr** resultat efter skatt för 2025/2026. In the TUI the + "Bokfört resultat" section is absent for such years (the close goes straight + to 2099). Two **data drifts** to settle with the accountant before filing: + the imported FY 2022/2023 result transfer is **17 857,63 kr** short of that + year's P&L (its tax was never booked as an expense), so the derived balance + sheet does not balance by that amount; and 2099 is 1,07 kr off the P&L + result. Locked years stay locked — a correction belongs in the open year + (2026/2027). The owner runs Bokslutshubben → Inkomstdeklaration after the + daemon is redeployed with the report fix. + - **Deployed**: `v0.1.64`, healthy on `nas` (Alpine runtime, static aarch64 binaries cross-compiled on this machine — ~20 s, the host only assembles the image; image 33.7 MB, no `libssl3`). `v0.1.55` brought the payroll -- cgit v1.3