Tax Return Boxes
A fiscal localization (an l10n_* module) describes its statutory tax return — the UK’s
VAT100, Ireland’s VAT3, Australia’s BAS — as TaxReportBox records in its
data/tax_report_boxes.yaml. Taxes name the boxes they report into, and the Tax Return fills
every box from what was posted in the period, in the company’s currency. A company’s return
uses the boxes of the localization selected in its invoicing configuration.
Shipped boxes are the authority’s own layout: they are reloaded from the data file on every
update (so leave apply_once off), carry is_system: true, and cannot be edited or deleted
in the app.
Declaring a box
Section titled “Declaring a box”- data_type: TaxReportBox identifier: ie_box_t1 # stable handle; taxes and parents refer to it is_system: true localization: l10n_ie # the module whose return this is code: "T1" # the number printed on the form name: "VAT on sales" sequence: 10 # order on the return, and evaluation order for formulas whole_units: true whole_units_rounding: "Round to Nearest"| Field | Meaning |
|---|---|
code | The box number as the form prints it. Formulas refer to it as B<code>. |
formula | A derived box: an expression over earlier boxes, e.g. B1 + B2 or max(BT1 - BT2, 0). Blank means a summed box filled by the taxes mapped to it. Evaluated by the safe formula evaluator (see Formulas); a formula that cannot be worked out stops the return rather than reporting 0. |
whole_units | The form takes this box in whole pounds, euros or dollars. |
whole_units_rounding | How a whole_units box reaches its whole number — see below. |
parent | This box is part of another. Without region_code it is a subset counted in the parent too (the UK’s Box 8 within Box 6); with one, it receives that region’s share of the parent (the UAE’s per-emirate Boxes 1a–1g). |
region_code | The ISO 3166-2 region a regional part reports, e.g. AE-DU. |
negate | Report the opposite sign of what the mapped taxes post — for a box asked as a positive amount of tax taken back. |
yes_no | The form asks this box as a question; it is answered Yes when it holds an amount. |
balance_account_roles, balance_account_types, balance_absolute | Fill the box from the period’s balance of accounts (by role or type) instead of from taxes. |
Taxes point at boxes with tax_box / base_box (and self_assessed_box /
self_assessed_base_box for the tax owed on a reverse charge); a tax-distribution line can
send one component of a tax to its own box with tax_box.
Whole units: dropped or rounded
Section titled “Whole units: dropped or rounded”Authorities that want a return in whole units do not all get there the same way, and the
difference is up to one unit per box, so a box states it with whole_units_rounding:
| Value | Behaviour | Used by |
|---|---|---|
Drop the Fraction (default) | The pence or cents are dropped, toward zero: 10.99 → 10, −10.99 → −10. | UK VAT100 Boxes 6–9, Australia’s BAS |
Round to Nearest | Rounded to the nearest whole unit, a half going away from zero: 10.50 → 11, 10.49 → 10, −10.50 → −11. | Ireland’s VAT3 and RTD |
The value is first settled to the currency’s own minor unit and only then made whole, so
binary noise cannot move a figure across the half. A formula box reads the boxes before it
after they were made whole — Ireland’s T3 is the whole-euro T1 less the whole-euro T2 —
so put the boxes a formula reads earlier in sequence. whole_units_rounding has no effect
on a box without whole_units.
Changing a shipped return
Section titled “Changing a shipped return”Box records reload on every update, so a new box or a changed formula or rounding reaches
existing databases on its own. The mapping from taxes to boxes does not — taxes are seeded
once — so a pack that moves a tax to a different box calls
await get_model("Tax").apply_shipped_boxes("<module>") once from its post_update, behind a
get_param/set_param marker.