Custom Algorithm for Charges (Add REFERENCE_LINE_ID in AR Interface)
We have a custom Algorithm for some specific Charges in Order Management. When the invoice in Receivables is created based on a Sales order, the items and the charge are in the same Invoice but when the credit memo based on referenced RMA is created, the items are billed in one Invoice and the charge in a separate one and unapplied to the original Invoice. The reason is because the field REFERENCE_LINE_ID in AR interface is not being populated for the charge.
We would like to know how to add a condition to the Algorithm to populate this field when the type is RMA/Credit Memo so the credit memo is created all together (items and Charge).