@kirjapro/mcp-server 0.10.0 → 0.12.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/CHANGELOG.md CHANGED
@@ -1,6 +1,87 @@
1
1
  # Changelog
2
2
 
3
- ## [0.10.0] - Unreleased
3
+ ## [0.12.0] - 2026-10-04
4
+
5
+ Requires deployment of all seven migrations in the compliance batch before release:
6
+
7
+ 1. `20261002140000_alv_era4a_rules`
8
+ 2. `20261003090000_bank_vat_historical_supply_evidence`
9
+ 3. `20261003103000_invoice_service_role_posting_guard`
10
+ 4. `20261003150000_atomic_knowledge_corpus`
11
+ 5. `20261003160000_purchase_vat_rate_basis`
12
+ 6. `20261003160001_bank_purchase_vat_rate_basis`
13
+ 7. `20261004080000_offer_financial_transfer` (U17)
14
+
15
+ Publish only after `db:deploy` and verification of the production-generated MCP database types. The U17 migration is required for `kirjapro_convert_offer_to_invoice` to preserve line discounts, the price-entry mode and line-specific VAT facts before the invoice lines are calculated.
16
+
17
+ - Invoice and offer tools accept `service_outside_eu` for general-rule B2B services to a non-EU business. The database posts to 5070 and reports field 309 with an AVL 65 § note. Check the receiving establishment and foreign buyer liability separately.
18
+ - This treatment supports PDF invoices. Finvoice transmission remains blocked pending complete O-category validation.
19
+ - VAT reconciliation no longer accepts manual purchase VAT rows as proof of a voucher link, even when net VAT is zero.
20
+ - New taxable purchases and single purchase templates require `vatRateBasis`: a documented supply/advance/period-end day, supply or EU-acquisition month, customs-acceptance day, or original-document reference and correction reason. Historical 24/14% rates are preserved; there is no blanket 12-month purchase-age limit. The posting date still selects the reporting period, which the caller must determine separately. Committed purchase retries return their original receipt before new evidence validation; a missing database capability refuses a new booking instead of silently dropping evidence.
21
+ - `kirjapro_book_purchase` accepts `deductionPercent` and `deductionReason`, retaining the original rounded VAT and its allocation group. On 18.40 € / 4.69 € at 60%, input VAT is 2.81 €, the remainder 1.88 €. Reverse charge always assesses the full buyer VAT, including entertainment and non-registered buyers' general-rule foreign services. These create one voucher with its facts; no additional manual VAT row is needed.
22
+ - The `import` category now means a customs VAT assessment on the complete customs tax base. It books only deductible VAT and any non-deductible tax against the full VAT liability. Supplier invoices and freight costs are booked separately; this command does not post the supplier cost or bank payment again. Outside-register imports remain outside this path.
23
+ - A positive-rate purchase retains its base/evidence when tax rounds to zero. Batch purchase templates remain refused when the batch command cannot write their facts, including zero-rounded tax. Updated tool fingerprints and server guidance reflect these contracts.
24
+
25
+ - Compliance resources now consume a generated package-local subset of the canonical regulatory registry. VAT history, payroll rates and micro/small thresholds no longer have a separate hand-maintained numeric table. Source reviews, legal validity and review-due dates are reported by topic and rule; source review expiry is distinct from an expired annual rate.
26
+ - Corrected conditional VAT deductions, historical 14% supplies/advances/credits, partial-deduction reverse charge, elective VAT-period boundaries, two-calendar-year small-business exemption, earnings-report/TyEL-payment guidance, invoice capability descriptions and retention start dates. Micro transition/odd-year interpretations remain expressly provisional. These resource changes do not make additional posting paths legally supported or deploy any database change.
27
+
28
+ ## [0.11.0] - 2026-10-02
29
+
30
+ Requires the database migrations `20261002070106`–`20261002071619` (ALV report
31
+ audit batch 2), in particular `book_purchase_with_vat`, and
32
+ `20261002120000`–`20261002120001` (batch 3, the OmaVero field map); release it
33
+ only after `db:deploy`. Version 0.10.0 keeps working against that database: its
34
+ standard purchases book plain vouchers without a VAT fact (listed by the ALV
35
+ reconciliation), the database applies the new sales-account rule, and its ALV
36
+ summary passes the new `omavero` key through. Against a database without the
37
+ batch 3 map, 0.11.0 derives the same fields from the older keys.
38
+
39
+ - `kirjapro_book_purchase`: for a VAT-registered company a purchase with a rate
40
+ above 0 is booked with `book_purchase_with_vat`, which writes the voucher and
41
+ its VAT fact together, so the VAT reaches field 307. `reverseCharge` works
42
+ again with the new `reverseChargeCategory` (`eu_goods`, `eu_services`,
43
+ `non_eu_services`, `import`, `construction`, `scrap_metal`) and a Finnish
44
+ rate. A company that is not VAT-registered is refused a rate above 0 or a
45
+ reverse charge and books the purchase gross with `vatRate` `0`; the refusal
46
+ says that the VAT on a service from a foreign seller is still owed and goes
47
+ on a non-deductible Ostojen ALV row in the web app and on a voucher D expense
48
+ / K 4210 (Customs collects such a company's import VAT). New optional
49
+ `supplierName`; the result adds `vat_entry_ids`. The database refuses (P0001)
50
+ a deduction on law-based non-deductible accounts, a foreign rate and VAT rows
51
+ that do not match the 2320/4210 lines.
52
+ - `kirjapro_create_from_template`: a purchase template that still debits 2320
53
+ books its domestic VAT fact through `book_purchase_with_vat`; for a company
54
+ that is not VAT-registered it is refused. `kirjapro_create_from_template_batch`
55
+ refuses purchase templates with VAT before any write (the atomic batch cannot
56
+ write VAT facts). `kirjapro_list_templates` hides `purchase_expense` and
57
+ `service_expense` from a company that is not VAT-registered.
58
+ - `kirjapro_create_transaction(s_batch)` and the server instructions describe
59
+ the net sales-account rule (U-3): a net credit on 5000-5499, a sales line
60
+ with a 4210 or 2320 line and a net 4210 credit are refused; a transfer out of
61
+ a sales account without a VAT line, such as a fixed-asset disposal, is
62
+ allowed. They also say that a free 2320 line does not reach field 307.
63
+ - `kirjapro_get_alv_summary` documents `output_vat_non_eu_services`, the VAT on
64
+ services bought from outside the EU that fields 301-303 now include.
65
+ - `kirjapro_get_alv_summary` returns every official OmaVero field in
66
+ `omavero_fields` (VSRALVKV v1.10: 301-314 and 318-320) from the database's
67
+ `omavero` map: 307 is the total deductible VAT including reverse charge and
68
+ import VAT, 308 = 301+302+303+304+305+306+318 - 307, 309 excludes EU sales,
69
+ and 311 follows AVL 138 a §. The legacy keys `field_307`…`field_313` (and
70
+ their `_base` keys), `field_318`-`field_320`, `total_zero_rated` and
71
+ `reverse_charge_base` are no longer returned: `field_307` was only the
72
+ domestic deductible VAT and the others were purchase categories, not field
73
+ numbers. New `exempt_sales_base` (sales without a deduction right, in no
74
+ field); unclassified legacy reverse-charge invoice lines add a `warning`.
75
+ - `kirjapro://compliance/*`: field 309 excludes EU sales (311, 312) and exempt
76
+ sales; cash-basis VAT needs no OmaVero opt-in and leaves EU and import items
77
+ on the accrual basis; a correction within 45 days carries no late-filing fee
78
+ regardless of the amount; the reverse-charge field list names 301-303 for
79
+ non-EU services, 304/310 for imports and the base fields.
80
+ - Review the fingerprints of `kirjapro_book_purchase`,
81
+ `kirjapro_create_from_template(_batch)`, `kirjapro_list_templates`,
82
+ `kirjapro_create_transaction(s_batch)` and `kirjapro_get_alv_summary`.
83
+
84
+ ## [0.10.0] - 2026-10-02
4
85
 
5
86
  Requires the database migrations `20261001204555`–`20261001204559` (ALV report
6
87
  audit batch 1). Version 0.9.1 keeps working against that database: its sales