Calculation engine to manage deductions
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 |
| 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 |
| 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.<br>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).<br>X3: Capping at zero. If a constraint caps credit notes and invoices at zero, the engine does not create a credit note or invoice for a negative result; the result is set to 0.<br>X4: No deduction sets. If no calculation set has deduction = Yes, the engine behaves as today. |
| Exception scenarios |
E1: A calculation set cannot be calculated (missing data or parameter). The engine reports the error for that set and does not create a netted document for the agreement until it is resolved.<br>E2: Calculation sets of one agreement produce amounts in different currencies. The engine does not net them and reports an error (to be confirmed).<br>E3: Result is exactly zero. No document is created (to be confirmed). |
| Special requirements |
The behaviour is the same for Agreements IN, Agreements OUT and Standard conditions. Results must be traceable: the amount per calculation set and the deducted amount must be visible. Calculation sets of existing agreements are all set to No, so existing results do not change. |
| Open questions |
1. Is netting done per agreement and calculation period, or across a wider scope (for example per counterparty)?<br>2. Which constraint is used to cap at zero (existing or new), and is it set per agreement, per version or per calculation set?<br>3. How are rounding and currency handled when sets use different currencies?<br>4. What happens when the net result is exactly zero (no document, or a zero document)?<br>5. How should the document (credit note or invoice) show the deduction lines: one netted line or all lines per calculation set?<br>6. Can a regular (non-deduction) calculation set produce a negative amount, and how is it treated in sum A? |
Mockup
Functional Requirements
| Business rules and functional requirements |
Field level specification
| Label | UI control |
Manda- tory |
Editable | Data Type | Value set | Default | Data sample |
Data validation failure response
| Field label | Validation/ Business reules | Error message(s) | Data dependencies | Additional information |