$ 0 0 Do you need to write code? This is a standard function on the invoice posting form (summary invoice)