ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacques Le Roux (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OFBIZ-10021) Accounting: Handle service response effectively
Date Mon, 27 Nov 2017 10:15:00 GMT

    [ https://issues.apache.org/jira/browse/OFBIZ-10021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16266617#comment-16266617
] 

Jacques Le Roux commented on OFBIZ-10021:
-----------------------------------------

Hi Suraj,

Your patch looks good to me but there is a small issue. You use
{code}
             payResult = dispatcher.runSync("createPayment", paymentCtx);
+            if (ServiceUtil.isError(payResult)) {
+                throw new GeneralException(payResult);
+            }
         } catch (GenericServiceException e) {
             throw new GeneralException(e);
         }
@@ -1015,6 +1020,9 @@
         Map<String, Object> transResult;
         try {
             transResult = dispatcher.runSync("createFinAccountTrans", transCtx);
+            if (ServiceUtil.isError(transResult)) {
+                throw new GeneralException(transResult);
+            }
{code}
But there is no GeneralException method to handle map.

So I fixed it using
{code}
Index: applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountPaymentServices.java
===================================================================
--- applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountPaymentServices.java
(r�vision 1816414)
+++ applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountPaymentServices.java
(copie de travail)
@@ -990,6 +992,9 @@
         Map<String, Object> payResult;
         try {
             payResult = dispatcher.runSync("createPayment", paymentCtx);
+            if (ServiceUtil.isError(payResult)) {
+                throw new GeneralException(ServiceUtil.getErrorMessage(payResult));
+            }
         } catch (GenericServiceException e) {
             throw new GeneralException(e);
         }
@@ -1015,6 +1020,9 @@
         Map<String, Object> transResult;
         try {
             transResult = dispatcher.runSync("createFinAccountTrans", transCtx);
+            if (ServiceUtil.isError(transResult)) {
+                throw new GeneralException(ServiceUtil.getErrorMessage(transResult));
+            }
         } catch (GenericServiceException e) {
             throw new GeneralException(e);
         }
{code}
But I have still 2 failures locally in auto-accounting-budget-tests.testCreateBudget and auto-accounting-budget-tests.testUpdateBudgetStatus.
Since sometimes testIntegration gives false negative reports in Windows (I use Windows), please
check on your side.

Also check that you have not unrelated fixes in like
{code}
Index: accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWorker.java
===================================================================
--- accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWorker.java	(revision
1816414)
+++ accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWorker.java	(working
copy)
@@ -510,11 +510,8 @@
             if (UtilValidate.isNotEmpty(party) && party.getString("baseCurrencyUomId")
!= null) {
                 otherCurrencyUomId = party.getString("baseCurrencyUomId");
             } else {
-                otherCurrencyUomId = EntityUtilProperties.getPropertyValue("general", "currency.uom.id.default",
delegator);
+                otherCurrencyUomId = EntityUtilProperties.getPropertyValue("general", "currency.uom.id.default",
"USD", delegator);
             }
-            if (otherCurrencyUomId == null) {
-                otherCurrencyUomId = "USD"; // final default
-            }
         } catch (GenericEntityException e) {
             Debug.logError(e, "Trouble getting database records....", module);
         }
{code}

Thanks!

> Accounting: Handle service response effectively
> -----------------------------------------------
>
>                 Key: OFBIZ-10021
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10021
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>            Reporter: Suraj Khurana
>            Assignee: Jacques Le Roux
>         Attachments: OFBIZ-10021.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message