API reference / Quittio \ Country \ CH \ Rounding
CashRounding
final class in quittio/country-ch
Quittio\Country\CH\Rounding\CashRounding · Source
Rounding of the amount due to 5 Rappen, as usual in Switzerland: the difference is the rounding amount (BT-114), never a change of the VAT or the line amounts.
Methods#
| Method | Description |
|---|---|
::apply() | The invoice with the rounding amount that makes the amount due a multiple of 0.05; invoices in another currency than CHF and invoices with a rounding amount of their own stay as they are. |
::round() | An amount rounded to 5 Rappen, half up: 10.02 becomes 10.00, 10.03 becomes 10.05. |
apply()#
public static function apply(InvoiceData $invoice): InvoiceDataThe invoice with the rounding amount that makes the amount due a multiple of 0.05; invoices in another currency than CHF and invoices with a rounding amount of their own stay as they are.
| Parameter | Type | Description |
|---|---|---|
$invoice | InvoiceData |
- Returns
InvoiceData
round()#
public static function round(BigDecimal $amount): BigDecimalAn amount rounded to 5 Rappen, half up: 10.02 becomes 10.00, 10.03 becomes 10.05.
| Parameter | Type | Description |
|---|---|---|
$amount | Brick\Math\BigDecimal |
- Returns
Brick\Math\BigDecimal