You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by de...@apache.org on 2026/05/22 12:02:32 UTC

(ofbiz-framework) branch trunk updated: Fix Arabic locale currency parsing in accounting reports (OFBIZ-10155) (#1240)

This is an automated email from the ASF dual-hosted git repository.

dixitdeepak pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new b149bbe9a4 Fix Arabic locale currency parsing in accounting reports (OFBIZ-10155) (#1240)
b149bbe9a4 is described below

commit b149bbe9a4c2a42b150c9da67cfaf4881f9c6810
Author: Deepak Dixit <de...@apache.org>
AuthorDate: Fri May 22 17:32:25 2026 +0530

    Fix Arabic locale currency parsing in accounting reports (OFBIZ-10155) (#1240)
    
    Avoid pre-formatting invoice and payment amounts with NumberFormat
    before passing them to currency renderers. Keep values as BigDecimal so
    the existing currency display logic performs the final locale-aware
    formatting.
    
    This prevents Arabic digits from being HTML-escaped into values such as
    &#x662;&#x660; and then failing BigDecimal parsing during report
    rendering.
    
    Thanks Aditya Sharma for reporting the issue.
---
 applications/accounting/widget/InvoiceForms.xml          | 16 ++++------------
 applications/accounting/widget/PaymentScreens.xml        |  4 +---
 applications/accounting/widget/ap/forms/InvoiceForms.xml |  8 ++------
 applications/accounting/widget/ar/forms/InvoiceForms.xml |  8 ++------
 4 files changed, 9 insertions(+), 27 deletions(-)

diff --git a/applications/accounting/widget/InvoiceForms.xml b/applications/accounting/widget/InvoiceForms.xml
index 6035393580..a668f10254 100644
--- a/applications/accounting/widget/InvoiceForms.xml
+++ b/applications/accounting/widget/InvoiceForms.xml
@@ -750,12 +750,8 @@ under the License.
                 <field-map field-name="compareDate" from-field="invoiceDate"/>
                 <field-map field-name="lastNameFirst" value="Y"/>
             </service>
-            <set field="outstanding" value="${groovy:
-                import java.text.NumberFormat;
-                return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId)));}"/>
-            <set field="total" value="${groovy:
-                import java.text.NumberFormat;
-                return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId)));}"/>
+            <set field="outstanding" value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId)}"/>
+            <set field="total" value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId)}"/>
         </row-actions>
         <field name="invoiceId"  title="${uiLabelMap.CommonInvoice}" widget-style="buttontext">
             <hyperlink description="${invoiceId}" target="viewInvoice">
@@ -783,12 +779,8 @@ under the License.
                 <field-map field-name="compareDate" from-field="invoiceDate"/>
                 <field-map field-name="lastNameFirst" value="Y"/>
             </service>
-            <set field="outstanding" value="${groovy:
-                import java.text.NumberFormat;
-                return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId)));}"/>
-            <set field="total" value="${groovy:
-                import java.text.NumberFormat;
-                return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId)));}"/>
+            <set field="amountToApply" value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId)}"/>
+            <set field="total" value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId)}"/>
         </row-actions>
         <field name="invoiceId"  title="${uiLabelMap.CommonInvoice}" widget-style="buttontext">
             <hyperlink description="${invoiceId}" target="viewInvoice">
diff --git a/applications/accounting/widget/PaymentScreens.xml b/applications/accounting/widget/PaymentScreens.xml
index 944152e4f4..51d7b39da1 100644
--- a/applications/accounting/widget/PaymentScreens.xml
+++ b/applications/accounting/widget/PaymentScreens.xml
@@ -169,9 +169,7 @@ under the License.
                 <set field="helpAnchor" value="_help_for_payment_applications"/>
                 <set field="paymentId" from-field="parameters.paymentId"/>
                 <entity-one entity-name="Payment" value-field="payment"/>
-                <set field="appliedAmount" type="String" value="${groovy:
-                    import java.text.NumberFormat;
-                    return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(org.apache.ofbiz.accounting.payment.PaymentWorker.getPaymentApplied(payment)));}"/>
+                <set field="appliedAmount" type="BigDecimal" value="${groovy:org.apache.ofbiz.accounting.payment.PaymentWorker.getPaymentApplied(payment)}"/>
                 <set field="notAppliedAmount" type="BigDecimal" value="${groovy:org.apache.ofbiz.accounting.payment.PaymentWorker.getPaymentNotApplied(payment)}"/>
                 <set field="notAppliedAmountStr" type="String" value="${groovy:
                     import java.text.NumberFormat;
diff --git a/applications/accounting/widget/ap/forms/InvoiceForms.xml b/applications/accounting/widget/ap/forms/InvoiceForms.xml
index 59f04e567c..d1ef8ee51d 100644
--- a/applications/accounting/widget/ap/forms/InvoiceForms.xml
+++ b/applications/accounting/widget/ap/forms/InvoiceForms.xml
@@ -33,12 +33,8 @@ under the License.
                 <field-map field-name="compareDate" from-field="invoiceDate"/>
                 <field-map field-name="lastNameFirst" value="Y"/>
             </service>
-            <set field="amountToApply" value="${groovy:
-                import java.text.NumberFormat;
-                return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId)));}"/>
-            <set field="total" value="${groovy:
-                import java.text.NumberFormat;
-                return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId)));}"/>
+            <set field="amountToApply" value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId)}"/>
+            <set field="total" value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId)}"/>
         </row-actions>
         <field name="invoiceId" widget-style="buttontext">
             <hyperlink description="${invoiceId}" target="viewInvoice">
diff --git a/applications/accounting/widget/ar/forms/InvoiceForms.xml b/applications/accounting/widget/ar/forms/InvoiceForms.xml
index dcb9fed1e5..09a25f993f 100644
--- a/applications/accounting/widget/ar/forms/InvoiceForms.xml
+++ b/applications/accounting/widget/ar/forms/InvoiceForms.xml
@@ -34,12 +34,8 @@ under the License.
                 <field-map field-name="compareDate" from-field="invoiceDate"/>
                 <field-map field-name="lastNameFirst" value="Y"/>
             </service>
-            <set field="amountToApply" value="${groovy:
-                import java.text.NumberFormat;
-                return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId)));}"/>
-            <set field="total" value="${groovy:
-                import java.text.NumberFormat;
-                return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId)));}"/>
+            <set field="outstanding" value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId)}"/>
+            <set field="total" value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId)}"/>
         </row-actions>
         <field name="invoiceId" widget-style="buttontext">
             <hyperlink description="${invoiceId}" target="viewInvoice">