Zum Inhalt springen

API reference / Quittio \ Laravel \ Rendering

PendingInvoice

class in quittio/laravel · uses Illuminate\Support\Traits\Macroable

Quittio\Laravel\Rendering\PendingInvoice · Source

Fluent render call: Quittio::make($order)->profile('en16931')->format('zugferd')->locale('de')->render().

Properties#

PropertyTypeDescription
$data protected readonlyInvoiceData
$manager protected readonlyQuittioManager

Methods#

MethodDescription
->__construct()
->check()Validates like a render run without rendering. An explicit validation request: it validates whatever validation.mode or withoutValidation() say and never throws a ValidationException.
->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).
->format()Output format of this call, e.g. "zugferd", "xrechnung-cii", "pdf"; replaces earlier formats.
->formats()
->locale()Locale of this call; wins over the invoice locale and the configuration.
->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 validation.mode or withoutValidation() say; see {@see PreparedInvoice}.
->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.
->queue()Renders in a queued job: Quittio::make($order)->queue()->save('invoices', $path).
->render()Renders the formats of this call with the events of the run (InvoiceRendering, InvoiceValidated or InvoiceValidationFailed, InvoiceRendered); 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(QuittioManager $manager, InvoiceData $data)
ParameterTypeDescription
$managerQuittioManager
$dataInvoiceData

check()#

public function check(): ValidationResult

Validates like a render run without rendering. An explicit validation request: it validates whatever validation.mode or withoutValidation() say and never throws a ValidationException.

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

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
ParameterTypeDescription
$formatslist<string>
Returns
static

locale()#

public function locale(string $locale): static

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

ParameterTypeDescription
$localestring
Returns
static

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 validation.mode or withoutValidation() say; see {@see PreparedInvoice}.

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

queue()#

public function queue(?string $connection = null, ?string $queue = null): QueuedInvoice

Renders in a queued job: Quittio::make($order)->queue()->save('invoices', $path).

ParameterTypeDescription
$connection?string = null
$queue?string = null
Returns
QueuedInvoice

render()#

public function render(): RenderedInvoice

Renders the formats of this call with the events of the run (InvoiceRendering, InvoiceValidated or InvoiceValidationFailed, InvoiceRendered); 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

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