svn commit: r434238 - /incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r434238 - /incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java

sichen
Author: sichen
Date: Wed Aug 23 16:11:31 2006
New Revision: 434238

URL: http://svn.apache.org/viewvc?rev=434238&view=rev
Log:
Enhanced OrderReadHelper.getBillFromParty to use ProductStore when there is no BILL_FROM_VENDOR.  Also added comments to the other methods

Modified:
    incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java

Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?rev=434238&r1=434237&r2=434238&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Wed Aug 23 16:11:31 2006
@@ -146,6 +146,21 @@
         return orderHeader.getString("productStoreId");
     }
 
+    /**
+     * Returns the ProductStore of this Order or null in case of Exception
+     */
+    public GenericValue getProductStore() {
+        String productStoreId = orderHeader.getString("productStoreId");
+        try {
+            GenericDelegator delegator = orderHeader.getDelegator();
+            GenericValue productStore = delegator.findByPrimaryKeyCache("ProductStore", UtilMisc.toMap("productStoreId", productStoreId));
+            return productStore;
+        } catch (GenericEntityException ex) {
+            Debug.logError("Failed to get product store for order header [" + orderHeader + "] due to exception "+ ex.getMessage(), module);
+            return null;
+        }
+    }
+    
     public String getOrderTypeId() {
         return orderHeader.getString("orderTypeId");
     }
@@ -644,26 +659,44 @@
         }
     }
 
+    /**
+     * Returns party from OrderRole of BILL_TO_CUSTOMER
+     */
     public GenericValue getBillToParty() {
         return this.getPartyFromRole("BILL_TO_CUSTOMER");
     }
 
+    /**
+     * Returns party from OrderRole of BILL_FROM_VENDOR
+     */
     public GenericValue getBillFromParty() {
         return this.getPartyFromRole("BILL_FROM_VENDOR");
     }
 
+    /**
+     * Returns party from OrderRole of SHIP_TO_CUSTOMER
+     */
     public GenericValue getShipToParty() {
         return this.getPartyFromRole("SHIP_TO_CUSTOMER");
     }
 
+    /**
+     * Returns party from OrderRole of PLACING_CUSTOMER
+     */
     public GenericValue getPlacingParty() {
         return this.getPartyFromRole("PLACING_CUSTOMER");
     }
 
+    /**
+     * Returns party from OrderRole of END_USER_CUSTOMER
+     */
     public GenericValue getEndUserParty() {
         return this.getPartyFromRole("END_USER_CUSTOMER");
     }
 
+    /**
+     * Returns party from OrderRole of SUPPLIER_AGENT
+     */
     public GenericValue getSupplierAgent() {
         return this.getPartyFromRole("SUPPLIER_AGENT");
     }