Author: mridulpathak
Date: Sat Sep 19 11:34:41 2015
New Revision: 1703988
URL: http://svn.apache.org/viewvc?rev=1703988&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.
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1703988&r1=1703987&r2=1703988&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
(original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
Sat Sep 19 11:34:41 2015
@@ -5037,8 +5037,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);