Author: mridulpathak
Date: Sat Sep 19 11:44:50 2015
New Revision: 1703991

URL: http://svn.apache.org/viewvc?rev=1703991&view=rev
Log:
[OFBIZ-6091] Supplier preferred currency not considered for drop-ship order. 
Applying patch from OFBIZ-6091. Thanks Akash Jain for your contribution. 
Applying fix from trunk r1703988.

Modified:
    
ofbiz/branches/release14.12/applications/order/src/org/ofbiz/order/order/OrderServices.java

Modified: 
ofbiz/branches/release14.12/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release14.12/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1703991&r1=1703990&r2=1703991&view=diff
==============================================================================
--- 
ofbiz/branches/release14.12/applications/order/src/org/ofbiz/order/order/OrderServices.java
 (original)
+++ 
ofbiz/branches/release14.12/applications/order/src/org/ofbiz/order/order/OrderServices.java
 Sat Sep 19 11:44:50 2015
@@ -5041,8 +5041,15 @@ public class OrderServices {
                     if 
(!UtilValidate.isEmpty(shipGroup.getString("supplierPartyId"))) {
                         // This ship group is a drop shipment: we create a 
purchase order for it
                         String supplierPartyId = 
shipGroup.getString("supplierPartyId");
+                        // Set supplier preferred currency for drop-ship (PO) 
order to support multi currency
+                        GenericValue supplierParty = 
delegator.findOne("Party", UtilMisc.toMap("partyId", supplierPartyId), false);
+                        String currencyUomId = 
supplierParty.getString("preferredCurrencyUomId");
+                        // If supplier currency not found then set currency of 
sales order
+                        if (UtilValidate.isEmpty(currencyUomId)) {
+                            currencyUomId = orh.getCurrency();
+                        }
                         // create the cart
-                        ShoppingCart cart = new ShoppingCart(delegator, 
orh.getProductStoreId(), null, orh.getCurrency());
+                        ShoppingCart cart = new ShoppingCart(delegator, 
orh.getProductStoreId(), null, currencyUomId);
                         cart.setOrderType("PURCHASE_ORDER");
                         
cart.setBillToCustomerPartyId(cart.getBillFromVendorPartyId()); //Company
                         cart.setBillFromVendorPartyId(supplierPartyId);


Reply via email to