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#
| Property | Type | Description |
|---|---|---|
$data protected readonly | InvoiceData | |
$macros protected static | array<string, callable> | |
$quittio protected readonly | Quittio |
Methods#
| Method | Description |
|---|---|
->__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)| Parameter | Type | Description |
|---|---|---|
$quittio | Quittio | |
$data | InvoiceData |
__call()#
public function __call(string $method, array<mixed> $parameters): mixed| Parameter | Type | Description |
|---|---|---|
$method | string | |
$parameters | array<mixed> |
- Returns
mixed
check()#
public function check(): ValidationResultValidates 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): staticLeading country pack of this call (ISO 3166-1 alpha-2), instead of the seller's country.
| Parameter | Type | Description |
|---|---|---|
$country | string |
- Returns
static
data()#
public function data(): InvoiceDataThe invoice data of this call, as passed (not calculated).
- Returns
InvoiceData
flushMacros()#
public static function flushMacros(): voidformat()#
public function format(string $format): staticOutput format of this call, e.g. "zugferd", "xrechnung-cii", "pdf"; replaces earlier formats.
| Parameter | Type | Description |
|---|---|---|
$format | string |
- Returns
static
formats()#
public function formats(list<string> $formats): staticSeveral formats from one calculation, e.g. ['zugferd', 'xrechnung-cii'].
| Parameter | Type | Description |
|---|---|---|
$formats | list<string> |
- Returns
static
hasMacro()#
public static function hasMacro(string $name): bool| Parameter | Type | Description |
|---|---|---|
$name | string |
- Returns
bool
locale()#
public function locale(string $locale): staticLocale of this call; wins over the invoice locale and the configuration.
| Parameter | Type | Description |
|---|---|---|
$locale | string |
- Returns
static
macro()#
public static function macro(string $name, callable $macro): void| Parameter | Type | Description |
|---|---|---|
$name | string | |
$macro | callable |
option()#
public function option(string $key, mixed $value): staticOutput option of this call, e.g. option('fold_marks', false); see the output configuration.
| Parameter | Type | Description |
|---|---|---|
$key | string | |
$value | mixed |
- Returns
static
options()#
public function options(): RenderOptionsThe options collected so far, as passed to the render run.
- Returns
RenderOptions
prepare()#
public function prepare(): PreparedInvoiceCalculates and validates without rendering, whatever the validation mode; see {@see PreparedInvoice} and {@see Quittio::prepare()}.
- Returns
PreparedInvoice
presentation()#
public function presentation(Presentation $presentation): staticPresentation defaults (design, texts) for this call; the invoice's own values win.
| Parameter | Type | Description |
|---|---|---|
$presentation | Presentation |
- Returns
static
profile()#
public function profile(Profile|string $profile): staticProfile 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.
| Parameter | Type | Description |
|---|---|---|
$profile | Profile|string |
- Returns
static
render()#
public function render(): RenderedInvoiceRenders 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): staticTemplate of this call (a shipped or a configured template); wins over the invoice presentation and the configuration.
| Parameter | Type | Description |
|---|---|---|
$template | string |
- Returns
static
validate()#
public function validate(bool $throwOnError = true): staticSwitches validation on (errors throw) or to warnings only.
| Parameter | Type | Description |
|---|---|---|
$throwOnError | bool = true |
- Returns
static
withoutValidation()#
public function withoutValidation(): staticValidation mode "off" for this call: nothing is validated, no ValidationException.
- Returns
static