Added test and updated code for getting an invoice by invoice id