QuittioManager
in package
uses
Macroable
Root of the Quittio facade: builds the core from the Laravel configuration, adds events, Blade templates, storage and extension points.
Table of Contents
Constants
- EXTENSION_TYPES : array<string|int, mixed> = \Quittio\Laravel\Support\DriverRegistry::TYPES
Properties
- $app : Container
Methods
- __construct() : mixed
- accountStatement() : RenderableDocumentBuilder
- A new account statement with the seller and its defaults.
- cancellation() : InvoiceBuilder
- Builder for the cancellation of an issued invoice; render it like any invoice: Quittio::make(Quittio::cancellation($original, 'ST-2026-0001', 'Doppelt berechnet'))->render().
- check() : ValidationResult
- Validates like a render run, without template and PDF, and returns the result; see Quittio\Core\Quittio::check().
- core() : Quittio
- The core built from the current configuration; it is kept until the quittio configuration changes (config()->set(), another tenant), flush(), extend() or registerCountry().
- coreWithLevels() : Quittio
- A new core (not the cached one) that validates with the configured levels plus $levels, every driver with its settings of validation.drivers.* exactly as in a render run; e.g. quittio:validate --kosit --verapdf.
- countries() : CountryRegistry
- The country packs of the core.
- defaultVat() : TaxPreset|null
- VAT of invoice lines without VAT treatment (InvoiceBuilder::useDefaultVat()): the preset of quittio.defaults.vat, otherwise the standard preset of the seller's country pack; invoices of small businesses use the small business preset of the pack.
- deliveryNote() : RenderableDocumentBuilder
- A new delivery note with the seller and its defaults.
- document() : PendingDocument
- Starts the render call of a document; a builder is built at once.
- edit() : RenderableInvoiceBuilder
- Builder that continues existing invoice data (a draft, an invoice read from XML); the declared amounts are compared with the configured calculator (calculation.*).
- extend() : static
- Registers a driver: renderer, validator, serializer or format_resolver, or a rule that replaces the PHP rule with the code $name. The factory receives the container and the driver's configuration.
- flush() : static
- Forgets the built core. Not needed after configuration changes: core() builds a new one when the quittio configuration differs from the one the core was built from.
- formats() : FormatRegistry
- The output formats of the core.
- invoice() : RenderableInvoiceBuilder
- A new invoice with the seller and its defaults (config/quittio.php, or the current issuer of quittio/managed); ends with ->render() or ->build().
- make() : PendingInvoice
- Starts a render call: format(), profile(), locale() … and render() or queue(). A builder is built and a model converted (ProvidesInvoiceData) at once.
- orderConfirmation() : RenderableDocumentBuilder
- A new order confirmation with the seller and its defaults.
- paymentReminder() : RenderableDocumentBuilder
- prepare() : PreparedInvoice
- Calculates and validates without rendering, whatever the validation mode; see Quittio\Core\Quittio::prepare().
- profiles() : ProfileRegistry
- The profiles of the core, those of the country packs included.
- proforma() : RenderableDocumentBuilder
- A new proforma invoice with the seller and its defaults.
- queueDocument() : RenderDocument
- Dispatches a queued render job of a document; PendingDocument::queue()->save() calls it, the fake records the job as well.
- queueInvoice() : RenderInvoice
- Dispatches a queued render job; PendingInvoice::queue()->save() calls it, the fake records the job as well.
- quote() : RenderableDocumentBuilder
- A new quote with the seller and its defaults (config/quittio.php or the current issuer).
- read() : ReadResult
- Reads an incoming XML or PDF e-invoice from its content (bytes), never from a path.
- readFile() : ReadResult
- Reads an incoming XML or PDF e-invoice from a file.
- registerCountry() : static
- Registers a country pack; it wins over discovered and configured packs with the same code. The next call builds the core again (the default country depends on the packs).
- renderDocument() : RenderedDocument
- The render run behind PendingDocument::render(), with the events DocumentRendering and DocumentRendered.
- renderInvoice() : RenderedInvoice
- The render run behind PendingInvoice::render(), with the events InvoiceRendering, InvoiceValidated (not in the mode "off") or InvoiceValidationFailed, and InvoiceRendered.
- settings() : Settings
- Typed read access to config('quittio').
- validateFile() : ValidationResult
- Reads and validates an incoming e-invoice (content, never a path) with all configured levels.
- validatePath() : ValidationResult
- Reads and validates an incoming e-invoice from a file with all configured levels.
- build() : Quittio
- container() : Container
- The application the manager works in. Under Laravel Octane that is the application of the current request (Container::getInstance()), not the one that created the singleton, so that configuration set for the request applies.
- run() : RenderedInvoice
- The render run behind renderInvoice(), without the events; the fake replaces it.
- runDocument() : RenderedDocument
- The render run behind renderDocument(), without the events; the fake replaces it.
Constants
EXTENSION_TYPES
public
array<string|int, mixed>
EXTENSION_TYPES
= \Quittio\Laravel\Support\DriverRegistry::TYPES
Properties
$app read-only
protected
Container
$app
Methods
__construct()
public
__construct(Container $app) : mixed
Parameters
- $app : Container
accountStatement()
A new account statement with the seller and its defaults.
public
accountStatement() : RenderableDocumentBuilder
Return values
RenderableDocumentBuildercancellation()
Builder for the cancellation of an issued invoice; render it like any invoice: Quittio::make(Quittio::cancellation($original, 'ST-2026-0001', 'Doppelt berechnet'))->render().
public
cancellation(InvoiceData $original, string $number[, string|null $reason = null ][, string|null $strategy = null ][, Date|null $issueDate = null ][, array<int, BigDecimal|int|string, amount?: string}>|null $lines = null ][, CancellationHistory|null $history = null ][, string|null $title = null ]) : InvoiceBuilder
Parameters
- $original : InvoiceData
- $number : string
- $reason : string|null = null
- $strategy : string|null = null
- $issueDate : Date|null = null
- $lines : array<int, BigDecimal|int|string, amount?: string}>|null = null
-
partial cancellation; null = full
- $history : CancellationHistory|null = null
-
earlier partial cancellations, for the cumulative rounding of the VAT
- $title : string|null = null
-
document title in the PDF, e.g. "Stornorechnung"; null = the title of the country pack's correction policy
Return values
InvoiceBuildercheck()
Validates like a render run, without template and PDF, and returns the result; see Quittio\Core\Quittio::check().
public
check(InvoiceData $invoice, RenderOptions $options) : ValidationResult
Parameters
- $invoice : InvoiceData
- $options : RenderOptions
Tags
Return values
ValidationResultcore()
The core built from the current configuration; it is kept until the quittio configuration changes (config()->set(), another tenant), flush(), extend() or registerCountry().
public
core() : Quittio
Return values
QuittiocoreWithLevels()
A new core (not the cached one) that validates with the configured levels plus $levels, every driver with its settings of validation.drivers.* exactly as in a render run; e.g. quittio:validate --kosit --verapdf.
public
coreWithLevels(array<int, string> $levels) : Quittio
Parameters
- $levels : array<int, string>
-
names as in quittio.validation.levels, e.g. kosit, verapdf
Return values
Quittiocountries()
The country packs of the core.
public
countries() : CountryRegistry
Return values
CountryRegistrydefaultVat()
VAT of invoice lines without VAT treatment (InvoiceBuilder::useDefaultVat()): the preset of quittio.defaults.vat, otherwise the standard preset of the seller's country pack; invoices of small businesses use the small business preset of the pack.
public
defaultVat(string|null $sellerCountry, bool $smallBusiness) : TaxPreset|null
Parameters
- $sellerCountry : string|null
- $smallBusiness : bool
Return values
TaxPreset|nulldeliveryNote()
A new delivery note with the seller and its defaults.
public
deliveryNote() : RenderableDocumentBuilder
Return values
RenderableDocumentBuilderdocument()
Starts the render call of a document; a builder is built at once.
public
document(DocumentData|DocumentBuilder $document) : PendingDocument
Parameters
- $document : DocumentData|DocumentBuilder
Tags
Return values
PendingDocumentedit()
Builder that continues existing invoice data (a draft, an invoice read from XML); the declared amounts are compared with the configured calculator (calculation.*).
public
edit(InvoiceData $data) : RenderableInvoiceBuilder
Parameters
- $data : InvoiceData
Return values
RenderableInvoiceBuilderextend()
Registers a driver: renderer, validator, serializer or format_resolver, or a rule that replaces the PHP rule with the code $name. The factory receives the container and the driver's configuration.
public
extend(string $type, string $name, callable(Container, array<string, mixed>): object $factory) : static
Parameters
- $type : string
- $name : string
- $factory : callable(Container, array<string, mixed>): object
Return values
staticflush()
Forgets the built core. Not needed after configuration changes: core() builds a new one when the quittio configuration differs from the one the core was built from.
public
flush() : static
Return values
staticformats()
The output formats of the core.
public
formats() : FormatRegistry
Return values
FormatRegistryinvoice()
A new invoice with the seller and its defaults (config/quittio.php, or the current issuer of quittio/managed); ends with ->render() or ->build().
public
invoice() : RenderableInvoiceBuilder
Return values
RenderableInvoiceBuildermake()
Starts a render call: format(), profile(), locale() … and render() or queue(). A builder is built and a model converted (ProvidesInvoiceData) at once.
public
make(InvoiceData|ProvidesInvoiceData|InvoiceBuilder $data) : PendingInvoice
Parameters
Tags
Return values
PendingInvoiceorderConfirmation()
A new order confirmation with the seller and its defaults.
public
orderConfirmation() : RenderableDocumentBuilder
Return values
RenderableDocumentBuilderpaymentReminder()
public
paymentReminder([int $level = 0 ]) : RenderableDocumentBuilder
Parameters
- $level : int = 0
-
0 = payment reminder, 1 = first reminder, 2 = second reminder …
Return values
RenderableDocumentBuilderprepare()
Calculates and validates without rendering, whatever the validation mode; see Quittio\Core\Quittio::prepare().
public
prepare(InvoiceData $invoice, RenderOptions $options) : PreparedInvoice
Parameters
- $invoice : InvoiceData
- $options : RenderOptions
Tags
Return values
PreparedInvoiceprofiles()
The profiles of the core, those of the country packs included.
public
profiles() : ProfileRegistry
Return values
ProfileRegistryproforma()
A new proforma invoice with the seller and its defaults.
public
proforma() : RenderableDocumentBuilder
Return values
RenderableDocumentBuilderqueueDocument()
Dispatches a queued render job of a document; PendingDocument::queue()->save() calls it, the fake records the job as well.
public
queueDocument(RenderDocument $job) : RenderDocument
Parameters
- $job : RenderDocument
Return values
RenderDocumentqueueInvoice()
Dispatches a queued render job; PendingInvoice::queue()->save() calls it, the fake records the job as well.
public
queueInvoice(RenderInvoice $job) : RenderInvoice
Parameters
- $job : RenderInvoice
Return values
RenderInvoicequote()
A new quote with the seller and its defaults (config/quittio.php or the current issuer).
public
quote() : RenderableDocumentBuilder
Return values
RenderableDocumentBuilderread()
Reads an incoming XML or PDF e-invoice from its content (bytes), never from a path.
public
read(string $content) : ReadResult
Parameters
- $content : string
Tags
Return values
ReadResultreadFile()
Reads an incoming XML or PDF e-invoice from a file.
public
readFile(string $path) : ReadResult
Parameters
- $path : string
Tags
Return values
ReadResultregisterCountry()
Registers a country pack; it wins over discovered and configured packs with the same code. The next call builds the core again (the default country depends on the packs).
public
registerCountry(CountryPack $pack) : static
Parameters
- $pack : CountryPack
Return values
staticrenderDocument()
The render run behind PendingDocument::render(), with the events DocumentRendering and DocumentRendered.
public
renderDocument(DocumentData $document, RenderOptions $options) : RenderedDocument
Parameters
- $document : DocumentData
- $options : RenderOptions
Return values
RenderedDocumentrenderInvoice()
The render run behind PendingInvoice::render(), with the events InvoiceRendering, InvoiceValidated (not in the mode "off") or InvoiceValidationFailed, and InvoiceRendered.
public
renderInvoice(InvoiceData $invoice, RenderOptions $options) : RenderedInvoice
Parameters
- $invoice : InvoiceData
- $options : RenderOptions
Tags
Return values
RenderedInvoicesettings()
Typed read access to config('quittio').
public
settings() : Settings
Return values
SettingsvalidateFile()
Reads and validates an incoming e-invoice (content, never a path) with all configured levels.
public
validateFile(string $content) : ValidationResult
Parameters
- $content : string
Tags
Return values
ValidationResultvalidatePath()
Reads and validates an incoming e-invoice from a file with all configured levels.
public
validatePath(string $path) : ValidationResult
Parameters
- $path : string
Tags
Return values
ValidationResultbuild()
protected
build([array<int, string>|null $levels = null ]) : Quittio
Parameters
- $levels : array<int, string>|null = null
-
validation levels instead of quittio.validation.levels
Return values
Quittiocontainer()
The application the manager works in. Under Laravel Octane that is the application of the current request (Container::getInstance()), not the one that created the singleton, so that configuration set for the request applies.
protected
container() : Container
Return values
Containerrun()
The render run behind renderInvoice(), without the events; the fake replaces it.
protected
run(InvoiceData $invoice, RenderOptions $options) : RenderedInvoice
Parameters
- $invoice : InvoiceData
- $options : RenderOptions
Return values
RenderedInvoicerunDocument()
The render run behind renderDocument(), without the events; the fake replaces it.
protected
runDocument(DocumentData $document, RenderOptions $options) : RenderedDocument
Parameters
- $document : DocumentData
- $options : RenderOptions