Zum Inhalt springen

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#

MethodDescription
::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}>}

static

Parses structured cash discount lines from a BT-20 text.

ParameterTypeDescription
$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

static

ParameterTypeDescription
$invoiceInvoiceData
$profileProfile
$localestring
Returns
?string

structured()#

public static function structured(CashDiscount $discount): string

static

XRechnung notation: #SKONTO#TAGE=14#PROZENT=2.00# with optional #BASISBETRAG=…#. The percentage has exactly two decimals (BR-DE-18).

ParameterTypeDescription
$discountCashDiscount
Returns
string

Die Open-Core-Pakete stehen unter der MIT-Lizenz. Die rechtlichen Formulierungen der Länderpakete sind mit einer Steuerberatung abzustimmen.