Skip to content

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#

MethodDescription
::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): InvoiceData

static

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.

ParameterTypeDescription
$invoiceInvoiceData
Returns
InvoiceData

round()#

public static function round(BigDecimal $amount): BigDecimal

static

An amount rounded to 5 Rappen, half up: 10.02 becomes 10.00, 10.03 becomes 10.05.

ParameterTypeDescription
$amountBrick\Math\BigDecimal
Returns
Brick\Math\BigDecimal

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