fix the invoices get global variable