For a shipment associated with a purchase or sale, the quantity for a product gets highlighted in yellow if the total quantity for all shipments associated with the order does not equal the quantity ordered. Shipments that have been cancelled are not included. Case stock and open stock quantities are summed separately for each product (for example if you've ordered 4 open stock units, the warning will appear if the shipment contains a case even if the case would convert to 4 units).
For any shipment the quantity gets highlighted in red if the magazine is not supplied for an item included in the shipment. Since the quantity for a product can be split across multiple rows (to support fulling an order from stock in multiple stock locations), it is possible that a quantity will be red even if there is a magazine supplied for part of the quantity. Use the turn down arrow on the left side of the row to see the detail information on what is causing the red error highlight to appear.