Quittio 0.3 API

PendingInvoice
in package
uses Macroable

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

Table of Contents

Properties

$data  : InvoiceData
$macros  : array<string, callable>
$quittio  : Quittio

Methods

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

Properties

$macros

protected static array<string, callable> $macros = []

Methods

__call()

public __call(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
$method : string
$parameters : array<string|int, mixed>

country()

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

public country(string $country) : static
Parameters
$country : string
Return values
static

flushMacros()

public static flushMacros() : void

format()

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

public format(string $format) : static
Parameters
$format : string
Return values
static

formats()

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

public formats(array<int, string> $formats) : static
Parameters
$formats : array<int, string>
Return values
static

hasMacro()

public static hasMacro(string $name) : bool
Parameters
$name : string
Return values
bool

locale()

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

public locale(string $locale) : static
Parameters
$locale : string
Return values
static

macro()

public static macro(string $name, callable $macro) : void
Parameters
$name : string
$macro : callable
Tags
param-closure-this

static $macro

option()

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

public option(string $key, mixed $value) : static
Parameters
$key : string
$value : mixed
Return values
static

presentation()

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

public presentation(Presentation $presentation) : static
Parameters
$presentation : Presentation
Return values
static

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.

public profile(Profile|string $profile) : static
Parameters
$profile : Profile|string
Return values
static

render()

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

public render() : RenderedInvoice
Tags
throws
ValidationException

when validation finds errors in the mode "error"

ConfigurationException

for an unknown format, a profile the format does not support or a watermark with e-invoice XML

MandatoryFieldMissing

when the template omits mandatory values in the guard mode "exception"

CalculationException

when the data cannot be calculated

PdfException

when the PDF cannot be rendered

Return values
RenderedInvoice

template()

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

public template(string $template) : static
Parameters
$template : string
Return values
static

validate()

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

public validate([bool $throwOnError = true ]) : static
Parameters
$throwOnError : bool = true
Return values
static

withoutValidation()

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

public withoutValidation() : static
Return values
static
On this page

Search results