TaxRuleTable
in package
The rule table of the VAT engine.
Pure function, no I/O: status × customer class × nature × EU B2C threshold → one row.
Every branch names its rule table row (row:) and is covered 1:1 by tests/Unit/System/TaxRuleTableTest.php.
Rules still pending advisor confirmation are marked "pending advisor confirmation" in comments — a change is one place
here plus one data-provider row in the test.
"Domestic" always means the seller's country (sellers.country_code), so the table is symmetric
for a non-CZ seller.
Table of Contents
Methods
- decide() : TaxRuleRow
- findNoteKey() : string|null
- Note key of a snapshotted code (the invoice generator re-translates the note in the document language): the same keys the table puts on its rows; `DOMESTIC` has none.
- buildDomestic() : TaxRuleRow
- buildNonPayer() : TaxRuleRow
- buildNoteKey() : string
- `tax.note.<CODE>`; the non-payer code differs by seller status (`.identified` / `.non_payer`).
- buildOutsideScope() : TaxRuleRow
- buildReverseCharge() : TaxRuleRow
- decideNotPayer() : TaxRuleRow
- decidePayer() : TaxRuleRow
Methods
decide()
public
decide(SellerVatStatus $status, CustomerClass $customerClass, SupplyNature $nature[, bool $euB2cThresholdExceeded = false ][, bool|null $supplyPlaceDomestic = null ]) : TaxRuleRow
Parameters
- $status : SellerVatStatus
- $customerClass : CustomerClass
- $nature : SupplyNature
- $euB2cThresholdExceeded : bool = false
-
T: limit EU_B2C_DISTANCE exceeded (previous year, or this year including this supply); without an active limit false
- $supplyPlaceDomestic : bool|null = null
-
place of supply is in the seller's country — for
immovable_servicethe property country, forgoodsthe dispatch country; null = derive from the customer class (domestic class ⇒ true)
Return values
TaxRuleRowfindNoteKey()
Note key of a snapshotted code (the invoice generator re-translates the note in the document language): the same keys the table puts on its rows; `DOMESTIC` has none.
public
findNoteKey(TaxTreatmentCode $code, SellerVatStatus|null $status) : string|null
Parameters
- $code : TaxTreatmentCode
- $status : SellerVatStatus|null
Return values
string|nullbuildDomestic()
private
buildDomestic(int $row) : TaxRuleRow
Parameters
- $row : int
Return values
TaxRuleRowbuildNonPayer()
private
buildNonPayer(int $row, SellerVatStatus $status, bool $countsTurnover) : TaxRuleRow
Parameters
- $row : int
- $status : SellerVatStatus
- $countsTurnover : bool
Return values
TaxRuleRowbuildNoteKey()
`tax.note.<CODE>`; the non-payer code differs by seller status (`.identified` / `.non_payer`).
private
buildNoteKey(TaxTreatmentCode $code[, SellerVatStatus|null $status = null ]) : string
Parameters
- $code : TaxTreatmentCode
- $status : SellerVatStatus|null = null
Return values
stringbuildOutsideScope()
private
buildOutsideScope(int $row, bool $countsTurnover) : TaxRuleRow
Parameters
- $row : int
- $countsTurnover : bool
Return values
TaxRuleRowbuildReverseCharge()
private
buildReverseCharge(int $row, array<int, TaxFlag> $flags) : TaxRuleRow
Parameters
- $row : int
- $flags : array<int, TaxFlag>
Return values
TaxRuleRowdecideNotPayer()
private
decideNotPayer(SellerVatStatus $status, CustomerClass $customerClass, SupplyNature $nature, bool $thresholdExceeded, bool $placeDomestic) : TaxRuleRow
Parameters
- $status : SellerVatStatus
- $customerClass : CustomerClass
- $nature : SupplyNature
- $thresholdExceeded : bool
- $placeDomestic : bool
Return values
TaxRuleRowdecidePayer()
private
decidePayer(CustomerClass $customerClass, SupplyNature $nature, bool $thresholdExceeded, bool $placeDomestic) : TaxRuleRow
Parameters
- $customerClass : CustomerClass
- $nature : SupplyNature
- $thresholdExceeded : bool
- $placeDomestic : bool