aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/DECISIONS.md14
-rw-r--r--docs/PROTOCOL.md17
-rw-r--r--docs/STATE.md12
3 files changed, 30 insertions, 13 deletions
diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md
index a109bda..5499610 100644
--- a/docs/DECISIONS.md
+++ b/docs/DECISIONS.md
@@ -335,13 +335,13 @@ kept verbatim from the STATE.md they were pruned from (2026-09-21).
årsredovisning export flags incomplete jämförelsetal for those years and
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.
+ 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 7d7a5e2..a28ff21 100644
--- a/docs/PROTOCOL.md
+++ b/docs/PROTOCOL.md
@@ -451,11 +451,17 @@ 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.income_statement` (and therefore `sru.export` and the TUI
+öre. IB (ingående balans) for a balance account (asset, liability, equity) is
+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.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:
+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",
@@ -523,7 +529,8 @@ support `dry_run`, which validates without writing.
| `sie.import` | `content_base64` or `path`, `dry_run?` | one file per call; creates missing accounts and posts #VER as `source:"sie_import"`; only into an empty org fiscal year; `#IB` becomes an `IB` voucher when the year has no earlier history, otherwise the earlier vouchers carry the balances |
SIE 4 files are written in CP437 with PC8 format, `#SIETYP 4`, `#FNR`, `#ORGNR`,
-`#KONTO`, `#IB`, `#UB`, `#RES`, `#VER`, `#TRANS`. Import is the migration path
+`#KONTO`, `#IB`, `#UB`, `#RES`, `#VER`, `#TRANS`. `#IB`/`#UB` are written for
+balance accounts and `#RES` for P&L accounts, with IB as in §7.6. Import is the migration path
from Fortnox/Visma/BL and must be dry-run first; it reports exactly what would
be created.
diff --git a/docs/STATE.md b/docs/STATE.md
index 19f22f6..db68efd 100644
--- a/docs/STATE.md
+++ b/docs/STATE.md
@@ -17,7 +17,7 @@ unit tests and the docs consistency check.
- **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
+ 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:
@@ -86,6 +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, 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. 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)