Once all dunning configuration objects are defined (policies, levels, actions, templates, etc.) and at least one policy is activated, the DunningCollectionPlan_Job takes responsibility for evaluating eligible invoices or customer accounts at each scheduled run.
1. Evaluation Logic for Policy Instantiation
The job evaluates each invoice or customer balance against the first level of the selected dunning policy using the following logic:
📍 For Invoice-Based Dunning
a. Reminder Handling (Before Due Date)
-
If the invoice's due date is still in the future, the system does not create a collection plan.
-
Instead, it instantiates a reminder level (if configured) to notify the customer.
-
This reminder:
-
Is displayed in the Reminders page.
-
Is sent (e.g., email) and marked as DONE.
-
Is marked IGNORED if the due date is already in the past.
-
💡 Why this approach?
To avoid generating thousands of unnecessary collection plans just to send a reminder, especially when most customers pay on time. This makes the system more efficient and avoids clutter with collection plans that would be instantly marked as RECOVERED with all other levels IGNORED.
b. Collection Plan Creation (After Due Date or Conditions Met)
-
If the due date is passed AND the minimum balance condition is met for the first level:
-
A collection plan (CP) is created.
-
The associated dunning policy is instantiated.
-
c. Execution Date Calculation
-
The start date of the collection plan is always the system date (sysdate) at the time of creation.
-
The execution date of each level is calculated as:
Execution Date = Collection Plan Start Date + Days Overdue (from level configuration)
-
To execute the first level on the same day the plan is created, set the Days Overdue = 0.
📍 For Customer-Based Dunning
The logic is identical to invoice mode, except the evaluation is done on the customer’s dunning balance, as calculated by expression language (EL) from defined account operations.
2. Post-Creation Execution (Level and Actions)
Once the collection plan is created:
-
The
TriggerCollectionPlanLevelsJobis responsible for executing eligible levels and actions. -
This job uses the execution dates defined during instantiation to determine what to trigger.
-
From this point forward:
-
Days Overdueis no longer used. -
Only the execution dates of levels and actions drive the dunning lifecycle.
-
-
The execution granularity for the different Collection Plans (CPs) is defined such that each CP runs independently. Therefore, if one CP encounters errors, the remaining CPs continue to execute as scheduled.
✅ Summary of Execution Flow
|
Step |
Description |
|---|---|
|
|
Evaluate invoice or customer balance. |
|
|
If before due date → send Reminder only. |
|
|
If past due + meets policy entry conditions → create Collection Plan. |
|
|
Set execution dates using |
|
|
Execute levels/actions based on execution dates via |