aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-18 21:35:10 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-18 21:35:10 +0200
commit251eb8c54c77029f0b43aa987ea50c44016147f3 (patch)
tree2bf4284ce2daab191d48579a6c5a84882060d398 /docs
parent64c0d5d79b31dafcbdb68ff938a92bd6f136d4a7 (diff)
downloadbokf-0.1.28.tar.gz
bokf-0.1.28.zip
eskd: generate the momsdeklaration file (eSKDUpload 6.0)v0.1.28
report.vat_eskd builds the ISO-8859-1 XML from report.vat: whole kronor with öre truncated like the blankett, box 48 positive as filed, MomsBetala computed from the whole-krona boxes, and an optional upplysning converted from UTF-8, XML-escaped and capped at 300 characters. The TUI momsrapport gains "s = spara eSKD", prompting for a path and writing the bytes verbatim. Verified against the FY2027 Kapitas report: 05=703200, 10=175800, 20=1453, 30=851, 48=1030, 49=175621.
Diffstat (limited to 'docs')
-rw-r--r--docs/COMPLIANCE.md3
-rw-r--r--docs/PROTOCOL.md8
-rw-r--r--docs/STATE.md7
3 files changed, 13 insertions, 5 deletions
diff --git a/docs/COMPLIANCE.md b/docs/COMPLIANCE.md
index a152cd4..abc6247 100644
--- a/docs/COMPLIANCE.md
+++ b/docs/COMPLIANCE.md
@@ -153,7 +153,8 @@ approval by any authority — none exists.
1. Ledger core + protocol + CLI + TUI (MVP).
2. SIE round-trip test suite and migration dry-run against files exported from
Fortnox/Visma/BL.
-3. eSKD file for momsdeklaration; AGI file for payroll.
+3. ~~eSKD file for momsdeklaration~~ (`report.vat_eskd`, upload in
+ Skatteverket's e-service); AGI file for payroll.
4. K2 årsredovisning document generation + SRU files for INK2.
5. Invoicing and reskontra; bank import (CSV, then PSD2).
6. Peppol e-invoicing, if still relevant when it is due.
diff --git a/docs/PROTOCOL.md b/docs/PROTOCOL.md
index b8ec759..e3e629b 100644
--- a/docs/PROTOCOL.md
+++ b/docs/PROTOCOL.md
@@ -367,6 +367,7 @@ vouchers at posting time (`attachment_ids`) or afterwards via
| `report.general_ledger` | `fiscal_year`, `accounts?`, `from?`, `to?` | huvudbok |
| `report.voucher_list` | `fiscal_year`, `series?` | grundbok/verifikationslista |
| `report.vat` | `from`, `to`, `period_type?` | momsdeklaration ruta för ruta |
+| `report.vat_eskd` | `from`, `to`, `upplysning?` | eSKD XML (ISO-8859-1) as `content_base64` |
All reports are pure reads, respect locks, and return JSON rows. Amounts are
öre. `report.general_ledger` (huvudbok) returns account blocks:
@@ -379,7 +380,12 @@ All reports are pure reads, respect locks, and return JSON rows. Amounts are
"to","last_voucher":{...},"vouchers":[{"id","series","number","date",
"description","rows":[{"account","name","debit_ore","credit_ore",
"description"}]}],"totals":{"debit_ore","credit_ore"}}` and takes an
-optional `series` filter. Both cover the whole fiscal year; the ledger's
+`series` filter. `report.vat_eskd` builds Skatteverket's `eSKDUpload`
+Version 6.0 XML for the period ending at `to` (whole kronor, öre truncated
+like the blankett; box 48 positive as filed) and returns `{"org_nr",
+"period","from","to","filename","sha256","size","content_base64"}`; the
+bytes are ISO-8859-1, so write them verbatim to a `.xml` file. Both cover
+the whole fiscal year; the ledger's
period can be narrowed with `from`/`to`. `report.vat` returns `{"from","to","boxes":[{"box":"05","label":"...","amount_ore":...}],"note"}`.
Rules sharing a box are summed into a single entry. `box 49` is the sum of
the moms boxes (`10`,`11`,`12`,`30`,`31`,`32`,`48`,`60`,`61`,`62`), so box 48
diff --git a/docs/STATE.md b/docs/STATE.md
index b158de8..0e5d36e 100644
--- a/docs/STATE.md
+++ b/docs/STATE.md
@@ -86,15 +86,16 @@ server/protocol/ledger only.
`attachment.put {voucher_id}`): proposed TUI actions — `Ctrl+F` in the
voucher detail to upload+link, and selecting an inbox item and pressing a
key to link it to a voucher picked from a list. Waiting for a go-ahead.
-- Priority between **eSKD moms filing** and **bokslut/K2+SRU** for the next
- backend milestone (eSKD was suggested first).
+- Next backend milestone: **bokslut automation** vs **K2/SRU** (eSKD is
+ done: `report.vat_eskd` + `s = spara eSKD` in the momsrapport).
- Moms `report_rules` seed is a corrected starter mapping (schema v3), but
there is still no command/TUI to edit rules per org; add one before filing
if the mapping needs adjustments (SCHEMA.md §10 promises owner editing).
## Backlog (prioritized, from COMPLIANCE.md §10 and the audit)
-1. eSKD file generation for momsdeklaration.
+1. ~~eSKD file generation for momsdeklaration.~~ `report.vat_eskd` (eSKDUpload
+ 6.0, ISO-8859-1, whole kronor) with a save action in the TUI momsrapport.
2. Bokslut automation (avskrivningar, periodiseringsfond, skatt,
resultatdisposition).
3. K2 årsredovisning document + SRU files (INK2/INK2R/INK2S).