Quittio\Core\Countries
quittio/core#
Quittio\Core\Countries
AbstractCountryPackBase class with neutral defaults, so that country packs only override what differs.CorrectionPolicyDefault handling of cancellations and corrections in a country, and the titles of these documents. Quittio::cancellation() takes the cancellation strategy and the titles "cancellation" and "cancellation_self_billed"; Quittio::correction() the title "correction", Quittio::priceReduction() the title "price_reduction"; the title "self_billed" is the title of self-billed invoices in PDF and HTML (InvoiceTitle::policyTitle()); the Managed layer takes the correction strategy.CountryDefaultsDefaults of a country.CountryGenericNeutral pack for countries without an installed country pack: EN 16931 rules only and international formatting. A warning is issued when an invoice is validated with this pack.CountryPackinterfaceEverything that differs between countries.CountryRegistryInstalled country packs.CountryResolverinterfaceSelects the country packs for an invoice.DefaultCountryResolverThe seller's country (BT-40) determines the leading pack. The buyer's country (BT-55) adds rules for cross-border invoices. A country without a pack of its own takes the pack of the country whose VAT territory it belongs to (VatTerritory::vatCountry(): Monaco the French, Liechtenstein the Swiss pack). Without an installed pack, a generic pack is used.DunningLawStatutory late payment rules (EU late payment directive plus national law). Amounts and percentage points are decimal strings.ExporterinterfaceCountry specific export format (e.g. DATEV for Germany, FEC for France). Country packs only declare which exporters they provide (CountryPack::exporters()); Quittio runs none of them, applications may.LegalTextCatalogLegal and informational texts of a country pack per locale.MandatoryFieldA value that must appear in the PDF (checked by the mandatory field guard).MandatoryFieldListValues that must be output in the PDF for one invoice.NumberingRulesRequirements for invoice numbering in a country. The Managed layer applies the default pattern, the default reset and the allowed resets.ResolvedCountriesLeading pack (seller side) and, for cross-border invoices, the buyer's pack.RetentionRuleRetention period for invoices.VatTerritoryThe EU VAT territory (Art. 5 to 7 of Directive 2006/112/EC) as far as it can be told from a country code and a postcode.
Quittio\Core\Countries\Capabilities
CompletesInvoicesinterfaceA country pack that completes an invoice before it is calculated, validated and rendered, e.g. with a notice the law of the country expects for some buyers. The render pipeline calls it for the leading pack of the invoice; what it adds is part of the rendered data.ProvidesFormatsinterfaceA country pack that brings output formats, e.g. a national e-invoice format, with their aliases and the serializers of their syntaxes. Quittio::registerCountry() registers them. AbstractCountryPack implements it with empty defaults.ProvidesReferenceRatesinterfaceA country pack whose late payment law has a reference interest rate, so that Dunning\DefaultInterest::forCountry() calculates default interest for it.