Creating an invoice less deposit invoice
How to raise a final invoice for a customer, taking off the initial net deposit invoce amount.
I am not sure of the best way of doing this. At the moment, The user creates an order - when this happens, I have written a 'deposit invoice' script that creates a new invoice, (with same order number, customer details etc). The deposit amount comes from the products table that is accessed via a Lines join table so that I can alter prices etc. The problem is that the products table has just net prices (ie VAT not added). But the clients pay a gross amount that includes VAT. It makes this a bit fiddly when adding a net deposit amount, even with a calculation.
I would prefer the user types in the deposit amount as a seperate field and this amount can be the invoice amount, bypassing the products table altogether, The field can then do a calc do work out the net amount so that this net amount can be subtracted from the subsequent Final invoice.
How would you suggest I implement this?
And also, how do I link the two invoices so that the final invoice knows to subtract the correct vat amount?