I am learning BRF Plus, and I am trying to work
out the 'best practice' for encoding some real-world business rules.
At the moment we have implemented the following 'instalment plan'
logic in an ABAP method. The problem is how to adjust an instalment
plan if the debt amount is increased.
So, given a debt of $300 and an instalment plan of:
1/5 $100 <-- eg $100 is due on 1 May
.. a debt increase to $420 on March 15 is rescheduled as:
1/7 $140 <-- $420 is spread evenly over all remaining instalments
The rule shown above is very simple, but there is one complication.
If today's date is less than 7 days before a due date,
the amount on that 'imminent' due date cannot be changed.
For example, if the debt was increased to $420 on April 28:
1/5 $100 <-- an 'imminent' instalment amount cannot be increased
1/7 $160 <-- spread the rest evenly over all remaining instalments
(Of course, the logic needs to be able handle any number of instalments).
What would be the best way to implement this kind of logic in BRF?
I was thinking 'decision table', but is it possible to do it that
in a general way (without listing all possible outcomes)?
Or would a static ABAP method be preferable in a case like this?
I look forward to your opinions and advice.