Running Balance
I have the following structure:
Charge|Payment|Balance
All coming from the database. But I need to create a running balance. . . now what I have is a line item balance:
Charge: 100| Payment: 0 | Balance: 100
Charge: 0 | Payment: 10| Balance: -10
Charge: 50 | Payment: 0| Balance: -50
Charge: 0 | Payment: 10| Balance: -10
I need the running balance for these entries to appear. So:
Charge: 100| Payment: 0 | Balance: 100 | Running: -100
Charge: 0 | Payment: 10| Balance: -10 | Running: 90
Charge: 50 | Payment: 0| Balance: -50| Running: 140
Charge: 0 | Payment: 10| Balance: -10 | Running: 130