update getLastInvoiceFromSeries to new structure