added total function to invoices