Skip to content

API reference / Quittio \ Core \ Builder \ Concerns

BuildsPresentationAndMeta

trait in quittio/core

Quittio\Core\Builder\Concerns\BuildsPresentationAndMeta · Source

Presentation, locale, time zone, custom values, flags and the source of the invoice.

Part of InvoiceBuilder, which holds the state; use the builder, not the trait.

Methods#

MethodDescription
->custom()Free data for templates (view model key meta.custom); the same key replaces the value.
->flag()Sets a flag that country packs evaluate (e.g. a small amount invoice in Germany).
->locale()Language of the invoice: labels, generated texts and the exemption texts of presets. The locale of a render call wins; without both, the configured locale or the country default.
->presentation()Design of this invoice in PDF and HTML: a Presentation replaces it, an array changes single values (->presentation(['introText' => 'Thank you for your order.', 'showGrossPrices' => true])), a callable receives the current Presentation and returns the new one.
->source()Origin of the data, e.g. "shop" (view model key meta.source).
->timezone()Time zone for DateTimeInterface values and for the default issue date; call it before the date setters.

custom()#

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

Free data for templates (view model key meta.custom); the same key replaces the value.

ParameterTypeDescription
$keystring
$valuemixed
Returns
static

flag()#

public function flag(string $flag, bool $enabled = true): static

Sets a flag that country packs evaluate (e.g. a small amount invoice in Germany).

ParameterTypeDescription
$flagstring
$enabledbool = true
Returns
static

locale()#

public function locale(string $locale): static

Language of the invoice: labels, generated texts and the exemption texts of presets. The locale of a render call wins; without both, the configured locale or the country default.

ParameterTypeDescription
$localestring
Returns
static

presentation()#

public function presentation(Presentation|array|callable $presentation): static

Design of this invoice in PDF and HTML: a Presentation replaces it, an array changes single values (->presentation(['introText' => 'Thank you for your order.', 'showGrossPrices' => true])), a callable receives the current Presentation and returns the new one.

ParameterTypeDescription
$presentationPresentation|array|callable
Returns
static

source()#

public function source(string $source): static

Origin of the data, e.g. "shop" (view model key meta.source).

ParameterTypeDescription
$sourcestring
Returns
static

timezone()#

public function timezone(string $timezone): static

Time zone for DateTimeInterface values and for the default issue date; call it before the date setters.

ParameterTypeDescription
$timezonestring
Returns
static

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