From 251eb8c54c77029f0b43aa987ea50c44016147f3 Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Fri, 18 Sep 2026 21:35:10 +0200 Subject: eskd: generate the momsdeklaration file (eSKDUpload 6.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- docs/PROTOCOL.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'docs/PROTOCOL.md') 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 -- cgit v1.3