You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2015/09/19 13:47:16 UTC

svn commit: r1703992 - /ofbiz/branches/release13.07/applications/order/src/org/ofbiz/order/order/OrderServices.java

Author: mridulpathak
Date: Sat Sep 19 11:47:16 2015
New Revision: 1703992

URL: http://svn.apache.org/viewvc?rev=1703992&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/release13.07/applications/order/src/org/ofbiz/order/order/OrderServices.java

Modified: ofbiz/branches/release13.07/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1703992&r1=1703991&r2=1703992&view=diff
==============================================================================
--- ofbiz/branches/release13.07/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/branches/release13.07/applications/order/src/org/ofbiz/order/order/OrderServices.java Sat Sep 19 11:47:16 2015
@@ -4963,8 +4963,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);