Skip to content

API reference / Quittio \ Core \ Rendering

PendingInvoice

class in quittio/core · uses Macroable

Quittio\Core\Rendering\PendingInvoice · Source

Fluent render call: Quittio::make($data)->profile()->format()->locale()->render().

Properties#

PropertyTypeDescription
$data protected readonlyInvoiceData
$macros protected staticarray<string, callable>
$quittio protected readonlyQuittio

Methods#

MethodDescription
->__construct()
->__call()
->check()Validates without rendering a PDF (XML levels run if the format writes or embeds XML). An explicit validation request: validate() and withoutValidation() do not apply, the result is returned and never thrown; see {@see Quittio::prepare()}.
->country()Leading country pack of this call (ISO 3166-1 alpha-2), instead of the seller's country.
->data()The invoice data of this call, as passed (not calculated).
::flushMacros()
->format()Output format of this call, e.g. "zugferd", "xrechnung-cii", "pdf"; replaces earlier formats.
->formats()Several formats from one calculation, e.g. ['zugferd', 'xrechnung-cii'].
::hasMacro()
->locale()Locale of this call; wins over the invoice locale and the configuration.
::macro()
->option()Output option of this call, e.g. option('fold_marks', false); see the output configuration.
->options()The options collected so far, as passed to the render run.
->prepare()Calculates and validates without rendering, whatever the validation mode; see {@see PreparedInvoice} and {@see Quittio::prepare()}.
->presentation()Presentation defaults (design, texts) for this call; the invoice's own values win.
->profile()Profile of the XML for this call, as key, alias or Profile object, e.g. "xrechnung"; the format must support it. Wins over the configured profile.
->render()Renders the formats of this call; the result is the first format, the others are reachable with as(). See Quittio::render().
->template()Template of this call (a shipped or a configured template); wins over the invoice presentation and the configuration.
->validate()Switches validation on (errors throw) or to warnings only.
->withoutValidation()Validation mode "off" for this call: nothing is validated, no ValidationException.

__construct()#

final public function __construct(Quittio $quittio, InvoiceData $data)
ParameterTypeDescription
$quittioQuittio
$dataInvoiceData

__call()#

public function __call(string $method, array<mixed> $parameters): mixed
ParameterTypeDescription
$methodstring
$parametersarray<mixed>
Returns
mixed

check()#

public function check(): ValidationResult

Validates without rendering a PDF (XML levels run if the format writes or embeds XML). An explicit validation request: validate() and withoutValidation() do not apply, the result is returned and never thrown; see {@see Quittio::prepare()}.

Returns
ValidationResult

country()#

public function country(string $country): static

Leading country pack of this call (ISO 3166-1 alpha-2), instead of the seller's country.

ParameterTypeDescription
$countrystring
Returns
static

data()#

public function data(): InvoiceData

The invoice data of this call, as passed (not calculated).

Returns
InvoiceData

flushMacros()#

public static function flushMacros(): void

static

format()#

public function format(string $format): static

Output format of this call, e.g. "zugferd", "xrechnung-cii", "pdf"; replaces earlier formats.

ParameterTypeDescription
$formatstring
Returns
static

formats()#

public function formats(list<string> $formats): static

Several formats from one calculation, e.g. ['zugferd', 'xrechnung-cii'].

ParameterTypeDescription
$formatslist<string>
Returns
static

hasMacro()#

public static function hasMacro(string $name): bool

static

ParameterTypeDescription
$namestring
Returns
bool

locale()#

public function locale(string $locale): static

Locale of this call; wins over the invoice locale and the configuration.

ParameterTypeDescription
$localestring
Returns
static

macro()#

public static function macro(string $name, callable $macro): void

static

ParameterTypeDescription
$namestring
$macrocallable

option()#

public function option(string $key, mixed $value): static

Output option of this call, e.g. option('fold_marks', false); see the output configuration.

ParameterTypeDescription
$keystring
$valuemixed
Returns
static

options()#

public function options(): RenderOptions

The options collected so far, as passed to the render run.

Returns
RenderOptions

prepare()#

public function prepare(): PreparedInvoice

Calculates and validates without rendering, whatever the validation mode; see {@see PreparedInvoice} and {@see Quittio::prepare()}.

Returns
PreparedInvoice

presentation()#

public function presentation(Presentation $presentation): static

Presentation defaults (design, texts) for this call; the invoice's own values win.

ParameterTypeDescription
$presentationPresentation
Returns
static

profile()#

public function profile(Profile|string $profile): static

Profile of the XML for this call, as key, alias or Profile object, e.g. "xrechnung"; the format must support it. Wins over the configured profile.

ParameterTypeDescription
$profileProfile|string
Returns
static

render()#

public function render(): RenderedInvoice

Renders the formats of this call; the result is the first format, the others are reachable with as(). See Quittio::render().

Returns
RenderedInvoice
Throws
ValidationException – when validation finds errors in the mode "error"
Throws
ConfigurationException – for an unknown format, a profile the format does not support or a watermark with e-invoice XML
Throws
MandatoryFieldMissing – when the template omits mandatory values in the guard mode "exception"
Throws
CalculationException – when the data cannot be calculated
Throws
PdfException – when the PDF cannot be rendered

template()#

public function template(string $template): static

Template of this call (a shipped or a configured template); wins over the invoice presentation and the configuration.

ParameterTypeDescription
$templatestring
Returns
static

validate()#

public function validate(bool $throwOnError = true): static

Switches validation on (errors throw) or to warnings only.

ParameterTypeDescription
$throwOnErrorbool = true
Returns
static

withoutValidation()#

public function withoutValidation(): static

Validation mode "off" for this call: nothing is validated, no ValidationException.

Returns
static

The open core packages are MIT licensed. The legal wording of the country packs must be confirmed by a tax adviser.