Fixed logical error with generating invoicerow id.