Fixed the ID generating query for the invoices as well.