}
if (isProductId) {
for (String orderItemSeqId : orderItemSeqIds) {
counter++;
if (quantity.compareTo(ZERO) > 0) {
GenericValue orderItem = delegator.findOne("OrderItem", UtilMisc.toMap("orderId", orderId , "orderItemSeqId", orderItemSeqId), false);
BigDecimal orderedQuantity = orderItem.getBigDecimal("quantity");
List<GenericValue> shipments = delegator.findByAnd("Shipment", UtilMisc.toMap("primaryOrderId", orderId , "statusId", "SHIPMENT_PICKED"));
for(GenericValue shipment : shipments) {
List<GenericValue> orderShipments = shipment.getRelatedByAnd("OrderShipment" , UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId));
for(GenericValue orderShipment : orderShipments) {