svn commit: r1819122 - in /ofbiz/ofbiz-framework/trunk/applications: accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWorker.java order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java

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

svn commit: r1819122 - in /ofbiz/ofbiz-framework/trunk/applications: accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWorker.java order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java

Arun Patidar-4
Author: arunpatidar
Date: Sat Dec 23 08:49:07 2017
New Revision: 1819122

URL: http://svn.apache.org/viewvc?rev=1819122&view=rev
Log:
Fixed: While creating return fin account used currency must be same (OFBIZ-9977)
Thanks Suraj Khurana for your contribution.

Modified:
    ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWorker.java
    ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWorker.java?rev=1819122&r1=1819121&r2=1819122&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWorker.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWorker.java Sat Dec 23 08:49:07 2017
@@ -514,10 +514,7 @@ public final class InvoiceWorker {
             if (UtilValidate.isNotEmpty(party) && party.getString("baseCurrencyUomId") != null) {
                 otherCurrencyUomId = party.getString("baseCurrencyUomId");
             } else {
-                otherCurrencyUomId = EntityUtilProperties.getPropertyValue("general", "currency.uom.id.default", delegator);
-            }
-            if (otherCurrencyUomId == null) {
-                otherCurrencyUomId = "USD"; // final default
+                otherCurrencyUomId = EntityUtilProperties.getPropertyValue("general", "currency.uom.id.default", "USD", delegator);
             }
         } catch (GenericEntityException e) {
             Debug.logError(e, "Trouble getting database records....", module);

Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java?rev=1819122&r1=1819121&r2=1819122&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java Sat Dec 23 08:49:07 2017
@@ -817,7 +817,7 @@ public class OrderReturnServices {
                         GenericValue finAccount = null;
                         try {
                             finAccount = EntityQuery.use(delegator).from("FinAccountAndRole")
-                                    .where("partyId", fromPartyId, "finAccountTypeId", "STORE_CREDIT_ACCT", "roleTypeId", "OWNER", "statusId", "FNACT_ACTIVE")
+                                    .where("partyId", fromPartyId, "finAccountTypeId", "STORE_CREDIT_ACCT", "roleTypeId", "OWNER", "statusId", "FNACT_ACTIVE", "currencyUomId", returnHeader.getString("currencyUomId"))
                                     .filterByDate()
                                     .orderBy("-fromDate")
                                     .queryFirst();