ekwo-os 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -529,7 +529,7 @@ exactly six fields:
529
529
  "organization": "My Organisation",
530
530
  "country": "<cc>",
531
531
  "edition": "community",
532
- "schema_version": "0.19.0",
532
+ "schema_version": "0.20.0",
533
533
  "contact_email": "you@example.com"
534
534
  }
535
535
  ```
@@ -1,6 +1,6 @@
1
1
  {
2
- "schemaVersion": "0.19.0",
3
- "migration": "20261023124700",
2
+ "schemaVersion": "0.20.0",
3
+ "migration": "20261023160300",
4
4
  "socle": {
5
5
  "schema": "public",
6
6
  "tables": [
@@ -1845,6 +1845,10 @@
1845
1845
  "name": "tax_payee_name",
1846
1846
  "type": "text"
1847
1847
  },
1848
+ {
1849
+ "name": "tax_payee_name_i18n",
1850
+ "type": "jsonb"
1851
+ },
1848
1852
  {
1849
1853
  "name": "tax_payee_source_key",
1850
1854
  "type": "text"
@@ -6095,6 +6099,10 @@
6095
6099
  "name": "version_at_least",
6096
6100
  "arguments": "p_version text, p_floor text"
6097
6101
  },
6102
+ {
6103
+ "name": "write_filing_outcome",
6104
+ "arguments": "p_filing_id uuid, p_state tax_filing_state, p_reference text, p_message text"
6105
+ },
6098
6106
  {
6099
6107
  "name": "year_result_account",
6100
6108
  "arguments": "p_company_id uuid, p_balance numeric"
@@ -6646,11 +6654,6 @@
6646
6654
  "name": "tax_filing_deposits_select",
6647
6655
  "command": "select"
6648
6656
  },
6649
- {
6650
- "table": "tax_filing_deposits",
6651
- "name": "tax_filing_deposits_write",
6652
- "command": "all"
6653
- },
6654
6657
  {
6655
6658
  "table": "tax_filings",
6656
6659
  "name": "tax_filings_select",
@@ -8693,16 +8696,10 @@
8693
8696
  "name": "tax_filing_deposits",
8694
8697
  "anon": [],
8695
8698
  "authenticated": [
8696
- "delete",
8697
- "insert",
8698
- "select",
8699
- "update"
8699
+ "select"
8700
8700
  ],
8701
8701
  "service_role": [
8702
- "delete",
8703
- "insert",
8704
- "select",
8705
- "update"
8702
+ "select"
8706
8703
  ]
8707
8704
  },
8708
8705
  {
@@ -12506,6 +12503,13 @@
12506
12503
  "execute"
12507
12504
  ]
12508
12505
  },
12506
+ {
12507
+ "name": "write_filing_outcome",
12508
+ "arguments": "p_filing_id uuid, p_state tax_filing_state, p_reference text, p_message text",
12509
+ "anon": [],
12510
+ "authenticated": [],
12511
+ "service_role": []
12512
+ },
12509
12513
  {
12510
12514
  "name": "year_result_account",
12511
12515
  "arguments": "p_company_id uuid, p_balance numeric",
@@ -0,0 +1,45 @@
1
+ -- Ekwo OS — a declaration whose debt was matched before matching said so is paid.
2
+ --
3
+ -- `20261023124650` made a declaration paid when the line its settlement
4
+ -- carried the net on is matched in full — by the trigger
5
+ -- `tax_filings_paid_by_matching`, which fires when `matched_amount` moves. A
6
+ -- debt matched before that migration ran never moved again, so its
7
+ -- declaration stayed `accepted` with its money in the bank.
8
+ --
9
+ -- This finds them and records `paid` through `record_filing_outcome()`, the
10
+ -- function the trigger calls, so the declaration and its last deposit carry
11
+ -- the outcome exactly as if the payment had been matched today. The line is
12
+ -- the one the trigger reads: in the settlement entry, on the account the pack
13
+ -- names for the side the period ended on — `tax_payable_code`, or for a
14
+ -- credit `tax_receivable_code` where the pack names one — with something to
15
+ -- pay and nothing left open. A debt paid in part stays accepted, as it would
16
+ -- by the trigger.
17
+ --
18
+ -- It only ever reads `accepted` declarations and writes them `paid`, so a
19
+ -- second run finds nothing to do.
20
+
21
+ do $$
22
+ declare
23
+ r record;
24
+ begin
25
+ for r in
26
+ select f.id
27
+ from tax_filings f
28
+ join companies c on c.id = f.company_id
29
+ join country_defaults d on d.country = c.fiscal_country
30
+ where f.state = 'accepted'
31
+ and f.settlement_entry_id is not null
32
+ and exists (
33
+ select 1 from entry_lines l
34
+ where l.entry_id = f.settlement_entry_id
35
+ and l.account_id = account_id_by_code(f.company_id,
36
+ case when f.credit_treatment is null then d.tax_payable_code
37
+ else coalesce(d.tax_receivable_code, d.tax_payable_code) end)
38
+ and abs(l.debit - l.credit) > 0
39
+ and abs(l.debit - l.credit) - l.matched_amount = 0)
40
+ order by f.company_id, f.period_start, f.id
41
+ loop
42
+ perform record_filing_outcome(r.id, 'paid');
43
+ end loop;
44
+ end;
45
+ $$;
@@ -0,0 +1,259 @@
1
+ -- Ekwo OS — a deposit is written by the core's functions, and by nobody else.
2
+ --
3
+ -- `tax_filing_deposits` is the proof a declaration went: when, by which
4
+ -- channel, under which reference, with which files, and what came back. Its
5
+ -- policy `tax_filing_deposits_write` let anybody holding `filings.write`
6
+ -- insert, rewrite or delete a row of it directly, past every rule the
7
+ -- functions apply: a send recorded on a declaration that was never prepared,
8
+ -- an outcome nobody answered, a deposit deleted after the administration
9
+ -- accepted it. Since `20261023124650` an application names files through
10
+ -- `record_filing_files()`, and the policy was left for one reader only, the
11
+ -- company archive — which loads deposits through `import_company()`, a
12
+ -- definer function that never needed it.
13
+ --
14
+ -- So the policy goes, and with it `insert`, `update` and `delete` on the
15
+ -- table, from `authenticated` and from `service_role` (which gets what a
16
+ -- person gets). What stays is `select`, under `tax_filing_deposits_select`.
17
+ -- The three functions that write a deposit write it as definer, each asking
18
+ -- what the policy asked — `filings.write`, or the installer — after the
19
+ -- company is one the caller may know of:
20
+ --
21
+ -- file_filing() a send, as `20261007041207` wrote it
22
+ -- record_filing_outcome() what came back, as `20260918110000` wrote it
23
+ -- record_filing_files() the files of the send, already definer
24
+ --
25
+ -- `record_filing_outcome()` is also how the ledger records `paid`
26
+ -- (`tax_filings_paid_by_matching`), and there the person matching the payment
27
+ -- may keep the books without filing. Its body therefore moves, unchanged, into
28
+ -- `write_filing_outcome()`, which nobody may call: the function asks the
29
+ -- right and calls it, and the trigger calls it directly, as the ledger.
30
+
31
+ -- ---------------------------------------------------------------------------
32
+ -- 1. The table: read by whoever reads the declarations, written by the core
33
+ -- ---------------------------------------------------------------------------
34
+
35
+ drop policy if exists tax_filing_deposits_write on tax_filing_deposits;
36
+
37
+ revoke insert, update, delete on table tax_filing_deposits from authenticated, service_role;
38
+
39
+ comment on table tax_filing_deposits is
40
+ 'One send of a declaration and what came back. Written only by file_filing(), record_filing_outcome() and record_filing_files(); read under filings.read.';
41
+
42
+ -- ---------------------------------------------------------------------------
43
+ -- 2. write_filing_outcome — the body of record_filing_outcome, nobody's
44
+ -- ---------------------------------------------------------------------------
45
+
46
+ create or replace function write_filing_outcome(
47
+ p_filing_id uuid,
48
+ p_state tax_filing_state,
49
+ p_reference text default null,
50
+ p_message text default null
51
+ )
52
+ returns tax_filings
53
+ language plpgsql
54
+ volatile
55
+ security definer
56
+ set search_path = public, pg_temp
57
+ as $$
58
+ declare
59
+ v_filing tax_filings;
60
+ begin
61
+ select * into v_filing from tax_filings f where f.id = p_filing_id;
62
+ if not found then
63
+ raise exception 'not_found: filing %', p_filing_id using errcode = 'no_data_found';
64
+ end if;
65
+
66
+ if p_state not in ('accepted', 'rejected', 'paid') then
67
+ raise exception 'not_an_outcome: % is not something an administration answers', p_state;
68
+ end if;
69
+ if v_filing.state = 'draft' or v_filing.state = 'ready' then
70
+ raise exception 'filing_not_sent: a declaration that has not gone cannot come back %', p_state;
71
+ end if;
72
+ if p_state = 'paid' and v_filing.state <> 'accepted' then
73
+ raise exception 'filing_not_accepted: paying follows acceptance, and this one is %', v_filing.state;
74
+ end if;
75
+
76
+ -- On the last send, because that is the one being answered.
77
+ update tax_filing_deposits d
78
+ set outcome = p_state,
79
+ outcome_at = now(),
80
+ reference = coalesce(p_reference, d.reference),
81
+ message = coalesce(p_message, d.message)
82
+ where d.filing_id = p_filing_id
83
+ and d.sequence = (select max(x.sequence) from tax_filing_deposits x where x.filing_id = p_filing_id);
84
+
85
+ update tax_filings
86
+ set state = p_state,
87
+ reference = coalesce(p_reference, reference)
88
+ where id = p_filing_id
89
+ returning * into v_filing;
90
+ return v_filing;
91
+ end;
92
+ $$;
93
+
94
+ comment on function write_filing_outcome(uuid, tax_filing_state, text, text) is
95
+ 'Writes what came back on a declaration and on its last send, with no check of who asks: called by record_filing_outcome() once the caller''s right is checked, and by tax_filings_paid_by_matching as the ledger. Granted to nobody.';
96
+
97
+ revoke execute on function write_filing_outcome(uuid, tax_filing_state, text, text) from public, anon, authenticated, service_role;
98
+
99
+ -- ---------------------------------------------------------------------------
100
+ -- 3. record_filing_outcome — the right of the policy, asked by the function
101
+ -- ---------------------------------------------------------------------------
102
+
103
+ create or replace function record_filing_outcome(
104
+ p_filing_id uuid,
105
+ p_state tax_filing_state,
106
+ p_reference text default null,
107
+ p_message text default null
108
+ )
109
+ returns tax_filings
110
+ language plpgsql
111
+ volatile
112
+ security definer
113
+ set search_path = public, pg_temp
114
+ as $$
115
+ declare
116
+ v_filing tax_filings;
117
+ begin
118
+ select * into v_filing from tax_filings f where f.id = p_filing_id;
119
+ if not found or not may_know_of_company(v_filing.company_id) then
120
+ raise exception 'not_found: filing %', p_filing_id using errcode = 'no_data_found';
121
+ end if;
122
+ if not is_installer() and not has_capability(v_filing.company_id, 'filings.write') then
123
+ raise exception 'not_allowed: recording what came back for a declaration in this company needs filings.write'
124
+ using errcode = '42501';
125
+ end if;
126
+ return write_filing_outcome(p_filing_id, p_state, p_reference, p_message);
127
+ end;
128
+ $$;
129
+
130
+ comment on function record_filing_outcome(uuid, tax_filing_state, text, text) is
131
+ 'What came back: accepted, rejected, or paid, written on the declaration and on the send it answers — with the administration''s own words where it gave any. Paying follows acceptance, and a declaration that never went cannot come back at all. Asks filings.write.';
132
+
133
+ revoke execute on function record_filing_outcome(uuid, tax_filing_state, text, text) from public, anon;
134
+ grant execute on function record_filing_outcome(uuid, tax_filing_state, text, text) to authenticated, service_role;
135
+
136
+ -- ---------------------------------------------------------------------------
137
+ -- 4. file_filing — `20261007041207` to the letter, as definer, asking the right
138
+ -- ---------------------------------------------------------------------------
139
+
140
+ create or replace function file_filing(
141
+ p_filing_id uuid,
142
+ p_reference text default null,
143
+ p_filed_at timestamptz default null,
144
+ p_channel filing_channel default 'portal',
145
+ p_service text default null
146
+ )
147
+ returns tax_filings
148
+ language plpgsql
149
+ volatile
150
+ security definer
151
+ set search_path = public, pg_temp
152
+ as $$
153
+ declare
154
+ v_filing tax_filings;
155
+ v_at timestamptz;
156
+ v_next integer;
157
+ begin
158
+ select * into v_filing from tax_filings f where f.id = p_filing_id;
159
+ if not found or not may_know_of_company(v_filing.company_id) then
160
+ raise exception 'not_found: filing %', p_filing_id using errcode = 'no_data_found';
161
+ end if;
162
+ if not is_installer() and not has_capability(v_filing.company_id, 'filings.write') then
163
+ raise exception 'not_allowed: recording that a declaration of this company went needs filings.write'
164
+ using errcode = '42501';
165
+ end if;
166
+
167
+ -- Rejected is a state a declaration is sent again from. It was never
168
+ -- received, so there is nothing to correct and no corrective to open.
169
+ if v_filing.state not in ('draft', 'ready', 'rejected') then
170
+ raise exception 'filing_already_%: this declaration has already gone', v_filing.state;
171
+ end if;
172
+
173
+ if v_filing.prepared_at is null then
174
+ raise exception 'filing_not_prepared: compute the figures before filing them';
175
+ end if;
176
+
177
+ v_at := coalesce(p_filed_at, now());
178
+
179
+ select coalesce(max(d.sequence), 0) + 1 into v_next
180
+ from tax_filing_deposits d where d.filing_id = p_filing_id;
181
+
182
+ insert into tax_filing_deposits (filing_id, sequence, channel, service, sent_at, sent_by, reference)
183
+ values (p_filing_id, v_next, p_channel, p_service, v_at, acting_user(), p_reference);
184
+
185
+ update tax_filings
186
+ set state = 'filed',
187
+ reference = coalesce(p_reference, reference),
188
+ filed_at = v_at,
189
+ filed_by = acting_user()
190
+ where id = p_filing_id
191
+ returning * into v_filing;
192
+
193
+ return v_filing;
194
+ end;
195
+ $$;
196
+
197
+ comment on function file_filing(uuid, text, timestamptz, filing_channel, text) is
198
+ 'Records that a declaration has gone, with the reference the administration gave back, and keeps the send as a row of tax_filing_deposits. It asks that the figures were computed, not that there are any: a period where nothing happened is filed nil. A rejected declaration may be sent again — it was never received — and the second send is a second deposit, not a corrective. Asks filings.write.';
199
+
200
+ revoke execute on function file_filing(uuid, text, timestamptz, filing_channel, text) from public, anon;
201
+ grant execute on function file_filing(uuid, text, timestamptz, filing_channel, text) to authenticated, service_role;
202
+
203
+ -- ---------------------------------------------------------------------------
204
+ -- 5. Paid by matching, through write_filing_outcome
205
+ --
206
+ -- `20261023124650` to the letter, but for the call: the person whose matching
207
+ -- pays the debt may keep the books without filing, and paid is the ledger's
208
+ -- fact, not that person's act.
209
+ -- ---------------------------------------------------------------------------
210
+
211
+ create or replace function tax_filings_paid_by_matching()
212
+ returns trigger
213
+ language plpgsql
214
+ security definer
215
+ set search_path = public, pg_temp
216
+ as $$
217
+ declare
218
+ v_filing tax_filings;
219
+ v_account uuid;
220
+ v_open numeric;
221
+ v_was numeric;
222
+ begin
223
+ select * into v_filing from tax_filings f where f.settlement_entry_id = new.entry_id;
224
+ if not found or v_filing.state not in ('accepted', 'paid') then
225
+ return null;
226
+ end if;
227
+
228
+ -- Only the line that carries the net: the account the pack names for the
229
+ -- side the period ended on. The tax accounts the entry cleared are not it.
230
+ select account_id_by_code(v_filing.company_id,
231
+ case when v_filing.credit_treatment is null then d.tax_payable_code
232
+ else coalesce(d.tax_receivable_code, d.tax_payable_code) end)
233
+ into v_account
234
+ from companies c join country_defaults d on d.country = c.fiscal_country
235
+ where c.id = v_filing.company_id;
236
+ if v_account is distinct from new.account_id then
237
+ return null;
238
+ end if;
239
+
240
+ v_open := abs(new.debit - new.credit) - new.matched_amount;
241
+ v_was := abs(old.debit - old.credit) - old.matched_amount;
242
+
243
+ if v_filing.state = 'accepted' and v_open = 0 and v_was > 0 then
244
+ perform write_filing_outcome(v_filing.id, 'paid');
245
+ elsif v_filing.state = 'paid' and v_open > 0 and v_was = 0 then
246
+ -- The payment was unmatched: the debt is open again, and so is the
247
+ -- declaration's money. What the administration said stays said.
248
+ perform write_filing_outcome(v_filing.id, 'accepted');
249
+ end if;
250
+ return null;
251
+ end;
252
+ $$;
253
+
254
+ comment on function tax_filings_paid_by_matching() is
255
+ 'Records a declaration paid once the line its settlement carried the net on is matched in full, and accepted again when that matching is undone — by whatever path the money was matched: the bank, auto_settle(), reconcile(), an import. Through write_filing_outcome(), the body of record_filing_outcome(), so the last send carries the outcome as it would by hand, whoever matched the payment.';
256
+
257
+ revoke execute on function tax_filings_paid_by_matching() from public, anon, authenticated, service_role;
258
+
259
+ revoke execute on all functions in schema public from public;
@@ -0,0 +1,130 @@
1
+ -- Ekwo OS — the administration is named in the company's language.
2
+ --
3
+ -- `20261023124650` gave the administration a declaration is paid to one name,
4
+ -- in the pack's own language (`country_defaults.tax_payee_name`), and
5
+ -- `tax_payee()` creates the company's contact for it under that name. In a
6
+ -- country of several languages the administration publishes its name in each
7
+ -- — SPF Finances, FOD Financiën, FÖD Finanzen — and a company keeping its
8
+ -- books in Dutch is paying the FOD Financiën.
9
+ --
10
+ -- A pack's language file may now carry the name in its language
11
+ -- (`i18n/<lang>.json`, `tax_payee`: the name and the register entry it is
12
+ -- read in), compiled into `tax_payee_name_i18n`, by language, the way every
13
+ -- other label of a pack reaches `name_i18n`. `tax_payee()` creates the contact
14
+ -- under the name in the company's language (`companies.language`), and falls
15
+ -- back to the pack's own where the pack gives none in it. Where several
16
+ -- contacts book to the account, the one under any of the pack's names is the
17
+ -- administration: a contact created in another language, or before the pack
18
+ -- named it in this one, is still recognised.
19
+
20
+ alter table country_defaults
21
+ add column if not exists tax_payee_name_i18n jsonb not null default '{}'::jsonb;
22
+
23
+ comment on column country_defaults.tax_payee_name_i18n is
24
+ 'The name of the administration in tax_payee_name, by language, as the administration publishes it in each language of the pack. tax_payee() creates the contact under the company''s language here, else under tax_payee_name.';
25
+
26
+ create or replace function tax_payee(p_company_id uuid)
27
+ returns contacts
28
+ language plpgsql
29
+ volatile
30
+ security definer
31
+ set search_path = public, pg_temp
32
+ as $$
33
+ declare
34
+ v_name text;
35
+ v_names text[];
36
+ v_payable uuid;
37
+ v_receivable uuid;
38
+ v_country char(2);
39
+ v_count integer;
40
+ v_contact contacts;
41
+ begin
42
+ if not may_know_of_company(p_company_id) then
43
+ raise exception 'unknown_company: %', p_company_id using errcode = 'no_data_found';
44
+ end if;
45
+ -- Settling asks filings.write, and finding the administration is part of it.
46
+ if not is_installer() and not has_capability(p_company_id, 'filings.write') then
47
+ raise exception 'not_allowed: finding the administration of this company needs filings.write'
48
+ using errcode = '42501';
49
+ end if;
50
+
51
+ -- The name in the company's language where the pack gives one, else in the
52
+ -- pack's own; and every name the pack gives, by which an existing contact
53
+ -- is recognised whatever language it was created in.
54
+ select c.fiscal_country,
55
+ coalesce(nullif(btrim(d.tax_payee_name_i18n ->> c.language), ''), d.tax_payee_name),
56
+ array_remove(array[lower(btrim(d.tax_payee_name))]
57
+ || coalesce((select array_agg(lower(btrim(n.value)))
58
+ from jsonb_each_text(d.tax_payee_name_i18n) n), '{}'), null),
59
+ account_id_by_code(c.id, d.tax_payable_code),
60
+ account_id_by_code(c.id, coalesce(d.tax_receivable_code, d.tax_payable_code))
61
+ into v_country, v_name, v_names, v_payable, v_receivable
62
+ from companies c
63
+ left join country_defaults d on d.country = c.fiscal_country
64
+ where c.id = p_company_id;
65
+
66
+ if v_payable is null then
67
+ raise exception 'no_tax_payable_account: the pack of this company names no account of its chart for what a declaration owes. Set defaults.roles.tax_payable in the pack.';
68
+ end if;
69
+
70
+ -- The contact that books to the account is the administration: it is the
71
+ -- only one settle_filing() accepts, so there is nothing else it could be.
72
+ select count(*) into v_count
73
+ from contacts k
74
+ where k.company_id = p_company_id and k.active and k.merged_into is null
75
+ and k.payable_account_id = v_payable;
76
+
77
+ if v_count = 1 then
78
+ select * into v_contact
79
+ from contacts k
80
+ where k.company_id = p_company_id and k.active and k.merged_into is null
81
+ and k.payable_account_id = v_payable;
82
+ elsif v_count > 1 then
83
+ -- Several: the one under a name the pack gives, where there is exactly one.
84
+ select * into v_contact
85
+ from contacts k
86
+ where k.company_id = p_company_id and k.active and k.merged_into is null
87
+ and k.payable_account_id = v_payable
88
+ and lower(btrim(k.name)) = any(v_names);
89
+ if v_contact.id is null or (select count(*) from contacts k
90
+ where k.company_id = p_company_id and k.active and k.merged_into is null
91
+ and k.payable_account_id = v_payable
92
+ and lower(btrim(k.name)) = any(v_names)) > 1 then
93
+ raise exception 'several_tax_payees: % contacts of this company book to the account of what a declaration owes (%), and none of them alone is the administration. Name it with p_contact_id, or give the others another account.',
94
+ v_count, (select string_agg(k.name, ', ' order by k.name) from contacts k
95
+ where k.company_id = p_company_id and k.active and k.merged_into is null
96
+ and k.payable_account_id = v_payable);
97
+ end if;
98
+ else
99
+ -- Nobody yet. A pack that names no administration leaves it unknown, as
100
+ -- filing_deadline() answers null where the pack names no rule.
101
+ if v_name is null then
102
+ return null;
103
+ end if;
104
+ insert into contacts (company_id, name, contact_type, is_company, country,
105
+ payable_account_id, receivable_account_id, payment_terms_days)
106
+ values (p_company_id, v_name, 'supplier', true, v_country, v_payable, v_receivable, 0)
107
+ returning * into v_contact;
108
+ return v_contact;
109
+ end if;
110
+
111
+ -- A credit claimed back is a receivable from the same administration. A
112
+ -- contact that says nothing about that side is given the account the pack
113
+ -- names for it; one that names another account is left as it is, and
114
+ -- settle_filing() says what to change.
115
+ if v_contact.receivable_account_id is null then
116
+ update contacts k set receivable_account_id = v_receivable
117
+ where k.id = v_contact.id
118
+ returning * into v_contact;
119
+ end if;
120
+ return v_contact;
121
+ end;
122
+ $$;
123
+
124
+ comment on function tax_payee(uuid) is
125
+ 'The contact of this company that is its tax administration: the one contact that books to the account the pack names for what a declaration owes — under a name the pack gives, in any of its languages, where several do — created on first need under the name the pack gives in the company''s language (country_defaults.tax_payee_name_i18n), else in the pack''s own (tax_payee_name), booking both ways to the accounts settle_filing() uses. Null where no contact books to that account and the pack names no administration. Asks filings.write.';
126
+
127
+ revoke execute on function tax_payee(uuid) from public, anon;
128
+ grant execute on function tax_payee(uuid) to authenticated, service_role;
129
+
130
+ revoke execute on all functions in schema public from public;
@@ -0,0 +1,38 @@
1
+ -- Ekwo OS — the schema this release defines is 0.20.0.
2
+ --
3
+ -- `ekwo_schema_version()` is the one place the number lives, and a migration
4
+ -- is the only thing that moves it. A database then answers for the files it
5
+ -- has actually run rather than for what somebody believed it had run: the
6
+ -- column default and `init_instance()` both call this function, so a fresh
7
+ -- install records the new number without a second edit, and `ekwo migrate`
8
+ -- reads it back onto `instance.schema_version` for a database that was
9
+ -- installed at an older one.
10
+ --
11
+ -- Between 0.19.0 and here a declaration whose debt was matched before
12
+ -- matching said so is recorded paid, a deposit is written by the core's
13
+ -- functions only (`write_filing_outcome()`, the policy
14
+ -- `tax_filing_deposits_write` and the direct writes gone), and the
15
+ -- administration a declaration is paid to is named in the company's language
16
+ -- (`country_defaults.tax_payee_name_i18n`, read by `tax_payee()`).
17
+ --
18
+ -- The floor of `ekwo-os`, `@ekwo-ai/core` and `@ekwo-ai/mcp` rises to 0.20.0:
19
+ -- `ekwo-os` compiles packs into `country_defaults.tax_payee_name_i18n`, which
20
+ -- a 0.19.0 database does not have, and the three packages declare one floor.
21
+
22
+ create or replace function ekwo_schema_version()
23
+ returns text
24
+ language sql
25
+ immutable
26
+ as $$
27
+ select '0.20.0'::text;
28
+ $$;
29
+
30
+ comment on function ekwo_schema_version() is
31
+ 'Schema version of the installed release. Bumped by a migration, never by hand.';
32
+
33
+ -- `create or replace` keeps the privileges the function already had, and the
34
+ -- revoke is what every migration of this directory ends with: a function that
35
+ -- comes out with the built-in default is published by Supabase as an
36
+ -- anonymous RPC endpoint.
37
+ revoke execute on all functions in schema public from public;
38
+ grant execute on function ekwo_schema_version() to authenticated, service_role;
@@ -1,6 +1,6 @@
1
1
  -- Ekwo OS — Belgium: chart of accounts, journals, taxes and defaults.
2
2
  --
3
- -- Generated from packs/be at version 1.22.0, do not edit.
3
+ -- Generated from packs/be at version 1.23.0, do not edit.
4
4
  -- Change the pack and run `ekwo pack build be`; `ekwo pack check --all`
5
5
  -- refuses a seed that is not the exact output of its pack, and the CI runs it.
6
6
  --
@@ -54,6 +54,12 @@
54
54
  -- https://www.dataprotectionauthority.be/publications/avis-n0-123-2025.pdf
55
55
  -- Arrêté royal du 25 mai 2026 modifiant l'arrêté royal du 30 décembre 2009 fixant la définition et les conditions auxquelles doit répondre un système de caisse enregistreuse dans le secteur horeca (SPF Justice — Moniteur belge du 3 juin 2026 (Justel))
56
56
  -- https://www.ejustice.just.fgov.be/eli/arrete/2026/05/25/2026003998/justel
57
+ -- Intervat — la page néerlandaise du SPF Finances (FOD Financiën) (FOD Financiën)
58
+ -- https://financien.belgium.be/nl/E-services/Intervat
59
+ -- Intervat — la page allemande du SPF Finances (FOD Finanzen) (FOD Finanzen)
60
+ -- https://finanzen.belgium.be/de/E-services/Intervat
61
+ -- Intervat — la page anglaise du SPF Finances (FPS Finance) (FPS Finance)
62
+ -- https://finance.belgium.be/en/E-services/Intervat
57
63
  --
58
64
  -- Evidence, per scope, against what that company filed:
59
65
  -- income_statement 2025, NBB abridged annual accounts: reproduced (2026-10-10)
@@ -68,7 +74,7 @@ insert into country_packs
68
74
  (country, name, version, released_at, schema_min, certification_status,
69
75
  certified_by, certified_at, checksum, sources, evidence)
70
76
  values
71
- ('BE', 'Belgium', '1.22.0', date '2026-10-23', '20261023124650', 'proven', null, null, '09f1e316d534214fc1a0afeef38f2365327188b0cc7a8629329ffe98b467add4', '[{"key":"pcmn","title":"Arrêté royal du 21 octobre 2018 portant exécution des articles III.82 à III.95 du Code de droit économique, annexe 1 — plan comptable minimum normalisé","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/arrete/2018/10/21/2018014350/justel","consulted_on":"2026-09-15","kind":"regulation"},{"key":"code-tva","title":"Code de la taxe sur la valeur ajoutée, institué par la loi du 3 juillet 1969","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/loi/1969/07/03/1969070305/justel","consulted_on":"2026-09-16","kind":"law"},{"key":"ar-20","title":"Arrêté royal n° 20 du 20 juillet 1970 fixant les taux de la taxe sur la valeur ajoutée et déterminant la répartition des biens et des services selon ces taux","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/arrete/1970/07/20/1970072012/justel","consulted_on":"2026-09-15","kind":"regulation"},{"key":"ar-1","title":"Arrêté royal n° 1 du 29 décembre 1992 relatif aux mesures tendant à assurer le paiement de la taxe sur la valeur ajoutée","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/arrete/1992/12/29/1992003823/justel","consulted_on":"2026-09-15","kind":"regulation"},{"key":"ar-7","title":"Arrêté royal n° 7 du 29 décembre 1992 relatif aux importations de biens pour l''application de la taxe sur la valeur ajoutée","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/arrete/1992/12/29/1992003833/justel","consulted_on":"2026-09-15","kind":"regulation"},{"key":"cir-92","title":"Code des impôts sur les revenus 1992","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/loi/1992/04/10/1992041050/justel","consulted_on":"2026-09-15","kind":"law"},{"key":"ar-cir-92","title":"Arrêté royal du 27 août 1993 d''exécution du Code des impôts sur les revenus 1992","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/arrete/1993/08/27/1993082751/justel","consulted_on":"2026-09-15","kind":"regulation"},{"key":"comptes-annuels","title":"Arrêté royal du 29 avril 2019 portant exécution du Code des sociétés et des associations, dont les annexes fixent les schémas des comptes annuels","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/arrete/2019/04/29/2019011967/justel","consulted_on":"2026-09-15","kind":"regulation"},{"key":"retard-de-paiement","title":"Loi du 2 août 2002 concernant la lutte contre le retard de paiement dans les transactions commerciales","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/loi/2002/08/02/2002009716/justel","consulted_on":"2026-09-15","kind":"law"},{"key":"facturation-electronique","title":"Loi du 6 février 2024 modifiant le Code de la taxe sur la valeur ajoutée et le Code des impôts sur les revenus 1992 en ce qui concerne l''introduction de l''obligation de facturation électronique","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/loi/2024/02/06/2024001635/justel","consulted_on":"2026-09-15","kind":"law"},{"key":"declaration-periodique","title":"Déclaration périodique à la TVA — formulaire 625 et sa notice détaillée pour la rédaction des déclarations","publisher":"SPF Finances","url":"https://finances.belgium.be/fr/entreprises/tva/declaration/declaration-periodique","consulted_on":"2026-09-15","kind":"form"},{"key":"intervat","title":"Intervat — l''application par laquelle les déclarations à la TVA sont déposées","publisher":"SPF Finances","url":"https://finances.belgium.be/fr/E-services/Intervat/","consulted_on":"2026-09-15","kind":"portal"},{"key":"en-16931","title":"EN 16931-1 — modèle sémantique de la facture électronique européenne, et la conformité que la directive 2014/55/UE en attend","publisher":"Commission européenne","url":"https://ec.europa.eu/digital-building-blocks/sites/spaces/DIGITAL/pages/467108950/EN+16931+compliance","consulted_on":"2026-09-15","kind":"standard"},{"key":"uncl5305","title":"UNCL5305 — liste des codes de catégorie de TVA (BT-118 et BT-151), sous-ensemble publié pour EN 16931","publisher":"OpenPEPPOL — liste publiée par la Commission européenne","url":"https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL5305/","consulted_on":"2026-09-15","kind":"standard"},{"key":"vatex","title":"VATEX — liste des codes de motif d''exonération de TVA (BT-121)","publisher":"OpenPEPPOL — liste publiée par la Commission européenne","url":"https://docs.peppol.eu/poacc/billing/3.0/codelist/vatex/","consulted_on":"2026-09-15","kind":"standard"},{"key":"cir-92-ex-2026","title":"Code des impôts sur les revenus 1992 — revenus de 2025, exercice d''imposition 2026, édition mise à jour au Moniteur belge du 31 décembre 2024","publisher":"SPF Finances — Fisconetplus, édition reproduite par le SPW Finances","url":"https://finances.wallonie.be/files/NOSTRA/textes%20legaux/code%20des%20impots%20sur%20le%20revenu%20-%20exercice%202022.pdf","consulted_on":"2026-09-30","kind":"law"},{"key":"isoc-275-1-2026","title":"Explications relatives à la déclaration à l''impôt des sociétés, exercice d''imposition 2026 (modèle 275.1)","publisher":"SPF Finances","url":"https://finances.belgium.be/sites/default/files/downloads/121-declaration-isoc-explications-2026.pdf","consulted_on":"2026-09-30","kind":"form"},{"key":"verdissement-mobilite","title":"Circulaire relative au verdissement fiscal de la mobilité — questions fréquemment posées","publisher":"SPF Finances","url":"https://finances.belgium.be/sites/default/files/downloads/000-circulaire-verdissement-fiscal-mobilite.pdf","consulted_on":"2026-09-30","kind":"guidance"},{"key":"versements-anticipes","title":"Versements anticipés des sociétés — taux de majoration et d''avantage, échéances","publisher":"SPF Finances","url":"https://finances.belgium.be/fr/entreprises/impot_des_societes/versements_anticipes","consulted_on":"2026-09-30","kind":"guidance"},{"key":"loi-2025-12-18","title":"Loi du 18 décembre 2025 portant des dispositions diverses","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/cgi_loi/article.pl?language=fr&lg_txt=f&cn_search=2025121806&caller=eli&view_numac=2025121806fr","consulted_on":"2026-09-30","kind":"law"},{"key":"loi-2026-07-15","title":"Loi du 15 juillet 2026 portant réforme de l''impôt des personnes physiques","publisher":"SPF Justice — Moniteur belge du 29 juillet 2026","url":"https://www.ejustice.just.fgov.be/cgi/article.pl?language=fr&sum_date=2026-07-29&lg_txt=f&caller=sum&s_editie=1&2026005724=2&numac_search=2026005724&view_numac=","consulted_on":"2026-09-30","kind":"law"},{"key":"e-reporting-faq","title":"Questions générales sur l''e-reporting — FAQ de la facturation électronique","publisher":"SPF Stratégie et Appui (BOSA) et SPF Finances — efacture.belgium.be","url":"https://efacture.belgium.be/fr/FAQ/questions-generales-sur-le-e-reporting","consulted_on":"2026-10-18","kind":"guidance"},{"key":"apd-avis-123-2025","title":"Avis n° 123/2025 du 21 novembre 2025 concernant un avant-projet de loi portant des dispositions diverses en matière de taxe sur la valeur ajoutée (CO-A-2025-182), point 29 — le rapportage électronique envisagé dès le 1er janvier 2028","publisher":"Autorité de protection des données","url":"https://www.dataprotectionauthority.be/publications/avis-n0-123-2025.pdf","consulted_on":"2026-10-18","kind":"guidance"},{"key":"ar-caisse-horeca-2026","title":"Arrêté royal du 25 mai 2026 modifiant l''arrêté royal du 30 décembre 2009 fixant la définition et les conditions auxquelles doit répondre un système de caisse enregistreuse dans le secteur horeca","publisher":"SPF Justice — Moniteur belge du 3 juin 2026 (Justel)","url":"https://www.ejustice.just.fgov.be/eli/arrete/2026/05/25/2026003998/justel","consulted_on":"2026-10-18","kind":"regulation"}]'::jsonb, '[{"scope":"income_statement","result":"reproduced","fiscal_year":2025,"filing":"NBB abridged annual accounts","summary":"On the books of a Belgian SA, imported from another system, every line of the income statement it filed with the National Bank of Belgium matches to the euro.","checked_on":"2026-10-10"},{"scope":"balance_sheet","result":"partly_reproduced","fiscal_year":2025,"filing":"NBB abridged annual accounts","summary":"25 of the 34 non-empty lines of the filed balance sheet match to the euro; the nine others all carry one reclassification of a sub-account that the accountant made by hand, which the pack does not derive.","checked_on":"2026-10-10"},{"scope":"appropriation_account","result":"partly_reproduced","fiscal_year":2025,"filing":"NBB abridged annual accounts","summary":"The profit to appropriate matches; the loss brought forward and the result carried forward do not, because the year-end close books the result of the year alone and the statement does not read the balance brought forward.","checked_on":"2026-10-10"},{"scope":"vat_return","result":"not_tested","fiscal_year":2025,"filing":"Belgian periodic VAT return (Intervat)","summary":"Not tested: the imported books carry no VAT code on their lines, and Ekwo OS builds a VAT return only from tax-coded documents.","checked_on":"2026-10-10"}]'::jsonb)
77
+ ('BE', 'Belgium', '1.23.0', date '2026-10-23', '20261023160200', 'proven', null, null, '78237e5d79349bf9d794de3c2a2acb850e7acd0969f197356fceb9f1d960a6da', '[{"key":"pcmn","title":"Arrêté royal du 21 octobre 2018 portant exécution des articles III.82 à III.95 du Code de droit économique, annexe 1 — plan comptable minimum normalisé","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/arrete/2018/10/21/2018014350/justel","consulted_on":"2026-09-15","kind":"regulation"},{"key":"code-tva","title":"Code de la taxe sur la valeur ajoutée, institué par la loi du 3 juillet 1969","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/loi/1969/07/03/1969070305/justel","consulted_on":"2026-09-16","kind":"law"},{"key":"ar-20","title":"Arrêté royal n° 20 du 20 juillet 1970 fixant les taux de la taxe sur la valeur ajoutée et déterminant la répartition des biens et des services selon ces taux","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/arrete/1970/07/20/1970072012/justel","consulted_on":"2026-09-15","kind":"regulation"},{"key":"ar-1","title":"Arrêté royal n° 1 du 29 décembre 1992 relatif aux mesures tendant à assurer le paiement de la taxe sur la valeur ajoutée","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/arrete/1992/12/29/1992003823/justel","consulted_on":"2026-09-15","kind":"regulation"},{"key":"ar-7","title":"Arrêté royal n° 7 du 29 décembre 1992 relatif aux importations de biens pour l''application de la taxe sur la valeur ajoutée","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/arrete/1992/12/29/1992003833/justel","consulted_on":"2026-09-15","kind":"regulation"},{"key":"cir-92","title":"Code des impôts sur les revenus 1992","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/loi/1992/04/10/1992041050/justel","consulted_on":"2026-09-15","kind":"law"},{"key":"ar-cir-92","title":"Arrêté royal du 27 août 1993 d''exécution du Code des impôts sur les revenus 1992","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/arrete/1993/08/27/1993082751/justel","consulted_on":"2026-09-15","kind":"regulation"},{"key":"comptes-annuels","title":"Arrêté royal du 29 avril 2019 portant exécution du Code des sociétés et des associations, dont les annexes fixent les schémas des comptes annuels","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/arrete/2019/04/29/2019011967/justel","consulted_on":"2026-09-15","kind":"regulation"},{"key":"retard-de-paiement","title":"Loi du 2 août 2002 concernant la lutte contre le retard de paiement dans les transactions commerciales","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/loi/2002/08/02/2002009716/justel","consulted_on":"2026-09-15","kind":"law"},{"key":"facturation-electronique","title":"Loi du 6 février 2024 modifiant le Code de la taxe sur la valeur ajoutée et le Code des impôts sur les revenus 1992 en ce qui concerne l''introduction de l''obligation de facturation électronique","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/eli/loi/2024/02/06/2024001635/justel","consulted_on":"2026-09-15","kind":"law"},{"key":"declaration-periodique","title":"Déclaration périodique à la TVA — formulaire 625 et sa notice détaillée pour la rédaction des déclarations","publisher":"SPF Finances","url":"https://finances.belgium.be/fr/entreprises/tva/declaration/declaration-periodique","consulted_on":"2026-09-15","kind":"form"},{"key":"intervat","title":"Intervat — l''application par laquelle les déclarations à la TVA sont déposées","publisher":"SPF Finances","url":"https://finances.belgium.be/fr/E-services/Intervat/","consulted_on":"2026-09-15","kind":"portal"},{"key":"en-16931","title":"EN 16931-1 — modèle sémantique de la facture électronique européenne, et la conformité que la directive 2014/55/UE en attend","publisher":"Commission européenne","url":"https://ec.europa.eu/digital-building-blocks/sites/spaces/DIGITAL/pages/467108950/EN+16931+compliance","consulted_on":"2026-09-15","kind":"standard"},{"key":"uncl5305","title":"UNCL5305 — liste des codes de catégorie de TVA (BT-118 et BT-151), sous-ensemble publié pour EN 16931","publisher":"OpenPEPPOL — liste publiée par la Commission européenne","url":"https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL5305/","consulted_on":"2026-09-15","kind":"standard"},{"key":"vatex","title":"VATEX — liste des codes de motif d''exonération de TVA (BT-121)","publisher":"OpenPEPPOL — liste publiée par la Commission européenne","url":"https://docs.peppol.eu/poacc/billing/3.0/codelist/vatex/","consulted_on":"2026-09-15","kind":"standard"},{"key":"cir-92-ex-2026","title":"Code des impôts sur les revenus 1992 — revenus de 2025, exercice d''imposition 2026, édition mise à jour au Moniteur belge du 31 décembre 2024","publisher":"SPF Finances — Fisconetplus, édition reproduite par le SPW Finances","url":"https://finances.wallonie.be/files/NOSTRA/textes%20legaux/code%20des%20impots%20sur%20le%20revenu%20-%20exercice%202022.pdf","consulted_on":"2026-09-30","kind":"law"},{"key":"isoc-275-1-2026","title":"Explications relatives à la déclaration à l''impôt des sociétés, exercice d''imposition 2026 (modèle 275.1)","publisher":"SPF Finances","url":"https://finances.belgium.be/sites/default/files/downloads/121-declaration-isoc-explications-2026.pdf","consulted_on":"2026-09-30","kind":"form"},{"key":"verdissement-mobilite","title":"Circulaire relative au verdissement fiscal de la mobilité — questions fréquemment posées","publisher":"SPF Finances","url":"https://finances.belgium.be/sites/default/files/downloads/000-circulaire-verdissement-fiscal-mobilite.pdf","consulted_on":"2026-09-30","kind":"guidance"},{"key":"versements-anticipes","title":"Versements anticipés des sociétés — taux de majoration et d''avantage, échéances","publisher":"SPF Finances","url":"https://finances.belgium.be/fr/entreprises/impot_des_societes/versements_anticipes","consulted_on":"2026-09-30","kind":"guidance"},{"key":"loi-2025-12-18","title":"Loi du 18 décembre 2025 portant des dispositions diverses","publisher":"SPF Justice — Moniteur belge (Justel)","url":"https://www.ejustice.just.fgov.be/cgi_loi/article.pl?language=fr&lg_txt=f&cn_search=2025121806&caller=eli&view_numac=2025121806fr","consulted_on":"2026-09-30","kind":"law"},{"key":"loi-2026-07-15","title":"Loi du 15 juillet 2026 portant réforme de l''impôt des personnes physiques","publisher":"SPF Justice — Moniteur belge du 29 juillet 2026","url":"https://www.ejustice.just.fgov.be/cgi/article.pl?language=fr&sum_date=2026-07-29&lg_txt=f&caller=sum&s_editie=1&2026005724=2&numac_search=2026005724&view_numac=","consulted_on":"2026-09-30","kind":"law"},{"key":"e-reporting-faq","title":"Questions générales sur l''e-reporting — FAQ de la facturation électronique","publisher":"SPF Stratégie et Appui (BOSA) et SPF Finances — efacture.belgium.be","url":"https://efacture.belgium.be/fr/FAQ/questions-generales-sur-le-e-reporting","consulted_on":"2026-10-18","kind":"guidance"},{"key":"apd-avis-123-2025","title":"Avis n° 123/2025 du 21 novembre 2025 concernant un avant-projet de loi portant des dispositions diverses en matière de taxe sur la valeur ajoutée (CO-A-2025-182), point 29 — le rapportage électronique envisagé dès le 1er janvier 2028","publisher":"Autorité de protection des données","url":"https://www.dataprotectionauthority.be/publications/avis-n0-123-2025.pdf","consulted_on":"2026-10-18","kind":"guidance"},{"key":"ar-caisse-horeca-2026","title":"Arrêté royal du 25 mai 2026 modifiant l''arrêté royal du 30 décembre 2009 fixant la définition et les conditions auxquelles doit répondre un système de caisse enregistreuse dans le secteur horeca","publisher":"SPF Justice — Moniteur belge du 3 juin 2026 (Justel)","url":"https://www.ejustice.just.fgov.be/eli/arrete/2026/05/25/2026003998/justel","consulted_on":"2026-10-18","kind":"regulation"},{"key":"intervat-nl","title":"Intervat — la page néerlandaise du SPF Finances (FOD Financiën)","publisher":"FOD Financiën","url":"https://financien.belgium.be/nl/E-services/Intervat","consulted_on":"2026-10-23","kind":"portal"},{"key":"intervat-de","title":"Intervat — la page allemande du SPF Finances (FOD Finanzen)","publisher":"FOD Finanzen","url":"https://finanzen.belgium.be/de/E-services/Intervat","consulted_on":"2026-10-23","kind":"portal"},{"key":"intervat-en","title":"Intervat — la page anglaise du SPF Finances (FPS Finance)","publisher":"FPS Finance","url":"https://finance.belgium.be/en/E-services/Intervat","consulted_on":"2026-10-23","kind":"portal"}]'::jsonb, '[{"scope":"income_statement","result":"reproduced","fiscal_year":2025,"filing":"NBB abridged annual accounts","summary":"On the books of a Belgian SA, imported from another system, every line of the income statement it filed with the National Bank of Belgium matches to the euro.","checked_on":"2026-10-10"},{"scope":"balance_sheet","result":"partly_reproduced","fiscal_year":2025,"filing":"NBB abridged annual accounts","summary":"25 of the 34 non-empty lines of the filed balance sheet match to the euro; the nine others all carry one reclassification of a sub-account that the accountant made by hand, which the pack does not derive.","checked_on":"2026-10-10"},{"scope":"appropriation_account","result":"partly_reproduced","fiscal_year":2025,"filing":"NBB abridged annual accounts","summary":"The profit to appropriate matches; the loss brought forward and the result carried forward do not, because the year-end close books the result of the year alone and the statement does not read the balance brought forward.","checked_on":"2026-10-10"},{"scope":"vat_return","result":"not_tested","fiscal_year":2025,"filing":"Belgian periodic VAT return (Intervat)","summary":"Not tested: the imported books carry no VAT code on their lines, and Ekwo OS builds a VAT return only from tax-coded documents.","checked_on":"2026-10-10"}]'::jsonb)
72
78
  on conflict (country) do update set
73
79
  name = excluded.name,
74
80
  version = excluded.version,
@@ -1587,6 +1593,7 @@ on conflict (country, code) do update set
1587
1593
  legal_reference = excluded.legal_reference;
1588
1594
 
1589
1595
  update country_defaults set
1596
+ tax_payee_name_i18n = '{"de":"FOD Finanzen","en":"FPS Finance","nl":"FOD Financiën"}'::jsonb,
1590
1597
  tax_payee_name = 'SPF Finances',
1591
1598
  tax_payee_source_key = 'intervat'
1592
1599
  where country = 'BE';