When you create a transaction, items get entered based on entry date rather than item number. However, there is a way to re-sort the items on a transaction. This wiki will walk you through how to do this. Although this document shows how to do this on an order, it can be applied to any transaction.
In edit mode, double click on the product column.
The products will now be re-sorted.
When you save the transaction, the re-assortment will also get saved.