VAT (VAT)
The vat submodule of acc owns the VAT/tax codes used on invoice and journal-entry lines, plus the per-(item-type, item, country) lookup table that resolves the right VAT code for a given item-and-counterparty combination. It depends on acc.gld for the VAT-to-pay and VAT-to-claim ledger accounts, and on cat.itm for the item / item-type rows that VAT codes are scoped to.
Concepts
VAT CodeA tax code with an optional VAT percentage and the two ledger accounts the VAT side of a posting routes to (one for VAT to pay, one for VAT to claim).
Item VAT CodeA lookup row keyed by (item type, item, country) that says which
VatCodeapplies. Resolution falls back from the most specific to the least specific row.
Entities
VAT Code (VatCode)
A tax code.
| Field | Description |
|---|---|
| Business key (up to 4 characters). |
| Human-readable name. |
| Optional VAT percentage. |
| Ledger account hit when the VAT side is a payable. |
| Ledger account hit when the VAT side is a receivable. |
Item VAT Code (ItemVatCode)
A lookup row.
| Field | Description |
|---|---|
| The item type (composite business key with |
| Optional specific item — when set, the row applies only to that item. |
| Optional counter-party country — when set, the row applies only to that country. |
| The VAT code that applies. |
Functionality
VAT-code resolution
VatCodeReaderService.getVatCode resolves the VAT code that applies to a (partner, item) or (item, country) combination. It walks the lookup table from most specific to least specific:
Match on (item, country).
Match on (item-type, country).
Match on (item-type) only.
If no row matches, the service shows a warning in the UI desktop and returns null so the caller can decide whether to proceed without a VAT code.
Public API
ACC_VAT_QueryApi and ACC_VAT_CommandApi
This submodule does not provide query- or command-API classes. Other modules read VAT codes through the standard generated readers and resolve the right code through VatCodeReaderService (an internal service).
ViewModel actions
The submodule defines view models for VatCode and ItemVatCode but does not declare any custom UI actions.