Author: jleroux
Date: Fri Feb 11 22:07:22 2011
New Revision: 1069965
URL:
http://svn.apache.org/viewvc?rev=1069965&view=revLog:
A patch from Chirag Manocha "createFinAccountForStore service should create FinAccount with currencyUomId of Store rather than default currency in general.properties." (
https://issues.apache.org/jira/browse/OFBIZ-4163) - OFBIZ-4163
The service createFinAccountForStore is creating FinAccount record with default currency given in general.properties.
It should create FinAccount with the defaultCurrencyUomId of store.
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java?rev=1069965&r1=1069964&r2=1069965&view=diff==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java Fri Feb 11 22:07:22 2011
@@ -185,6 +185,7 @@ public class FinAccountServices {
String productStoreId = (String) context.get("productStoreId");
String finAccountTypeId = (String) context.get("finAccountTypeId");
Locale locale = (Locale) context.get("locale");
+ GenericValue productStore = ProductStoreWorker.getProductStore(productStoreId, delegator);
try {
// get the product store id and use it to generate a unique fin account code
@@ -225,6 +226,7 @@ public class FinAccountServices {
// product store payToPartyId
String payToPartyId = ProductStoreWorker.getProductStorePayToPartyId(productStoreId, delegator);
inContext.put("organizationPartyId", payToPartyId);
+ inContext.put("currencyUomId", productStore.get("defaultCurrencyUomId"));
Map<String, Object> createResult = dispatcher.runSync("createFinAccount", inContext);