update the residual amount field