Purchasing items with price agreements via 'Collect on New Line' did not work correctly in specific situations

When collecting lines with multiple items, where some items had a creditor filled in and others had a price agreement for the same creditor, it happened that the items were not always merged into one line.