Quittio 0.3 API

Config
in package

Read onlyYes
FinalYes

Configuration of the core without Laravel. The Laravel package translates config/quittio.php into it (Quittio\Laravel\Support\ConfigMapper), whose layout differs from the keys of fromArray().

Table of Contents

Constants

VALIDATION_ERROR  : string = 'error'
VALIDATION_OFF  : string = 'off'
VALIDATION_WARN  : string = 'warn'

Properties

$autoUpgradeProfile  : bool
$b2cEmbedXml  : bool
$blockOnWarnings  : bool
$calculation  : CalculationPolicy
$cancellationStrategy  : string|null
$country  : string|null
$dueDays  : int|null
$filename  : string
$format  : string|null
$girocodeAmount  : string
$kosit  : array<string|int, mixed>|null
$locale  : string|null
$mandatoryFields  : string
$maxDecompressedBytes  : int
$maxPdfBytes  : int
$maxXmlBytes  : int
$options  : array<string|int, mixed>
$pdfa  : bool
$presentation  : Presentation|null
$profile  : string|null
$rules  : RuleOverrides
$tempDir  : string|null
$template  : string
$templatePaths  : array<string|int, mixed>
$validation  : string
$validationLevels  : array<string|int, mixed>
$validationLocale  : string|null
$veraPdf  : array<string|int, mixed>|null

Methods

__construct()  : mixed
fromArray()  : self
Builds the configuration from an array with the core's own, flat layout (not the layout of the Laravel config/quittio.php). Keys, all optional:
with()  : self

Constants

VALIDATION_ERROR

public string VALIDATION_ERROR = 'error'

VALIDATION_OFF

public string VALIDATION_OFF = 'off'

VALIDATION_WARN

public string VALIDATION_WARN = 'warn'

Properties

$autoUpgradeProfile

public bool $autoUpgradeProfile = true

$b2cEmbedXml

public bool $b2cEmbedXml = false

$blockOnWarnings

public bool $blockOnWarnings = false

$cancellationStrategy

public string|null $cancellationStrategy = null

$country

public string|null $country = null

$dueDays

public int|null $dueDays = null

$filename

public string $filename = '{title}_{number}.{ext}'

$format

public string|null $format = null

$girocodeAmount

public string $girocodeAmount = 'due'

$kosit

public array<string|int, mixed>|null $kosit = null

$locale

public string|null $locale = null

$mandatoryFields

public string $mandatoryFields = MandatoryFieldGuard::MODE_EXCEPTION

$maxDecompressedBytes

public int $maxDecompressedBytes = 50 * 1024 * 1024

$maxPdfBytes

public int $maxPdfBytes = 25 * 1024 * 1024

$maxXmlBytes

public int $maxXmlBytes = XmlSecurity::DEFAULT_MAX_BYTES

$options

public array<string|int, mixed> $options = []

$profile

public string|null $profile = null

$tempDir

public string|null $tempDir = null

$template

public string $template = 'default'

$templatePaths

public array<string|int, mixed> $templatePaths = []

$validation

public string $validation = self::VALIDATION_ERROR

$validationLevels

public array<string|int, mixed> $validationLevels = [ValidationLevel::L1, ValidationLevel::L2, ValidationLevel::L3, ValidationLevel::L4, ValidationLevel::L7]

$validationLocale

public string|null $validationLocale = null

$veraPdf

public array<string|int, mixed>|null $veraPdf = null

Methods

__construct()

public __construct([string|null $format = null ][, string|null $profile = null ][, string|null $locale = null ][, string|null $country = null ][, string $template = 'default' ][, array<int, string> $templatePaths = [] ][, string $filename = '{title}_{number}.{ext}' ][, bool $pdfa = true ][, bool $b2cEmbedXml = false ][, bool $autoUpgradeProfile = true ][, string $validation = self::VALIDATION_ERROR ][, array<int, ValidationLevel> $validationLevels = [ValidationLevel::L1, ValidationLevel::L2, ValidationLevel::L3, ValidationLevel::L4, ValidationLevel::L7] ][, array{mode?: string, url?: string, jar?: string|null, configurations?: list, java?: string, timeout?: int, fail_on_unavailable?: bool}|null $kosit = null ][, array{mode?: string, binary?: string, image?: string, docker?: string, timeout?: int, fail_on_unavailable?: bool}|null $veraPdf = null ][, string $mandatoryFields = MandatoryFieldGuard::MODE_EXCEPTION ][, string $girocodeAmount = 'due' ][, string|null $tempDir = null ][, array<string, mixed> $options = [] ][, Presentation|null $presentation = null ][, bool $blockOnWarnings = false ][, int $maxXmlBytes = XmlSecurity::DEFAULT_MAX_BYTES ][, int $maxPdfBytes = 25 * 1024 * 1024 ][, int $maxDecompressedBytes = 50 * 1024 * 1024 ][, int|null $dueDays = null ][, string|null $cancellationStrategy = null ][, string|null $validationLocale = null ][, RuleOverrides $rules = new RuleOverrides() ][, CalculationPolicy $calculation = new CalculationPolicy() ]) : mixed
Parameters
$format : string|null = null

default output format, null = automatic choice

$profile : string|null = null

default profile for every format that allows it; null = the profile of the format or of the automatic choice (EN 16931 for ZUGFeRD/Factur-X)

$locale : string|null = null
$country : string|null = null
$template : string = 'default'
$templatePaths : array<int, string> = []

directories for plain PHP templates

$filename : string = '{title}_{number}.{ext}'
$pdfa : bool = true
$b2cEmbedXml : bool = false
$autoUpgradeProfile : bool = true
$validation : string = self::VALIDATION_ERROR

error (throw on errors), warn (attach result only) or off

$validationLevels : array<int, ValidationLevel> = [ValidationLevel::L1, ValidationLevel::L2, ValidationLevel::L3, ValidationLevel::L4, ValidationLevel::L7]

levels run while rendering

$kosit : array{mode?: string, url?: string, jar?: string|null, configurations?: list, java?: string, timeout?: int, fail_on_unavailable?: bool}|null = null

null = disabled

$veraPdf : array{mode?: string, binary?: string, image?: string, docker?: string, timeout?: int, fail_on_unavailable?: bool}|null = null

null = disabled

$mandatoryFields : string = MandatoryFieldGuard::MODE_EXCEPTION
$girocodeAmount : string = 'due'
$tempDir : string|null = null
$options : array<string, mixed> = []

options for validation rules and the view model

$presentation : Presentation|null = null

design defaults (logo, colours, texts); the invoice's own values win

$blockOnWarnings : bool = false
$maxXmlBytes : int = XmlSecurity::DEFAULT_MAX_BYTES
$maxPdfBytes : int = 25 * 1024 * 1024
$maxDecompressedBytes : int = 50 * 1024 * 1024
$dueDays : int|null = null

due date (BT-9) = issue date + days for invoices without due date and payment terms

$cancellationStrategy : string|null = null

credit_note or negative_invoice; null = default of the country pack

$validationLocale : string|null = null

language of validation messages: null or "invoice" = the language of the invoice, "app" = the language of the application translator (Laravel: app()->getLocale()), or a locale

$rules : RuleOverrides = new RuleOverrides()

PHP rules switched off, re-rated or replaced by code

$calculation : CalculationPolicy = new CalculationPolicy()

what the calculator does with declared amounts

fromArray()

Builds the configuration from an array with the core's own, flat layout (not the layout of the Laravel config/quittio.php). Keys, all optional:

public static fromArray(array<string, mixed> $config) : self
  • format ("auto" or null = automatic choice), profile, locale, country, due_days
  • template, template_paths (directories with {name}.php), filename
  • pdf.pdfa, pdf.b2c_embed_xml, pdf.girocode_amount (due, discounted)
  • auto_upgrade_profile
  • validation.mode (error, warn, off), validation.levels (enum names L1 … L7, e.g. ['L1', 'L4']), validation.block_on_warnings, validation.rules (disabled, severity, allow_official; see RuleOverrides)
  • validation.kosit, validation.verapdf: ['enabled' => true, …] switches the driver on; the other keys are those of the $kosit and $veraPdf parameters (KoSIT scenario sets only in "configurations")
  • mandatory_fields (exception, log, off), temp_dir, options (e.g. paper, markdown, fold_marks, watermark)
  • presentation (a Presentation object)
  • reader.max_xml_bytes, reader.max_pdf_bytes, reader.max_decompressed_bytes
  • corrections.cancellation_strategy
  • calculation.declared_amounts (keep, recalculate, reject; see DeclaredAmountsMode)

The Laravel names differ, e.g. defaults.format, format_resolver.b2c_embed_xml, validation.levels php/xsd/kosit/verapdf, validation.mandatory_field_guard and pdf.cache_path.

Parameters
$config : array<string, mixed>
Return values
self

with()

public with(array<string, mixed> $changes) : self
Parameters
$changes : array<string, mixed>
Return values
self
On this page

Search results