Expression for calculating inventory stock balance - Tracker program

Hi

Am working on a small inventory tracker program with three stages namely Physical count, Receipts and Transfers. Now my supervisor has asked me to come up with an expression to show current stock balance when there is a stock movement. However, I thought that I can achieve this by defining program rule variables and use the variables to define a program rule to calculate balances but to no avail.

Can someone help on how I can go about this or has anyone worked on a similar scenario. Please please help. Have been stuck for more than three works now.

Warm Regards

Allan

Jica - Zambia