What's the best way on a packing slip to get the sales order quantity, fulfillment quantity, and the outstanding quantity. Currently we loop over the source record to create a hash of quantity/quantityfulfilled, and then sub it from the shipment quantity. This breaks when an item appears twice (key=item) though since there's no unique key (that I can see) between the order line and fulfillment line.