Need info regarding how to calculate opening balance.
I'm having the fields Sales , adjustments and colelctions which i'm getting these values from debit/credit amount.
Now my requirement is i need to calculate opening balance and closing balance.
Closing bal = Sales -(adjustments+colections) - where i'm getting the closing balance but the issue is closing balance is becomming the opening balance for the same customer for next day.
now the closing balance calculation is changing
Closing bal = opening bal + sales -(adjustments+collections)
how to achive this opening bal.