aboutsummaryrefslogtreecommitdiff
path: root/docs/PROTOCOL.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/PROTOCOL.md')
-rw-r--r--docs/PROTOCOL.md17
1 files changed, 12 insertions, 5 deletions
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.