Zum Inhalt springen

API reference / Quittio \ Core \ Builder \ Concerns

BuildsAllowancesAndCharges

trait in quittio/core

Quittio\Core\Builder\Concerns\BuildsAllowancesAndCharges · Source

Document level allowances and charges (BG-20, BG-21) and discounts split over the VAT rates.

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

Methods#

MethodDescription
->allowance()Document level allowance (BG-20) for one VAT category and rate.
->charge()Document level charge (BG-21) for one VAT category and rate. See allowance() for the exemption reason.
->discountAmount()Absolute discount distributed over all VAT groups in proportion to their line totals.
->discountPercent()Percentage discount on all lines. Split into one allowance per VAT group.

allowance()#

public function allowance(
    VatCategory $category,
    BigDecimal|int|float|string|null $rate,
    ?string $amount = null,
    ?string $percent = null,
    ?string $reason = null,
    AllowanceReasonCode|RawCode|string|null $reasonCode = null,
    ?string $baseAmount = null,
    ?string $exemptionReason = null,
    VatExemptionReasonCode|RawCode|string|null $exemptionReasonCode = null,
): static

Document level allowance (BG-20) for one VAT category and rate.

The exemption reason (BT-120/BT-121) is used for the VAT breakdown when no invoice line of the same VAT group provides one, e.g. an exempt charge on a standard rated invoice.

ParameterTypeDescription
$categoryVatCategory
$rateBrick\Math\BigDecimal|int|float|string|null
$amount?string = null
$percent?string = null
$reason?string = null
$reasonCodeAllowanceReasonCode|RawCode|string|null = null
$baseAmount?string = null
$exemptionReason?string = null
$exemptionReasonCodeVatExemptionReasonCode|RawCode|string|null = null
Returns
static

charge()#

public function charge(
    VatCategory $category,
    BigDecimal|int|float|string|null $rate,
    ?string $amount = null,
    ?string $percent = null,
    ?string $reason = null,
    ChargeReasonCode|RawCode|string|null $reasonCode = null,
    ?string $baseAmount = null,
    ?string $exemptionReason = null,
    VatExemptionReasonCode|RawCode|string|null $exemptionReasonCode = null,
): static

Document level charge (BG-21) for one VAT category and rate. See allowance() for the exemption reason.

ParameterTypeDescription
$categoryVatCategory
$rateBrick\Math\BigDecimal|int|float|string|null
$amount?string = null
$percent?string = null
$reason?string = null
$reasonCodeChargeReasonCode|RawCode|string|null = null
$baseAmount?string = null
$exemptionReason?string = null
$exemptionReasonCodeVatExemptionReasonCode|RawCode|string|null = null
Returns
static

discountAmount()#

public function discountAmount(
    BigDecimal|int|float|string $amount,
    ?string $reason = null,
    AllowanceReasonCode|RawCode|string|null $reasonCode = \Quittio\Core\Enums\AllowanceReasonCode::Discount,
): static

Absolute discount distributed over all VAT groups in proportion to their line totals.

ParameterTypeDescription
$amountBrick\Math\BigDecimal|int|float|string
$reason?string = null
$reasonCodeAllowanceReasonCode|RawCode|string|null = \Quittio\Core\Enums\AllowanceReasonCode::Discount
Returns
static

discountPercent()#

public function discountPercent(
    BigDecimal|int|float|string $percent,
    ?string $reason = null,
    AllowanceReasonCode|RawCode|string|null $reasonCode = \Quittio\Core\Enums\AllowanceReasonCode::Discount,
): static

Percentage discount on all lines. Split into one allowance per VAT group.

ParameterTypeDescription
$percentBrick\Math\BigDecimal|int|float|string
$reason?string = null
$reasonCodeAllowanceReasonCode|RawCode|string|null = \Quittio\Core\Enums\AllowanceReasonCode::Discount
Returns
static

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