API reference / Quittio \ Core \ Calculation
CalculationPolicy
final readonly class in quittio/core
Quittio\Core\Calculation\CalculationPolicy · Source
Decisions of the calculator that are not fixed by EN 16931. The policy is configuration of the run and not stored with the invoice: the same data calculated under another policy can give other amounts.
Properties#
| Property | Type | Description |
|---|---|---|
$declaredAmounts readonly | DeclaredAmountsMode |
Methods#
| Method | Description |
|---|---|
->__construct() | |
::fromArray() | From the configuration key declared_amounts (keep, recalculate or reject). |
__construct()#
public function __construct(
DeclaredAmountsMode $declaredAmounts = \Quittio\Core\Calculation\DeclaredAmountsMode::Keep,
)| Parameter | Type | Description |
|---|---|---|
$declaredAmounts | DeclaredAmountsMode = \Quittio\Core\Calculation\DeclaredAmountsMode::Keep |
fromArray()#
public static function fromArray(array<array-key, mixed> $config): selfFrom the configuration key declared_amounts (keep, recalculate or reject).
| Parameter | Type | Description |
|---|---|---|
$config | array<array-key, mixed> |
- Returns
self- Throws
ConfigurationException– for an unknown mode