API reference / Quittio \ Core \ Xml
PaymentTermsText
final class in quittio/core
Quittio\Core\Xml\PaymentTermsText · Source
Builds the payment terms text (BT-20) from structured payment terms.
Cash discounts are a mandatory statement (agreed reduction of the consideration), so they must appear in the XML and not only in the PDF.
Methods#
| Method | Description |
|---|---|
::parse() | Parses structured cash discount lines from a BT-20 text. |
::render() | |
::structured() | XRechnung notation: #SKONTO#TAGE=14#PROZENT=2.00# with optional #BASISBETRAG=…#. The percentage has exactly two decimals (BR-DE-18). |
parse()#
public static function parse(
?string $text,
): array{text: ?string, discounts: list<array{days: int, percent: string, base: ?string}>}Parses structured cash discount lines from a BT-20 text.
| Parameter | Type | Description |
|---|---|---|
$text | ?string |
- Returns
array{text: ?string, discounts: list<array{days: int, percent: string, base: ?string}>}
render()#
public static function render(
InvoiceData $invoice,
Profile $profile,
string $locale,
): ?string| Parameter | Type | Description |
|---|---|---|
$invoice | InvoiceData | |
$profile | Profile | |
$locale | string |
- Returns
?string
structured()#
public static function structured(CashDiscount $discount): stringXRechnung notation: #SKONTO#TAGE=14#PROZENT=2.00# with optional #BASISBETRAG=…#. The percentage has exactly two decimals (BR-DE-18).
| Parameter | Type | Description |
|---|---|---|
$discount | CashDiscount |
- Returns
string