Calculation engine to manage calculation sets flagged for deduction
Purpose / Description
Calculation sets can be flagged with Calculated fee amount will be used for deduction = Yes (see the use case for the calculation set property). This use case describes how the calculation engine handles these sets.
The engine first calculates the invoice (for payables: payment amount) of every calculation set. The amounts of the regular calculation sets are added up. The amounts of the deduction calculation sets are then subtracted from that sum (netting off). If the result is negative, because the deductions exceed the positive amounts, or if only deduction calculation sets are available or produce amounts, a credit note is created for receivables (Agreements with Direction IN) and an invoice is created for payables (Agreements with Direction OUT).
As an extension, the user can cap credit notes and invoices at zero via the constraints functionality.
Use Case
| As a system I need to handle deductions resulting from calculation sets. | |
| Primary Actor(s) |
Calculation engine triggered via import or manual amendment from users. |
| Stakeholders and Interest |
Fee/commission accounting and billing: need correct netted amounts and the right document type (invoice, payment, credit note). Product owner and business analysts: need transparent, configurable deduction behaviour. |
| Trigger |
A calculation is started for an agreement version (Direction IN or OUT) (with or without standard condition) that contains at least one calculation set. |
| Pre-condition(s) |
The agreement version or standard condition contains one or more calculation sets. One or multiple will be flagged for deduction (Yes or No). The calculation sets have valid scope, calculation parameters and scale. Input data for the calculation period is available. |
| Post-condition(s) |
One netted result is available per agreement and calculation period. Depending on the result, an invoice or payment is created, or a credit note (receivables) or invoice (payables) is created. The amount may be capped at zero when a minimum constraint of Zero applies. The payment review and invoice review report shows the amount per calculation set and the netting step. |
| Main success scenario |
|
| Extensions |
X1: Result negative. If R is negative, the engine creates a credit note for receivables (Direction IN) or an invoice for payables (Direction OUT) for the negative amount. X2: Only deduction sets. If only deduction calculation sets exist or only they produce amounts (A = 0), the engine treats the result as negative and creates a credit note (receivables) or invoice (payables). X3: Capping at zero. If a constraint caps credit notes and invoices at zero, the engine does create a credit note (payables) or invoice (receivables) for a negative result; the result is set to 0 X4: No calculation sets flagged for deduction. If no calculation set has deduction = Yes, the engine behaves as today. |
| Exception scenarios |
N/A |
| Special requirements |
Calculation sets of existing agreements are all set to No during migration, so existing results do not change. |
| Open questions |
|
Sample
|
Case |
Regular sets (sum A) |
Deduction sets (sum D) |
Result R = A - D |
Receivables (Direction IN) |
Payables (Direction OUT) |
|
1: Positive result |
1,000 |
300 |
700 |
Invoice 700 |
Payment 700 |
|
2: Negative result |
200 |
500 |
-300 |
Credit note 300 |
Invoice 300 |
|
3: Only deduction set |
0 |
400 |
-400 |
Credit note 400 |
Invoice 400 |
|
4: Negative result, capped at zero |
200 |
500 |
-300, capped to 0 |
No credit note |
No invoice |
|
5: No deduction sets |
1,000 |
0 |
1,000 |
Invoice 1,000 |
Payment 1,000 |
Functional Requirements
| Business rules and functional requirements |
|
The engine calculates the amount of each calculation set independently before any netting is done. |
|
Calculation sets with 'Calculated fee amount will be used for deduction'= Yes are treated as deduction sets; all other sets are regular sets. |
|
The engine adds up the amounts of all regular sets (sum A) and of all deduction sets (sum D), and calculates the result R = A - D. |
|
If R is positive, the normal invoice (receivables) or payment (payables) is created for the amount R. |
|
If R is negative, or if only deduction sets exist or produce amounts, a credit note is created for receivables (Direction IN) and an invoice is created for payables (Direction OUT). |
|
If no deduction set exists, the calculation behaves as before this enhancement. |
|
Using the constraints functionality, the user can cap credit notes and invoices at zero. When the cap applies, no credit note or invoice is created for a negative result and the result is zero. The advantage here is that the payment or invoice recipient can see the netting off as documentation is being produced. (please note: Zero lines due to constraints are always displayed) |
|
The calculation result shows in the database the amount per calculation set, sum A, sum D and the netting result, so the outcome can be traced. |
|
The same logic applies to Agreements IN and Agreements OUT. Whether or not they refer to Standard conditions. |
|
Amounts of deduction sets are always subtracted, regardless of their sign convention, so that the deduction reduces the result. Within any reports and invoices/statements, the amounts are shown as negatives (minus as prefix) |
Field level specification
| Label | UI control |
Manda- tory |
Editable | Data Type | Value set | Default | Data sample |
| N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
Data validation failure response
| Field label | Validation/ Business rules | Error message(s) | Data dependencies | Additional information |
| N/A | N/A | N/A | N/A | N/A |
No Comments