Zum Inhalt springen

API reference / Quittio \ Core \ Builder \ Concerns

BuildsPayment

trait in quittio/core

Quittio\Core\Builder\Concerns\BuildsPayment · Source

Payment instructions (BG-16 to BG-19), payment terms and the prepaid and rounding amounts (BT-113, BT-114).

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

Methods#

MethodDescription
->addPrepaid()Adds to the amount already paid (BT-113), e.g. one of several advance payments.
->cashDiscount()Cash discount ("Skonto") of $percent for payment within $days days after the issue date, optionally on a base amount; repeatable for several tiers. Continues the payment terms.
->creditTransfer()Adds a further bank account (BG-17).
->directDebit()SEPA direct debit (BG-19): mandate reference (BT-89), creditor identifier (BT-90) and the debited IBAN (BT-91, spaces removed). Without payment instructions it starts them with SepaDirectDebit (59).
->dueInDays()Payment target: the due date (BT-9) is the issue date plus $days unless dueDate() is set, and the payment terms say "Payable within … days without deduction." Continues the payment terms set before.
->lateFee()Late payment terms: days, percentage and text. Continues the payment terms.
->payment()Payment instructions (BG-16) with an optional credit transfer account (BG-17).
->paymentCard()Payment card (BG-18): the last 4 to 6 digits of the card number (BT-87) and the holder (BT-88). Without payment instructions it starts them with BankCard (48).
->paymentTerms()Payment terms (BT-20): a PaymentTerms object or a text replace earlier terms; a callable receives a PaymentTermsBuilder that continues the earlier terms, also those of a PaymentTerms object or of from(), like seller() and buyer().
->prepaid()Amount already paid (BT-113), e.g. received advance payments.
->rounding()Rounding amount (BT-114), e.g. cash rounding. Never use it to fix wrong totals.

addPrepaid()#

public function addPrepaid(BigDecimal|int|float|string $amount): static

Adds to the amount already paid (BT-113), e.g. one of several advance payments.

ParameterTypeDescription
$amountBrick\Math\BigDecimal|int|float|string
Returns
static

cashDiscount()#

public function cashDiscount(
    int $days,
    string $percent,
    ?string $baseAmount = null,
): static

Cash discount ("Skonto") of $percent for payment within $days days after the issue date, optionally on a base amount; repeatable for several tiers. Continues the payment terms.

ParameterTypeDescription
$daysint
$percentstring
$baseAmount?string = null
Returns
static

creditTransfer()#

public function creditTransfer(
    string $accountId,
    ?string $bic = null,
    ?string $accountName = null,
): static

Adds a further bank account (BG-17).

ParameterTypeDescription
$accountIdstring
$bic?string = null
$accountName?string = null
Returns
static

directDebit()#

public function directDebit(
    ?string $mandateReference,
    ?string $creditorId = null,
    ?string $debitedIban = null,
): static

SEPA direct debit (BG-19): mandate reference (BT-89), creditor identifier (BT-90) and the debited IBAN (BT-91, spaces removed). Without payment instructions it starts them with SepaDirectDebit (59).

ParameterTypeDescription
$mandateReference?string
$creditorId?string = null
$debitedIban?string = null
Returns
static

dueInDays()#

public function dueInDays(int $days): static

Payment target: the due date (BT-9) is the issue date plus $days unless dueDate() is set, and the payment terms say "Payable within … days without deduction." Continues the payment terms set before.

ParameterTypeDescription
$daysint
Returns
static

lateFee()#

public function lateFee(
    ?int $days = null,
    ?string $percent = null,
    ?string $text = null,
): static

Late payment terms: days, percentage and text. Continues the payment terms.

ParameterTypeDescription
$days?int = null
$percent?string = null
$text?string = null
Returns
static

payment()#

public function payment(
    PaymentMeansCode|RawCode|string $means,
    ?string $iban = null,
    ?string $bic = null,
    ?string $accountName = null,
    ?string $remittanceInformation = null,
    ?string $meansText = null,
): static

Payment instructions (BG-16) with an optional credit transfer account (BG-17).

A second call replaces the payment instructions: an account given here replaces the accounts, and data of other payment means is dropped (e.g. bank accounts when switching to direct debit). Without an account, existing accounts are kept for credit transfers (e.g. a seller default account); likewise card (BG-18) and direct debit (BG-19) data for card payments and direct debits. The remittance information (BT-83) is kept unless a new one is given. Further accounts are added with creditTransfer().

ParameterTypeDescription
$meansPaymentMeansCode|RawCode|string
$iban?string = null
$bic?string = null
$accountName?string = null
$remittanceInformation?string = null
$meansText?string = null
Returns
static

paymentCard()#

public function paymentCard(string $lastDigits, ?string $holderName = null): static

Payment card (BG-18): the last 4 to 6 digits of the card number (BT-87) and the holder (BT-88). Without payment instructions it starts them with BankCard (48).

ParameterTypeDescription
$lastDigitsstring
$holderName?string = null
Returns
static
Throws
InvalidArgumentException – for more or fewer digits

paymentTerms()#

public function paymentTerms(PaymentTerms|string|callable $terms): static

Payment terms (BT-20): a PaymentTerms object or a text replace earlier terms; a callable receives a PaymentTermsBuilder that continues the earlier terms, also those of a PaymentTerms object or of from(), like seller() and buyer().

ParameterTypeDescription
$termsPaymentTerms|string|callable
Returns
static

prepaid()#

public function prepaid(BigDecimal|int|float|string $amount): static

Amount already paid (BT-113), e.g. received advance payments.

ParameterTypeDescription
$amountBrick\Math\BigDecimal|int|float|string
Returns
static

rounding()#

public function rounding(BigDecimal|int|float|string $amount): static

Rounding amount (BT-114), e.g. cash rounding. Never use it to fix wrong totals.

ParameterTypeDescription
$amountBrick\Math\BigDecimal|int|float|string
Returns
static

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