Hello all professionals,I need help to calculate the credit amount but also to consider the debit amount and date. For example. If debit amount is on 2023-10-07 and the next one is on 2023-10-17 I need to calculate the total credit amount between these two debit amounts date range and then again calculate the total amount between 2023-10-17 and 2023-10-19 and then again the total amount between 2023-10-19 and 2023-10-27.
Also when the total amount is calculated I need to find the difference between the debit amount and the total of all credit amount between the date ranges. Attached is the sample for reference.