Configuring the Rounding
| Configuration files |
|
Subtotal Rounding
The subtotal rounding can be separately configured for positive and negative subtotals. The configuration is set in the file services.properties :
TransactionCalculationServiceConfig.roundMethod=02
TransactionCalculationServiceConfig.roundMethodNegativeSubtotal=03
The following table contains the descriptions of the parameters:
| Parameter | Description |
|---|---|
| roundMethod | Rounding method for positive subtotals |
| roundMethodNegativeSubtotal | Rounding method for negative subtotals |
In general, the following values can be set for rounding:
| Entry | Description | Description |
|---|---|---|
| 00 | NO_ROUNDING | No rounding |
| 01 | ROUND_HALF_UP | Round half up (round up for >= 0.5, otherwise round down), commercial |
| 02 | ROUND_DOWN | Round down |
| 03 | ROUND_UP | Round up |
| 04 | ROUND_HALF_DOWN | Round half down (round up for > 0.5, otherwise round down) |
It is configurable whether or not the payment removes the subtotal rounding. This configuration is set on the tender which is maintained via the global configuration Tender.
<tender:RoundingRequiredFlag>true</tender:RoundingRequiredFlag>
The following table contains the descriptions of the parameters:
| Parameter | Description |
|---|---|
| RoundingRequiredFlag = true | The subtotal rounding is set and will not be removed |
| RoundingRequiredFlag = false | The subtotal rounding will be removed and no rounding will be performed |
The following possibilities are available for setting the rounding:
-
Subtotal rounding in all cases
The rounding is performed according to:- the settings in the global configuration CurrencyRoundingRule
- the accuracy of the currencyRoundingRule.RoundPaymentAmount of the home currency
- the currencyRoundingRule.RoundPaymentAmount is a value which can be set independently of the smallest denomination to round e.g. according to 0.05 EUR and instead of the smallest denomination (e.g. 0.01 EUR)
- if the currencyRoundingRule.RoundPaymentAmount is 0 | null , no rounding will be made
-
Tender rounding only
A differentiation is made between:- the payment amount in home currency: The rounding of the payment amount is performed using option 1.
- the payment amount in foreign currency: The rounding is performed on the basis of the foreign currency settings.
-
Subtotal rounding is replaced by tender rounding
The configuration is set in the file services.properties :
PaymentServiceConfig.replaceSubtotalRounding=true
Rounding of Payment Amount Entries in Subtotal
In order to ensure that only valid entries are entered according to the currencyRoundingRule.RoundPaymentAmount of the used currency, the payment amount entries are validated with a field rule.
The configuration is set in the file inputDomains.properties using the parameter validateRoundPaymentAmount.
Amounts, for which the denomination of the currency should be checked, can be checked using the parameter validateDenomination (e.g. tender counting masks).
Rounding of the Line Item Amount
If the line item amount is calculated during item entry (e.g. entry of area-based items), the result is rounded as well.
The rounding is performed according to:
- the available rounding rule
- the decimal places
Change Rounding
The change rounding is based on the currencyRoundingRule.RoundPaymentAmount of a tender. If the RoundPaymentAmount of the currency rounding rule is 0 | null, no rounding will be made.
It is checked whether an open payment amount exists and whether it is smaller than the currencyRoundingRule.RoundPaymentAmount. If so, the open payment amount is rounded according to the rounding rule and the currencyRoundingRule.RoundPaymentAmount.
If a change amount exists, the change amount itself is rounded to the RoundPaymentAmount of the currency rounding rule of the change currency.
The configuration of the rounding rule is defined in the file services.properties :
TransactionCalculationServiceConfig.changeRoundMethod=01