fix logic error creating invoice line items