get_all_invoices: working version