API reference / Quittio \ Core \ Formats
DefaultFormatResolver
final class in quittio/core · implements FormatResolver
Quittio\Core\Formats\DefaultFormatResolver · Source
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.
Constants#
| Constant | Value | Description |
|---|---|---|
EU_COUNTRIES | \Quittio\Core\Countries\VatTerritory::EU_MEMBER_STATES |
Methods#
| Method | Description |
|---|---|
->__construct() | |
->resolve() |
__construct()#
public function __construct(
string $defaultProfile = 'en16931',
bool $autoUpgradeProfile = true,
(Closure(BuyerParty): bool)|null $peppolLookup = null,
)| Parameter | Type | Description |
|---|---|---|
$defaultProfile | string = 'en16931' | |
$autoUpgradeProfile | bool = true | |
$peppolLookup | (Closure(BuyerParty): bool)|null = null | returns true if the buyer is reachable via Peppol |
resolve()#
public function resolve(InvoiceData $invoice, ResolvedCountries $countries): FormatChoice| Parameter | Type | Description |
|---|---|---|
$invoice | InvoiceData | |
$countries | ResolvedCountries |
- Returns
FormatChoice