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#
| Property | Type | Description |
|---|---|---|
$data protected readonly | InvoiceData | |
$manager protected readonly | QuittioManager |
Methods#
| Method | Description |
|---|---|
->__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)| Parameter | Type | Description |
|---|---|---|
$manager | QuittioManager | |
$data | InvoiceData |
check()#
public function check(): ValidationResultValidates 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): 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
format()#
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): static| Parameter | Type | Description |
|---|---|---|
$formats | list<string> |
- Returns
static
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
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 validation.mode or withoutValidation() say; see {@see PreparedInvoice}.
- 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
queue()#
public function queue(?string $connection = null, ?string $queue = null): QueuedInvoiceRenders in a queued job: Quittio::make($order)->queue()->save('invoices', $path).
| Parameter | Type | Description |
|---|---|---|
$connection | ?string = null | |
$queue | ?string = null |
- Returns
QueuedInvoice
render()#
public function render(): RenderedInvoiceRenders 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): 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