added function to fetch an invoice