svn commit: r748803 - in /ofbiz/trunk: applications/product/config/ProductUiLabels.xml applications/product/webapp/facility/facility/FacilityForms.xml framework/widget/src/org/ofbiz/widget/form/ModelFormField.java

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

svn commit: r748803 - in /ofbiz/trunk: applications/product/config/ProductUiLabels.xml applications/product/webapp/facility/facility/FacilityForms.xml framework/widget/src/org/ofbiz/widget/form/ModelFormField.java

jleroux@apache.org
Author: jleroux
Date: Sat Feb 28 10:04:30 2009
New Revision: 748803

URL: http://svn.apache.org/viewvc?rev=748803&view=rev
Log:
This is a generalized solution for an issue reported on dev ML <<encode-output="false" for display type="currency">>
By default encode-output is true for display fields. If the type is currency an amount like 1260 will be rendered as US$1,260.00 in USA but should be rendered 1 260,00 $ in France.
So with encoding an &nbsp; is introduced in place of the space. And finally it's not rendered as 1&nbsp;260,00 $ but as 1,00 $ which is ... false!
See also r747364

Modified:
    ofbiz/trunk/applications/product/config/ProductUiLabels.xml
    ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.xml?rev=748803&r1=748802&r2=748803&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.xml (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.xml Sat Feb 28 10:04:30 2009
@@ -11074,7 +11074,7 @@
     </property>
     <property key="ProductInventoryAverageCosts">
         <value xml:lang="en">Inventory Average Costs</value>
-        <value xml:lang="fr">coûts moyens de stokage</value>
+        <value xml:lang="fr">Coûts moyens de stokage</value>
     </property>
     <property key="ProductInventoryByProduct">
         <value xml:lang="de">Lager nach Produkt</value>

Modified: ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml?rev=748803&r1=748802&r2=748803&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml (original)
+++ ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml Sat Feb 28 10:04:30 2009
@@ -583,9 +583,9 @@
             <hyperlink target="/catalog/control/EditProduct?productId=${productId}" target-type="inter-app" description="${productId}"/>
         </field>        
         <field name="totalQuantityOnHand" title="${uiLabelMap.CommonTotal} ${uiLabelMap.ProductQoh}"><display/></field>
-        <field name="productAverageCost" use-when="currencyUomId!=null" title="${uiLabelMap.ProductAverageCost}" encode-output="false"><display type="currency" currency="${currencyUomId}"/></field>
-        <field name="productAverageCost" use-when="currencyUomId==null" title="${uiLabelMap.ProductAverageCost}" encode-output="false"><display description="${uiLabelMap.ProductDifferentCurrencies}"/></field>
-        <field name="totalInventoryCost" use-when="currencyUomId!=null" title="${uiLabelMap.CommonTotalCost}" encode-output="false"><display type="currency" currency="${currencyUomId}"/></field>
+        <field name="productAverageCost" use-when="currencyUomId!=null" title="${uiLabelMap.ProductAverageCost}" ><display type="currency" currency="${currencyUomId}"/></field>
+        <field name="productAverageCost" use-when="currencyUomId==null" title="${uiLabelMap.ProductAverageCost}" ><display description="${uiLabelMap.ProductDifferentCurrencies}"/></field>
+        <field name="totalInventoryCost" use-when="currencyUomId!=null" title="${uiLabelMap.CommonTotalCost}" ><display type="currency" currency="${currencyUomId}"/></field>
         <field name="totalInventoryCost" use-when="currencyUomId==null" title="${uiLabelMap.CommonTotalCost}"><display description="${uiLabelMap.ProductDifferentCurrencies}"/></field>
     </form>
     <form name="ListInventoryItemGrandTotals" type="list" list-name="inventoryItemGrandTotals"

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=748803&r1=748802&r2=748803&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Sat Feb 28 10:04:30 2009
@@ -704,7 +704,7 @@
                 dataMapIsContext = true;
             }
             Object retVal = null;
-            if (this.entryAcsr != null && !this.entryAcsr.isEmpty()) {
+            if (this.entryAcsr != null && !this.entryAcsr.isEmpty()) {
                 //Debug.logInfo("Getting entry, using entryAcsr for field " + this.getName() + " of form " + this.modelForm.getName(), module);
                 if (dataMap instanceof GenericEntity) {
                     GenericEntity genEnt = (GenericEntity) dataMap;
@@ -2059,7 +2059,8 @@
             }
             if (retVal == null || retVal.length() == 0) {
                 retVal = "";
-            } else if ("currency".equals(type)) {
+            } else if ("currency".equals(type)) {
+                retVal = retVal.replaceAll("&nbsp;", " "); // encoding currency is a problem for some locale, we should not have any &nbsp; in retVal
                 Locale locale = (Locale) context.get("locale");
                 if (locale == null) locale = Locale.getDefault();
                 String isoCode = null;