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 Code

A 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 Code

A lookup row keyed by (item type, item, country) that says which VatCode applies. Resolution falls back from the most specific to the least specific row.

Entities

VAT entities

VAT Code (VatCode)

A tax code.

FieldDescription

code

Business key (up to 4 characters).

description

Human-readable name.

vatPercentage

Optional VAT percentage.

accountVatToPay

Ledger account hit when the VAT side is a payable.

accountVatToClaim

Ledger account hit when the VAT side is a receivable.

Item VAT Code (ItemVatCode)

A lookup row.

FieldDescription

itemType

The item type (composite business key with item and country).

item

Optional specific item — when set, the row applies only to that item.

country

Optional counter-party country — when set, the row applies only to that country.

vatCode

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:

  1. Match on (item, country).

  2. Match on (item-type, country).

  3. 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.