Files
InvoiceShelf/lang
Darko Gjorgjijoski 13aa087faf Add compound tax support (#753)
* test(taxes): cover compound_tax API semantics and validate it as boolean

* feat(taxes): restore the compound tax toggle in tax type settings

* feat(taxes): compute document-level compound tax amounts

Two-pass recalculation: simple taxes on the discounted subtotal, compound
taxes on the subtotal plus all simple taxes (v2 parity; branch order
fixed -> compound -> inclusive back-out -> simple). Amounts now also
recalculate on tax add/remove and on the tax-inclusive toggle, which
previously never triggered recalculation.

* feat(taxes): support compound taxes in per-item mode

Per-item tax rows now carry the compound flag and charge compound taxes
on the item's discounted base plus its simple taxes, through the same
calcTaxAmount branch order as document-level taxes. The item row splits
its tax sums into simple and compound so a compound row can never widen
its own base.

Also fixes two pre-existing bugs: the per-item tax dropdown read
window.__taxTypes, which nothing ever assigned, so it always rendered
empty (tax types are now fetched by the items table and passed down);
and removing a tax row hard-zeroed the item's totals instead of
re-syncing them.

* fix(invoices): skip placeholder tax rows when persisting item taxes

The document form keeps one empty placeholder tax row per item in
per-item tax mode. Its empty name is nullified by the framework's
empty-string middleware, so inserting it violated the NOT NULL
constraint and turned every per-item save into a 500. The equivalent
v2 guard keyed on a null amount, which the v3 stub (amount: 0) evades;
keying on the missing tax_type_id catches it.
2026-08-14 00:17:52 +02:00
..
2024-03-27 11:00:36 +01:00
2024-03-27 11:00:36 +01:00
2026-03-24 07:44:06 +01:00
2026-03-24 07:44:07 +01:00
2026-03-24 07:44:44 +01:00
2026-03-24 07:44:08 +01:00
2026-03-24 07:44:09 +01:00
2026-03-24 07:44:10 +01:00
2026-03-24 07:44:13 +01:00
2026-08-14 00:17:52 +02:00
2026-03-24 07:44:04 +01:00
2026-03-24 07:44:48 +01:00
2026-03-24 07:44:43 +01:00
2026-03-24 07:44:14 +01:00
2026-03-24 07:44:15 +01:00
2026-04-07 17:12:41 +02:00
2026-03-24 07:44:46 +01:00
2026-03-24 07:44:16 +01:00
2026-03-24 07:44:42 +01:00
2026-03-24 07:44:18 +01:00
2026-03-24 07:44:20 +01:00
2025-09-02 03:20:27 +02:00
2026-03-24 07:44:21 +01:00
2026-03-24 07:44:49 +01:00
2026-03-24 07:44:51 +01:00
2026-03-24 07:44:23 +01:00
2026-03-24 07:44:24 +01:00
2026-03-24 07:44:25 +01:00
2026-03-24 07:44:27 +01:00
2026-03-24 07:44:02 +01:00
2026-03-24 07:44:28 +01:00
2026-03-24 07:44:29 +01:00
2026-03-24 07:44:30 +01:00
2026-03-24 07:44:31 +01:00
2026-03-24 07:44:32 +01:00
2026-03-24 07:44:52 +01:00
2026-03-24 07:44:45 +01:00
2026-03-24 07:44:34 +01:00
2026-03-24 07:44:35 +01:00
2026-03-24 07:44:39 +01:00