diff options
| author | Anders Betts <anders.betts@gmail.com> | 2026-09-22 19:53:19 +0200 |
|---|---|---|
| committer | Anders Betts <anders.betts@gmail.com> | 2026-09-22 19:55:47 +0200 |
| commit | 3f07edf64f74cab68cb379e49841fdf6b24674e9 (patch) | |
| tree | 125a350247d421b3dbac11d56c25bdf189af2656 /docs | |
| parent | 6e0e96cfc74b129950002456e21d401dd07e10fd (diff) | |
| parent | e1a24f6250f5e498e524ce14a5acbed5fc5c2a91 (diff) | |
| download | bokf-3f07edf64f74cab68cb379e49841fdf6b24674e9.tar.gz bokf-3f07edf64f74cab68cb379e49841fdf6b24674e9.zip | |
Merge eff/imported-closings; skip only SIE-imported Stäng closings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/DECISIONS.md | 10 | ||||
| -rw-r--r-- | docs/PROTOCOL.md | 8 | ||||
| -rw-r--r-- | docs/STATE.md | 28 |
3 files changed, 37 insertions, 9 deletions
diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index a0c613b..5499610 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 when they are SIE-imported, 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 d50f5ee..a28ff21 100644 --- a/docs/PROTOCOL.md +++ b/docs/PROTOCOL.md @@ -455,7 +455,13 @@ All reports are pure reads, respect locks, and return JSON rows. Amounts are all earlier history, including earlier years' `IB` vouchers, plus this year's `IB` vouchers; a P&L account (revenue, expense) restarts at zero at every fiscal-year start, so its IB is only this year's `IB` vouchers and, -with a narrowed `from`, the year's movements before it. `report.general_ledger` (huvudbok) returns account blocks: +with a narrowed `from`, the year's movements before it. +`report.income_statement` (and therefore `sru.export` and the TUI +resultatrapport) ignores the source system's `"Stäng ..."` closing vouchers +in SIE-imported years (`source:"sie_import"`), where the P&L accounts are +closed straight to 2099 and would otherwise net to zero; the TUI +årsredovisning 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 29fbada..db68efd 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 (merged to `main`, not deployed), 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 @@ -72,16 +86,16 @@ unit tests and the docs consistency check. `TUI-GUIDELINES.md`: drafts of encrypted fields (an employee's personnummer) and `Enter` on action rows. Spec in `TUI-GUIDELINES.md` "Interaction model"; decisions in `DECISIONS.md` #28. -- **IB carry-forward (2026-09-22, branch `eff/ib-carry`, not deployed)**: - reports and `sie.export` now carry earlier years' `IB` vouchers into the +- **IB carry-forward (2026-09-22, merged to `main`, not deployed)**: + reports and `sie.export` carry earlier years' `IB` vouchers into the opening balance (Makandra's 2021 IB voucher held aktiekapital 2081/1940, which vanished from every later year) and restart P&L accounts at each fiscal-year start (they used to accumulate since 2021). SIE writes - `#IB`/`#UB` only for balance accounts and `#RES` only for P&L. With it, - Makandra's 2025/26 opening balance shows the real 17 857,63 kr gap from - 2022/23 (result transfer short of the P&L) instead of hiding it. - `test_core` has `ib_carry`. Touches the same `balance_query` SQL as - `eff/imported-closings` — expect a small textual conflict when merging. + `#IB`/`#UB` only for balance accounts and `#RES` only for P&L. Makandra's + opening balances now show the 17 857,63 kr 2022/23 gap openly (balance + accounts' IB sums to that instead of 0). Merged together with + `eff/imported-closings`, whose "Stäng" skip now applies only to + `sie_import` vouchers. `test_core` has `ib_carry` and `imported_closings`. - **Mail configuration**: Makandra AB (org 2) has **no** `smtp_*` settings in bokf, so `invoice.send` there is `SMTP_NOT_CONFIGURED` (fine if invoices are sent elsewhere — set them up when wanted). Mock AB (org 1) |
