patch for retrieving paid invoices