code generation for invoices fixed