aboutsummaryrefslogtreecommitdiff
path: root/src/seed.c
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-18 14:32:23 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-18 14:32:23 +0200
commita5d3ddf6d512bc459cfa450c6b449c2e7a245373 (patch)
treee14c2b28e3cd6d7b744f301b5bf498f5feb8f03e /src/seed.c
parent07b5e5890fedbf71a1503f984dfbc2baa872223c (diff)
downloadbokf-0.1.26.tar.gz
bokf-0.1.26.zip
reports: Kapitas-style TUI tables, corrected moms rules (schema v3)v0.1.26
The report views dumped JSON; they now render Saldobalans, Resultatrapport (previous-year column, 89xx bokfört/ej bokfört), Balansrapport (Ing balans/Ing saldo/Period/Utg balans, Beräknat resultat) and Momsrapport ruta för ruta, with Swedish amount formatting (1 234,56). The moms starter rules missed 33xx sales, sent reverse-charge VAT 2614 to box 10 instead of 30 and had box 48 positive. Rules may now share a box and report.vat sums them; box 49 is the sum of the moms boxes only. Schema v3 replaces the rules for existing orgs. Verified on a copy of the live DB: 05=703 200, 10=175 800, 20=1 453, 30=851, 48=-1 030, 49=175 621, matching the Kapitas 2027 export. Ctrl+R reload passes --socket and auto-login no longer rewrites tui.conf; pty tests now run through scripts/tui-sandbox.sh so they cannot touch the real config, cache or bw session.
Diffstat (limited to 'src/seed.c')
-rw-r--r--src/seed.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/seed.c b/src/seed.c
index cd1bf71..7be0535 100644
--- a/src/seed.c
+++ b/src/seed.c
@@ -216,16 +216,25 @@ struct vat_rule {
};
/* Starter mapping from BAS account ranges to momsdeklaration boxes. It
- covers the common domestic cases only and must be reviewed against the
- current Skatteverket blankett before filing. */
+ covers the common domestic and EU cases; rules may share a box, the
+ report sums them. Must be reviewed against the current Skatteverket
+ blankett before filing. */
static const struct vat_rule VAT_RULES[] = {
- { "05", "range", "3001-3019", -1, 10 },
- { "06", "range", "3021-3029", -1, 20 },
- { "07", "range", "3031-3039", -1, 30 },
- { "10", "range", "2610-2619", -1, 40 },
- { "11", "range", "2620-2629", -1, 50 },
- { "12", "range", "2630-2639", -1, 60 },
- { "48", "range", "2640-2649", 1, 70 },
+ { "05", "range", "3000-3019", -1, 10 },
+ { "05", "range", "3100-3199", -1, 11 },
+ { "05", "range", "3300-3399", -1, 12 },
+ { "41", "range", "3200-3299", -1, 20 },
+ { "06", "range", "3020-3029", -1, 30 },
+ { "07", "range", "3030-3039", -1, 40 },
+ { "10", "range", "2610-2613", -1, 50 },
+ { "11", "range", "2620-2623", -1, 60 },
+ { "12", "range", "2630-2633", -1, 70 },
+ { "20", "range", "4510-4529", 1, 80 },
+ { "21", "range", "4530-4549", 1, 90 },
+ { "30", "range", "2614-2619", -1, 100 },
+ { "31", "range", "2624-2629", -1, 110 },
+ { "32", "range", "2634-2639", -1, 120 },
+ { "48", "range", "2640-2649", -1, 130 },
};
static int seed_rules(sqlite3 *db, int64_t org_id, char **err)
@@ -256,6 +265,11 @@ static int seed_rules(sqlite3 *db, int64_t org_id, char **err)
return 0;
}
+int seed_vat_rules(sqlite3 *db, int64_t org_id, char **err)
+{
+ return seed_rules(db, org_id, err);
+}
+
static int seed_default_fiscal_year(sqlite3 *db, int64_t org_id,
int fy_start_month, int64_t *out_fy,
char **err)