Author: jonesde
Date: Fri Aug 10 02:07:18 2007
New Revision: 564521
URL:
http://svn.apache.org/viewvc?view=rev&rev=564521Log:
Added method to see if an order has physical product items
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?view=diff&rev=564521&r1=564520&r2=564521==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Fri Aug 10 02:07:18 2007
@@ -389,6 +389,21 @@
}
return false;
}
+
+ public boolean hasPhysicalProductItems() throws GenericEntityException {
+ Iterator orderItemIter = this.getOrderItems().iterator();
+ while (orderItemIter.hasNext()) {
+ GenericValue orderItem = (GenericValue) orderItemIter.next();
+ GenericValue product = orderItem.getRelatedOneCache("Product");
+ if (product != null) {
+ GenericValue productType = product.getRelatedOneCache("ProductType");
+ if ("Y".equals(productType.getString("isPhysical"))) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
public GenericValue getOrderItemShipGroup(String shipGroupSeqId) {
try {