Skip to content

API reference / Quittio \ Core \ Data \ AllowanceCharge

DocumentAllowanceCharge

abstract readonly class in quittio/core

Quittio\Core\Data\AllowanceCharge\DocumentAllowanceCharge · Source

Common structure of document level allowances (BG-20) and charges (BG-21).

The exemption reason and code are package-internal inputs like on LineVat: EN 16931 carries them on the VAT breakdown (BT-120, BT-121). The calculator uses them when the VAT group of the entry has no invoice lines that provide a reason.

Properties#

PropertyTypeDescription
$amount readonly?Brick\Money\Money
$baseAmount readonly?Brick\Money\Money
$exemptionReason readonly?string
$exemptionReasonCode readonlyVatExemptionReasonCode|RawCode|null
$percent readonly?Brick\Math\BigDecimal
$reason readonly?string
$reasonCode readonlyBackedEnum|RawCode|null
$vatCategory readonlyVatCategory
$vatRate readonly?Brick\Math\BigDecimal

Methods#

MethodDescription
->__construct()
->isCharge()
->reasonCodeValue()
->with()Returns a copy with the given properties replaced.

__construct()#

public function __construct(
    ?Money $amount,
    VatCategory $vatCategory,
    ?BigDecimal $vatRate = null,
    ?Money $baseAmount = null,
    ?BigDecimal $percent = null,
    ?string $reason = null,
    BackedEnum|RawCode|null $reasonCode = null,
    ?string $exemptionReason = null,
    VatExemptionReasonCode|RawCode|null $exemptionReasonCode = null,
)
ParameterTypeDescription
$amount?Brick\Money\Money
$vatCategoryVatCategory
$vatRate?Brick\Math\BigDecimal = null
$baseAmount?Brick\Money\Money = null
$percent?Brick\Math\BigDecimal = null
$reason?string = null
$reasonCodeBackedEnum|RawCode|null = null
$exemptionReason?string = null
$exemptionReasonCodeVatExemptionReasonCode|RawCode|null = null

isCharge()#

abstract public function isCharge(): bool

abstract

Returns
bool

reasonCodeValue()#

public function reasonCodeValue(): ?string
Returns
?string

with()#

public function with(array<string, mixed> $changes): static

Returns a copy with the given properties replaced.

ParameterTypeDescription
$changesarray<string, mixed>
Returns
static

The open core packages are MIT licensed. The legal wording of the country packs must be confirmed by a tax adviser.