API reference / Quittio \ Core \ Countries
CountryPack
interface in quittio/core
Quittio\Core\Countries\CountryPack · Source
Everything that differs between countries.
A country pack may only add or tighten rules; it never relaxes EN 16931 rules.
Methods#
| Method | Description |
|---|---|
->addressFormatter() | Formats postal addresses by the conventions of the country, e.g. for the address window. |
->buyerCountryRules() | Rules applied when the pack's country is the buyer's country of a cross-border invoice. |
->code() | ISO 3166-1 alpha-2 code, e.g. "DE". |
->correctionPolicy() | Cancellation and correction strategies and titles; see CorrectionPolicy for who uses what. |
->defaults() | Defaults of the country: locale, paper, letter layout, payment QR code and default VAT presets, plus informational values (currency, time zone, profile); see CountryDefaults. |
->dunningLaw() | Statutory late payment rules. Informational metadata for applications, e.g. to compute fees and default interest for DocumentBuilder::fee() and interest(); the core does not apply them. |
->exporters() | Export formats the pack declares (e.g. DATEV). Informational metadata for applications; Quittio runs no exporter. |
->formatRules() | Format choice for domestic invoices. |
->legalTexts() | Legal and informational texts of the country by key and locale. Informational metadata for applications and the pack's own presets and rules; the core adds none of them to an invoice by itself. |
->letterLayouts() | Letter layouts by name (e.g. din5008a, din5008b); CountryDefaults::$letterLayout selects the default. |
->mandatoryOutput() | Values that the PDF of $invoice must show by law; the mandatory field guard checks that the template printed them. |
->numberingRules() | Numbering requirements; the Managed layer applies pattern and resets (see NumberingRules). |
->paymentQr() | Payment QR code generator of the country, used for the type "auto" unless CountryDefaults::$paymentQr is "none" (an application's generator registered with Quittio::setPaymentQrGenerator() comes first); null = the EPC GiroCode for "girocode". |
->profiles() | National profiles, e.g. XRechnung. |
->readers() | Readers for national formats. Quittio::read() and validateFile() try them after the CII and UBL readers, for every registered pack; return new instances on every call (readers keep the state of one document). |
->retention() | Retention period of issued invoices; the Managed layer stores the end of it. |
->rules() | Additional validation rules (L3) applied when the pack is the leading pack. |
->taxPresets() | Tax presets of the country by key (e.g. "de.small_business"). Informational metadata for applications, e.g. to offer them in a form or to resolve a stored LineVat::$presetKey; the core does not apply it: lines take a preset with LineBuilder::vat(). |
->translationPath() | Directory with translation files ({locale}/{group}.php) of the pack, if any. |
addressFormatter()#
public function addressFormatter(): AddressFormatterFormats postal addresses by the conventions of the country, e.g. for the address window.
- Returns
AddressFormatter
buyerCountryRules()#
public function buyerCountryRules(): list<Rule>Rules applied when the pack's country is the buyer's country of a cross-border invoice.
- Returns
list<Rule>
code()#
public function code(): stringISO 3166-1 alpha-2 code, e.g. "DE".
- Returns
string
correctionPolicy()#
public function correctionPolicy(): CorrectionPolicyCancellation and correction strategies and titles; see CorrectionPolicy for who uses what.
- Returns
CorrectionPolicy
defaults()#
public function defaults(): CountryDefaultsDefaults of the country: locale, paper, letter layout, payment QR code and default VAT presets, plus informational values (currency, time zone, profile); see CountryDefaults.
- Returns
CountryDefaults
dunningLaw()#
public function dunningLaw(): DunningLawStatutory late payment rules. Informational metadata for applications, e.g. to compute fees and default interest for DocumentBuilder::fee() and interest(); the core does not apply them.
- Returns
DunningLaw
exporters()#
public function exporters(): list<Exporter>Export formats the pack declares (e.g. DATEV). Informational metadata for applications; Quittio runs no exporter.
- Returns
list<Exporter>
formatRules()#
public function formatRules(): list<FormatRule>Format choice for domestic invoices.
- Returns
list<FormatRule>
legalTexts()#
public function legalTexts(): LegalTextCatalogLegal and informational texts of the country by key and locale. Informational metadata for applications and the pack's own presets and rules; the core adds none of them to an invoice by itself.
- Returns
LegalTextCatalog
letterLayouts()#
public function letterLayouts(): array<string, LetterLayout>Letter layouts by name (e.g. din5008a, din5008b); CountryDefaults::$letterLayout selects the default.
- Returns
array<string, LetterLayout>
mandatoryOutput()#
public function mandatoryOutput(InvoiceData $invoice): MandatoryFieldListValues that the PDF of $invoice must show by law; the mandatory field guard checks that the template printed them.
| Parameter | Type | Description |
|---|---|---|
$invoice | InvoiceData |
- Returns
MandatoryFieldList
numberingRules()#
public function numberingRules(): NumberingRulesNumbering requirements; the Managed layer applies pattern and resets (see NumberingRules).
- Returns
NumberingRules
paymentQr()#
public function paymentQr(): ?PaymentQrGeneratorPayment QR code generator of the country, used for the type "auto" unless CountryDefaults::$paymentQr is "none" (an application's generator registered with Quittio::setPaymentQrGenerator() comes first); null = the EPC GiroCode for "girocode".
- Returns
?PaymentQrGenerator
profiles()#
public function profiles(): list<Profile>National profiles, e.g. XRechnung.
- Returns
list<Profile>
readers()#
public function readers(): list<FormatReader>Readers for national formats. Quittio::read() and validateFile() try them after the CII and UBL readers, for every registered pack; return new instances on every call (readers keep the state of one document).
- Returns
list<FormatReader>
retention()#
public function retention(): RetentionRuleRetention period of issued invoices; the Managed layer stores the end of it.
- Returns
RetentionRule
rules()#
public function rules(): list<Rule>Additional validation rules (L3) applied when the pack is the leading pack.
- Returns
list<Rule>
taxPresets()#
public function taxPresets(): TaxPresetCollectionTax presets of the country by key (e.g. "de.small_business"). Informational metadata for applications, e.g. to offer them in a form or to resolve a stored LineVat::$presetKey; the core does not apply it: lines take a preset with LineBuilder::vat().
- Returns
TaxPresetCollection
translationPath()#
public function translationPath(): ?stringDirectory with translation files ({locale}/{group}.php) of the pack, if any.
- Returns
?string