Custom Logic for Consolidated Payments
In CL Loan, by default, the receivables are sorted based on the due date of the bills. With the Hydrogen release, lenders can create custom logic to sort the receivables as per requirement, so as to allocate specific amounts to each of the borrower's accounts.
Perform the following steps to customize the sorting logic:
- Create a custom class and extend the loan.AbstractReceivableComparator.
- Override the method sort, and write the logic.
- Specify the class name in Custom Settings > Org Parameters > Receivable Sorting Class Name.
The system picks the class name and uses the defined implementation. If the class is not defined, the receivables are sorted based on the default logic.
global class CLASS_NAME extends loan.AbstractReceivableComparator { global override List<clcommon.AbstractReceivableObj> sort(List<clcommon.AbstractReceivableObj> abstractReceivablesObjs) { //Logic of ordering the abstractReceivablesObjs list // clcommon.AbstractReceivableObj has a method called getSobject(), which gives the type of object, for example: charge, bill etc } }