Running Balance

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
starquest321
User
Posts: 140

Running Balance

Post by starquest321 »

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


Webmaster
User
Posts: 9438

Post by Webmaster »

Create a database view to add the additional field, then use Row_Rendered event to calculate and set the ViewValue of the field. (Use session or global variable for the running balance.)


Post Reply