Fix calculation of stock in internal supplies.

review837002
Backed out changeset 6b666477652f until a correct fix