Currently, I am working on an AR Aging Analysis Report, my objective is to calculate the outstanding amount along with the age bucket.
For example, assuming the system has data from 2018-02-01 to 2018-04-31, if I select 2018-04-31 as the max date the system should calculate all the invoices from 2018-02-01 to 2018-04-31 and display the outstanding amount along with its aging period (30 Days, 45 Days, etc).
If the Invoice Date is 2018-02-20 then the difference between the max date is 60+ Days, the invoice dates will vary.