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
staticcurrency()
Invoice currency (BT-5), ISO 4217; stored in upper case. Default EUR.
public
currency(string $currency) : static
Parameters
- $currency : string
Return values
staticdueDate()
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
staticexchangeRate()
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
Return values
staticissueDate()
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
staticnumber()
Invoice number (BT-1). Not checked here; the validation requires it.
public
number(string $number) : static
Parameters
- $number : string
Return values
staticstandard()
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
statictaxCurrency()
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
statictaxPointDate()
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
statictaxPointDateCode()
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
statictype()
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