summaryrefslogtreecommitdiff
path: root/docs/PROTOCOL.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/PROTOCOL.md')
-rw-r--r--docs/PROTOCOL.md23
1 files changed, 18 insertions, 5 deletions
diff --git a/docs/PROTOCOL.md b/docs/PROTOCOL.md
index 35390ae..b8ec759 100644
--- a/docs/PROTOCOL.md
+++ b/docs/PROTOCOL.md
@@ -109,7 +109,7 @@ Scopes on a token can narrow but never widen the user's role.
| Read: vouchers, reports, audit, accounts | ● | ● | ● | ● |
| `voucher.post`, `voucher.correct`, `attachment.put` | | ● | ● | |
| `sie.import`, `account.create`, `account.update` | | ● | ● | |
-| `period.lock`, `fiscal_year.open/close`, `org.update` | | | ● | |
+| `period.lock`, `fiscal_year.open/close/reopen`, `org.update` | | | ● | |
| `org.member_*`, `token.create` for others | | | ● | |
| `user.create`, any org | | | | ● |
| `backup.snapshot` | | | ● | ● |
@@ -239,8 +239,9 @@ policy versions with the software. It covers, at minimum:
(`voucher.correct`)
- receipts: `attachment.put` before or together with posting
- locked periods and closed years are hard stops — ask the human
-- `fiscal_year.close`, `period.lock` and `sie.import` are irreversible
- operations: confirm with the human first
+- `fiscal_year.close` can be undone with `fiscal_year.reopen`; both are
+ owner-only and audited. `period.lock` and `sie.import` are irreversible:
+ confirm with the human first
- how to read `report.vat` boxes and `report.balance_sheet`
- on `CONFLICT`/`replayed`, fetch the existing object instead of retrying
@@ -285,7 +286,8 @@ Account `type` is one of `asset`, `liability`, `equity`, `revenue`, `expense`.
|---|---|---|
| `fiscal_year.list` / `fiscal_year.get` | `org?` / `id` | |
| `fiscal_year.open` | `label`, `start_date`, `end_date` | owner |
-| `fiscal_year.close` | `id`, `confirm:true` | owner; irreversible |
+| `fiscal_year.close` | `id`, `confirm:true` | owner; audited |
+| `fiscal_year.reopen` | `id`, `confirm:true` | owner; undoes a close |
| `period.lock` | `fiscal_year`, `until`, `reason?` | owner; `until` inclusive |
| `period.unlock` | `fiscal_year`, `reason` | owner; audited with reason |
@@ -367,7 +369,18 @@ vouchers at posting time (`attachment_ids`) or afterwards via
| `report.vat` | `from`, `to`, `period_type?` | momsdeklaration ruta för ruta |
All reports are pure reads, respect locks, and return JSON rows. Amounts are
-öre. `report.vat` returns `{"from","to","boxes":[{"box":"05","label":"...","amount_ore":...}],"note"}`.
+öre. `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",
+"saldo_ore"}]}]}`; accounts without IB or period movement are omitted, and
+`accounts` (array of account numbers) filters the list.
+`report.voucher_list` (verifikationslista) returns `{"fiscal_year","from",
+"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
+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
is signed like the blankett (ingående moms negative); underlag boxes do not