aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-19 20:13:02 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-19 20:13:02 +0200
commit77c298b3b64f2493e509734df0084068ad24441f (patch)
tree8a8182fbecdb0dc63cdc71842511cc6d00e21716 /docs
parent30c309e15d3211e7d0e8a8a2752c3e9afa0a0638 (diff)
downloadbokf-0.1.33.tar.gz
bokf-0.1.33.zip
bokslut: TUI screen, K2 årsredovisning draft, storable dividend (schema v4)v0.1.33
Diffstat (limited to 'docs')
-rw-r--r--docs/PROTOCOL.md10
-rw-r--r--docs/SCHEMA.md1
-rw-r--r--docs/STATE.md31
3 files changed, 31 insertions, 11 deletions
diff --git a/docs/PROTOCOL.md b/docs/PROTOCOL.md
index 8ee1b2c..6f617fd 100644
--- a/docs/PROTOCOL.md
+++ b/docs/PROTOCOL.md
@@ -288,6 +288,7 @@ Account `type` is one of `asset`, `liability`, `equity`, `revenue`, `expense`.
| `fiscal_year.open` | `label`, `start_date`, `end_date` | owner |
| `fiscal_year.close` | `id`, `confirm:true` | owner; audited |
| `fiscal_year.reopen` | `id`, `confirm:true` | owner; undoes a close |
+| `fiscal_year.update` | `id`, `dividend_ore` | bookkeeper; year metadata (proposed dividend), audited |
| `period.lock` | `fiscal_year`, `until`, `reason?` | owner; `until` inclusive |
| `period.unlock` | `fiscal_year`, `reason` | owner; audited with reason |
@@ -470,8 +471,15 @@ commands. Implemented screens (0.1.0-dev):
vouchers (Tab, dynamic rows, F7 clear row, F5 validate, F9 save); archive
keeps the template but hides it from the list.
- **Underlag** — inbox of unlinked attachments; `a` uploads a file.
-- **Rapporter** — saldobalans, resultaträkning, balansräkning, moms and
+- **Rapporter** — saldobalans, resultaträkning, balansräkning, moms,
+ inkomstdeklaration (INK2/SRU), årsredovisning (K2 text draft) and
kontolista (all accounts with type, moms treatment, SRU and status).
+ `s` saves the SRU files, eSKD XML and the årsredovisning respectively.
+ The draft asks for the board's proposed dividend, kept per fiscal year
+ with `fiscal_year.update`.
+- **Bokslut** — periodiseringsfond and tax rate fields; F5 shows the posting
+ plan as a `bokslut.post` dry run, `^Enter` (or F9) asks for confirmation
+ and posts the plan.
- **Företagsuppgifter** — the org record (name, org number, VAT number,
address, e-mail, phone, moms period, framework, fiscal-year start month),
editable in place; only owners can save, others see it read-only.
diff --git a/docs/SCHEMA.md b/docs/SCHEMA.md
index db03e43..4fc4397 100644
--- a/docs/SCHEMA.md
+++ b/docs/SCHEMA.md
@@ -148,6 +148,7 @@ CREATE TABLE fiscal_years (
end_date TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'open' CHECK (status IN ('open','closed')),
locked_until TEXT, -- inclusive last locked date
+ dividend_ore INTEGER NOT NULL DEFAULT 0, -- board's proposed dividend
created_at TEXT NOT NULL,
closed_at TEXT,
closed_by INTEGER REFERENCES users(id),
diff --git a/docs/STATE.md b/docs/STATE.md
index 5be11e7..b0f5b4a 100644
--- a/docs/STATE.md
+++ b/docs/STATE.md
@@ -1,7 +1,7 @@
# bokf — project state
Snapshot for resuming work in a new session. Read with `AGENTS.md` (rules)
-and `docs/TUI-GUIDELINES.md` (UI conventions). Dated 2026-09-18.
+and `docs/TUI-GUIDELINES.md` (UI conventions). Dated 2026-09-19.
## Status
@@ -86,8 +86,12 @@ server/protocol/ledger only.
SHA-256 verified, text inline), attach to an existing voucher (`^F`),
remove a link (`d` in the `f` picker) and link an inbox item to a voucher
(`k`).
-- Next backend milestone: **K2/SRU** (INK2/INK2R/INK2S + årsredovisning);
- bokslut.post is done server-side, its TUI screen pending.
+- K2/SRU is complete: `sru.export` with the INK2 view, `bokslut.post` with
+ the Bokslut screen, and a K2 årsredovisning text draft with a save action
+ in Rapporter. The draft asks for the board's proposed dividend and keeps it
+ per fiscal year (`fiscal_year.update`, schema v4); the stämma decision is
+ posted with a `Utdelning` template (D 2099/K 2898). Still missing before
+ filing: a command/TUI to edit the moms `report_rules` per org (below).
- 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).
@@ -96,12 +100,17 @@ server/protocol/ledger only.
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: `bokslut.post` is in (entries/avskrivningar,
+2. ~~Bokslut automation~~ done: `bokslut.post` (entries/avskrivningar,
periodiseringsfond, skatt at a given rate, resultatdisposition, dry-run
- plan, audited) and the resultatrapport separates bokslutsdispositioner
- and skatt per K2. TUI screen still to do.
-3. K2 årsredovisning document; ~~SRU files (INK2/INK2R/INK2S)~~ done as
- `sru.export` (official 2025P4 field tables, BAS mapping, TUI save in
+ plan, audited), the TUI Bokslut screen (fond/rate, F5 plan, ^Enter posts
+ after confirmation) and the K2 resultatrapport order.
+3. ~~K2 årsredovisning document~~ done as a text draft built in the TUI from
+ `report.income_statement`/`report.balance_sheet` (Förvaltningsberättelse,
+ K2 RR/BR with previous-year column and the result inside equity, noter,
+ underskrifter); `s` saves `Årsredovisning <år>.txt`. Placeholders mark
+ qualitative facts, and incomplete jämförelsetal for imported history
+ years are flagged in the document. ~~SRU files (INK2/INK2R/INK2S)~~ done
+ as `sru.export` (official 2025P4 field tables, BAS mapping, TUI save in
Rapporter -> Inkomstdeklaration).
4. `audit.verify` must also verify the **voucher** hash chain (today only the
audit chain is verified).
@@ -119,8 +128,10 @@ server/protocol/ledger only.
AGI/payroll if employees.
11a. Imported history years whose SIE contains the source's P&L closings
("Stäng intäktskonton/kostnadskonton") net to zero in the income
- statement (Kapitas 2022-2026). The importer should skip those closing
- verifications (keeping the resultatdisposition) or mark them; decide.
+ 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.
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: