API reference / Quittio \ Core \ Tax
CustomTaxPreset
final readonly class in quittio/core · implements TaxPreset
Quittio\Core\Tax\CustomTaxPreset · Source
Ad-hoc tax preset, e.g. for an exemption with a specific legal reference.
Methods#
| Method | Description |
|---|---|
->__construct() | |
->category() | |
->exemptionReason() | The text of the locale, else of its language ("de" for "de_CH"), else the English or the first one. |
->exemptionReasonCode() | |
->key() | |
::make() | |
->rate() |
__construct()#
public function __construct(
string $key,
VatCategory $category,
?BigDecimal $rate = null,
VatExemptionReasonCode|RawCode|null $code = null,
array<string, string> $reasons = [],
)| Parameter | Type | Description |
|---|---|---|
$key | string | |
$category | VatCategory | |
$rate | ?Brick\Math\BigDecimal = null | |
$code | VatExemptionReasonCode|RawCode|null = null | |
$reasons | array<string, string> = [] | exemption reason text per locale |
category()#
public function category(): VatCategory- Returns
VatCategory
exemptionReason()#
public function exemptionReason(?string $locale = null): ?stringThe text of the locale, else of its language ("de" for "de_CH"), else the English or the first one.
| Parameter | Type | Description |
|---|---|---|
$locale | ?string = null |
- Returns
?string
exemptionReasonCode()#
public function exemptionReasonCode(): VatExemptionReasonCode|RawCode|null- Returns
VatExemptionReasonCode|RawCode|null
key()#
public function key(): string- Returns
string
make()#
public static function make(
string $key,
VatCategory $category,
BigDecimal|int|float|string|null $rate = null,
VatExemptionReasonCode|RawCode|string|null $code = null,
array<string, string>|string|null $reason = null,
): self| Parameter | Type | Description |
|---|---|---|
$key | string | |
$category | VatCategory | |
$rate | Brick\Math\BigDecimal|int|float|string|null = null | |
$code | VatExemptionReasonCode|RawCode|string|null = null | |
$reason | array<string, string>|string|null = null |
- Returns
self
rate()#
public function rate(): ?BigDecimal- Returns
?Brick\Math\BigDecimal