Skip to content

feat(tax): VAT rates by country/state with a default, per-line VAT, invoicing catalog - #14

Merged
Panelica merged 6 commits into
Panelica:mainfrom
hedon77:feat/tax-vat
Sep 1, 2026
Merged

feat(tax): VAT rates by country/state with a default, per-line VAT, invoicing catalog#14
Panelica merged 6 commits into
Panelica:mainfrom
hedon77:feat/tax-vat

Conversation

@hedon77

@hedon77 hedon77 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Polish VAT setup: rates matched by country/state with an is_default fallback, a per-line VAT rate with descriptive labels, and an invoicing catalog (products with a unit field). Removes the secondary tax (tax2) and the tax levels.

- drop the level (Tax 1/Tax 2) column, add is_default to tax_rules
- match tax rules on country/state with the default rule as fallback
- seed Polish VAT rates (23%, 8%, 5%, 0%, ZW, NP) with 23% as default
- add 'set as default' action and default column to the tax screen
- single tax rate per invoice; secondary tax (tax2) no longer calculated
- tax rules are grouped by country and state; each group holds any number of
  rates (name + %) with one marked as default
- list shows country, state and the group's default rate; add/edit manage a
  group's rates in one form
- matching: country+state -> country default -> global default -> 0
- seed standard VAT rates for all European countries and Turkey
- invoice builder offers the client's country rates as a dropdown, defaulting
  to the country's default rate
- persist the rate label on invoice items so invoices and the PDF show the
  descriptive name (VAT 23%, VAT ZW, VAT NP) with tax amount and net base
- summary on invoice views: rate name, tax, net base; Netto moved under VAT
- localize Netto/Brutto labels
- new invoice_products catalog (name, price, unit, VAT) on the products page
  with add/edit/delete and VAT narrowed to the company's country
- catalog products appear in the invoice builder's description autocomplete
  and fill price, unit and their own VAT rate
- add a per-line 'unit' field (Jed.) to invoices and persist it
- pre-select the company default VAT rate when adding a catalog product
- fix en.json overrides so the 'New Hosting Product' button label applies
@Panelica

Copy link
Copy Markdown
Owner

Big, well-tested piece — thank you. Two things to confirm before we merge, since it's the foundation the other invoicing PRs build on:

  1. It removes secondary tax (tax2) entirely. The deleted test shows it never actually charged, so we're fine removing dead behavior — just confirming this is the intended scope (multi-tax jurisdictions would rely on the new per-line rates instead).
  2. On existing installs the migration leaves is_default = false on every rule, so the global-default fallback returns nothing until an operator marks a default — a catch-all tax could stop applying after upgrade. Could we set a sensible default in the migration (e.g. promote the former catch-all), or note it in the upgrade steps?

We'll take this as the base and rebase #9/#15/#17 on top to avoid the invoice-file conflicts.

@hedon77

hedon77 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Confirmed on both points:

  1. Removing ax2 is intended — the deleted test showed it never actually charged, so it was dead behavior. Multi-tax jurisdictions rely on the new per-line rates instead.
  2. Good catch — the migration now promotes the old catch-all rule (empty country) to is_default = true (falling back to the first rule if none exists), so the global default keeps applying after upgrade.

@Panelica
Panelica merged commit 9cc5999 into Panelica:main Sep 1, 2026
1 check passed
Panelica pushed a commit that referenced this pull request Sep 1, 2026
Add a CHANGELOG entry for the merged billing/extensibility work (#14 tax
model, #22 addon settings framework, #13 Tpay gateway, #16 client-delete
security fix, #24 invoice number display) and list Tpay in the modules
table and gateway overview.
Panelica pushed a commit that referenced this pull request Sep 3, 2026
… and the tax/proforma merges

Adds the tr/zh strings for the new Add Service form, and backfills eleven keys
the tax-model and proforma merges (#14, #21) added to English and Polish but
not to Turkish and Chinese (invoicing catalog, per-line unit, proforma). This
restores full pl/zh/tr parity with English.
Panelica pushed a commit that referenced this pull request Sep 3, 2026
The zh files had drifted from English after several merges (#9, #14, #17, #21,
#23): same keys, but flattened/reordered, so the zh structure test failed.
Rebuild admin/client/common/messages to English's exact nesting and order,
keeping every existing Chinese translation. Also fix funds.amount_range, which
carried :min/:max placeholders English does not pass, so it rendered the raw
tokens; it now matches the English static form.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants