Zum Inhalt springen

API reference / Quittio \ Core \ Formats

DefaultFormatResolver

final class in quittio/core · implements FormatResolver

Quittio\Core\Formats\DefaultFormatResolver · Source

Format resolution in this order:

  1. explicit choice (handled by the caller),
  2. known Peppol participant of the buyer (optional lookup),
  3. domestic invoice: rules of the seller's country pack,
  4. 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,
  5. outside the EU VAT territory or to consumers: PDF,
  6. 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#

ConstantValueDescription
EU_COUNTRIES\Quittio\Core\Countries\VatTerritory::EU_MEMBER_STATES

Methods#

MethodDescription
->__construct()
->resolve()

__construct()#

public function __construct(
    string $defaultProfile = 'en16931',
    bool $autoUpgradeProfile = true,
    (Closure(BuyerParty): bool)|null $peppolLookup = null,
)
ParameterTypeDescription
$defaultProfilestring = 'en16931'
$autoUpgradeProfilebool = true
$peppolLookup(Closure(BuyerParty): bool)|null = nullreturns true if the buyer is reachable via Peppol

resolve()#

public function resolve(InvoiceData $invoice, ResolvedCountries $countries): FormatChoice
ParameterTypeDescription
$invoiceInvoiceData
$countriesResolvedCountries
Returns
FormatChoice

Die Open-Core-Pakete stehen unter der MIT-Lizenz. Die rechtlichen Formulierungen der Länderpakete sind mit einer Steuerberatung abzustimmen.