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#
| Method | Description |
|---|---|
->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): staticAdds to the amount already paid (BT-113), e.g. one of several advance payments.
| Parameter | Type | Description |
|---|---|---|
$amount | Brick\Math\BigDecimal|int|float|string |
- Returns
static
cashDiscount()#
public function cashDiscount(
int $days,
string $percent,
?string $baseAmount = null,
): staticCash 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.
| Parameter | Type | Description |
|---|---|---|
$days | int | |
$percent | string | |
$baseAmount | ?string = null |
- Returns
static
creditTransfer()#
public function creditTransfer(
string $accountId,
?string $bic = null,
?string $accountName = null,
): staticAdds a further bank account (BG-17).
| Parameter | Type | Description |
|---|---|---|
$accountId | string | |
$bic | ?string = null | |
$accountName | ?string = null |
- Returns
static
directDebit()#
public function directDebit(
?string $mandateReference,
?string $creditorId = null,
?string $debitedIban = null,
): staticSEPA 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).
| Parameter | Type | Description |
|---|---|---|
$mandateReference | ?string | |
$creditorId | ?string = null | |
$debitedIban | ?string = null |
- Returns
static
dueInDays()#
public function dueInDays(int $days): staticPayment 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.
| Parameter | Type | Description |
|---|---|---|
$days | int |
- Returns
static
lateFee()#
public function lateFee(
?int $days = null,
?string $percent = null,
?string $text = null,
): staticLate payment terms: days, percentage and text. Continues the payment terms.
| Parameter | Type | Description |
|---|---|---|
$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,
): staticPayment 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().
| Parameter | Type | Description |
|---|---|---|
$means | PaymentMeansCode|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): staticPayment 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).
| Parameter | Type | Description |
|---|---|---|
$lastDigits | string | |
$holderName | ?string = null |
- Returns
static- Throws
InvalidArgumentException– for more or fewer digits
paymentTerms()#
public function paymentTerms(PaymentTerms|string|callable $terms): staticPayment 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().
| Parameter | Type | Description |
|---|---|---|
$terms | PaymentTerms|string|callable |
- Returns
static
prepaid()#
public function prepaid(BigDecimal|int|float|string $amount): staticAmount already paid (BT-113), e.g. received advance payments.
| Parameter | Type | Description |
|---|---|---|
$amount | Brick\Math\BigDecimal|int|float|string |
- Returns
static
rounding()#
public function rounding(BigDecimal|int|float|string $amount): staticRounding amount (BT-114), e.g. cash rounding. Never use it to fix wrong totals.
| Parameter | Type | Description |
|---|---|---|
$amount | Brick\Math\BigDecimal|int|float|string |
- Returns
static