Quittio 0.3 API

BuildsHeader

Invoice number, dates, type, currencies, business process and standard version.

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

Table of Contents

Methods

businessProcess()  : static
Business process identifier (BT-23); Peppol and XRechnung write their process when it is not set. null removes it.
currency()  : static
Invoice currency (BT-5), ISO 4217; stored in upper case. Default EUR.
dueDate()  : static
Due date (BT-9). Without it the calculator derives it from dueInDays(); otherwise the configured due_days apply when rendering, never for credit notes.
exchangeRate()  : static
Exchange rate from the invoice currency to the VAT accounting currency (BT-6), used to calculate the VAT total in that currency (BT-111), with the date of the rate. Replaces a rate implied by declared amounts (see from()).
issueDate()  : static
Issue date (BT-2); default today. A DateTimeInterface is converted in the time zone of timezone(), so call timezone() first.
number()  : static
Invoice number (BT-1). Not checked here; the validation requires it.
standard()  : static
Version of EN 16931 (BT-24 of the profile): 2017 (default) or 2026, which only the profile EN 16931 supports.
taxCurrency()  : static
VAT accounting currency (BT-6). With an exchange rate, BT-111 is calculated.
taxPointDate()  : static
Date when VAT becomes chargeable (BT-7), if it differs from the issue date. EN 16931 allows BT-7 or BT-8, not both (BR-CO-03).
taxPointDateCode()  : static
Code of the date when VAT becomes chargeable (BT-8): issue, delivery or payment date.
type()  : static
Type code (BT-3) from UNTDID 1001, e.g. 381 for a credit note; default 380. Unknown codes are kept as RawCode and reported by the validation.

Methods

businessProcess()

Business process identifier (BT-23); Peppol and XRechnung write their process when it is not set. null removes it.

public businessProcess(string|null $process) : static
Parameters
$process : string|null
Return values
static

currency()

Invoice currency (BT-5), ISO 4217; stored in upper case. Default EUR.

public currency(string $currency) : static
Parameters
$currency : string
Return values
static

dueDate()

Due date (BT-9). Without it the calculator derives it from dueInDays(); otherwise the configured due_days apply when rendering, never for credit notes.

public dueDate(Date|DateTimeInterface|string $date) : static
Parameters
$date : Date|DateTimeInterface|string
Return values
static

exchangeRate()

Exchange rate from the invoice currency to the VAT accounting currency (BT-6), used to calculate the VAT total in that currency (BT-111), with the date of the rate. Replaces a rate implied by declared amounts (see from()).

public exchangeRate(BigDecimal|int|float|string $rate[, Date|DateTimeInterface|string|null $date = null ]) : static
Parameters
$rate : BigDecimal|int|float|string
$date : Date|DateTimeInterface|string|null = null
Tags
throws
InvalidArgumentException

for a float

Return values
static

issueDate()

Issue date (BT-2); default today. A DateTimeInterface is converted in the time zone of timezone(), so call timezone() first.

public issueDate(Date|DateTimeInterface|string $date) : static
Parameters
$date : Date|DateTimeInterface|string
Return values
static

number()

Invoice number (BT-1). Not checked here; the validation requires it.

public number(string $number) : static
Parameters
$number : string
Return values
static

standard()

Version of EN 16931 (BT-24 of the profile): 2017 (default) or 2026, which only the profile EN 16931 supports.

public standard(StandardVersion $version) : static
Parameters
$version : StandardVersion
Return values
static

taxCurrency()

VAT accounting currency (BT-6). With an exchange rate, BT-111 is calculated.

public taxCurrency(string $currency[, BigDecimal|int|float|string|null $exchangeRate = null ][, Date|DateTimeInterface|string|null $rateDate = null ]) : static
Parameters
$currency : string
$exchangeRate : BigDecimal|int|float|string|null = null
$rateDate : Date|DateTimeInterface|string|null = null
Return values
static

taxPointDate()

Date when VAT becomes chargeable (BT-7), if it differs from the issue date. EN 16931 allows BT-7 or BT-8, not both (BR-CO-03).

public taxPointDate(Date|DateTimeInterface|string $date) : static
Parameters
$date : Date|DateTimeInterface|string
Return values
static

taxPointDateCode()

Code of the date when VAT becomes chargeable (BT-8): issue, delivery or payment date.

public taxPointDateCode(TaxPointDateCode $code) : static

EN 16931 allows BT-7 or BT-8, not both (BR-CO-03).

Parameters
$code : TaxPointDateCode
Return values
static

type()

Type code (BT-3) from UNTDID 1001, e.g. 381 for a credit note; default 380. Unknown codes are kept as RawCode and reported by the validation.

public type(InvoiceTypeCode|RawCode|string $type) : static
Parameters
$type : InvoiceTypeCode|RawCode|string
Return values
static
On this page

Search results