I am looking for advance calculation suppose
i have a Client table and have a CID as client ID now if i am recieving payments against Client ID and making Purchase again Client ID so the system to calculate previous advance first for e.g
give advance to CID 360 is 2000
now purchase stuff from CID 360 of 550
so i want running balance of advance forr the CID 360 if i make any further transaction agaist the same CID
i have a Client table and have a CID as client ID now if i am recieving payments against Client ID and making Purchase again Client ID so the system to calculate previous advance first for e.g
give advance to CID 360 is 2000
now purchase stuff from CID 360 of 550
so i want running balance of advance forr the CID 360 if i make any further transaction agaist the same CID