DefaultFormatResolver
in package
implements
FormatResolver
FinalYes
Format resolution in this order:
- explicit choice (handled by the caller),
- known Peppol participant of the buyer (optional lookup),
- domestic invoice: rules of the seller's country pack,
- cross-border to a business: rules of the buyer's country pack (also for sellers outside the EU, e.g. XRechnung for German public buyers), otherwise ZUGFeRD EN 16931 within the EU VAT territory,
- outside the EU VAT territory or to consumers: PDF,
- EXTENDED features used: profile EXTENDED (or an error without auto upgrade).
"Domestic" and "EU" refer to the VAT territory (see VatTerritory): Monaco counts as France, Northern Ireland as part of the EU, Büsingen and Heligoland are outside of it.
Table of Contents
Interfaces
- FormatResolver
- Chooses format and profile when none is given.
Constants
- EU_COUNTRIES : array<string|int, mixed> = \Quittio\Core\Countries\VatTerritory::EU_MEMBER...
Methods
- __construct() : mixed
- resolve() : FormatChoice
Constants
EU_COUNTRIES
use VatTerritory::EU_MEMBER_STATES
public
array<string|int, mixed>
EU_COUNTRIES
= \Quittio\Core\Countries\VatTerritory::EU_MEMBER_STATES
Methods
__construct()
public
__construct([string $defaultProfile = 'en16931' ][, bool $autoUpgradeProfile = true ][, callable(BuyerParty): bool|null $peppolLookup = null ]) : mixed
Parameters
- $defaultProfile : string = 'en16931'
- $autoUpgradeProfile : bool = true
- $peppolLookup : callable(BuyerParty): bool|null = null
-
returns true if the buyer is reachable via Peppol
resolve()
public
resolve(InvoiceData $invoice, ResolvedCountries $countries) : FormatChoice
Parameters
- $invoice : InvoiceData
- $countries : ResolvedCountries