Fixed bug when multiple line items being added in transaction

When multiple line items were added in transaction, the outflow would only
be counted for the last line item.