svn commit: r1816291 - in /ofbiz/ofbiz-framework/trunk/applications: order/template/entry/ order/template/return/ product/template/inventory/ product/template/returns/

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

svn commit: r1816291 - in /ofbiz/ofbiz-framework/trunk/applications: order/template/entry/ order/template/return/ product/template/inventory/ product/template/returns/

jleroux@apache.org
Author: jleroux
Date: Sat Nov 25 12:50:25 2017
New Revision: 1816291

URL: http://svn.apache.org/viewvc?rev=1816291&view=rev
Log:
Improved: Use ofbizCurrency macro and remove hardcoded ##0.00 string
(OFBIZ-9675)

ofbizAmount macro can be used.

jleroux: while applying the patch I noticed the use of ?default(0) where the
newer and simpler !0 could be used. Rather than only replacing this case here
I'll create a Jira and replace all such cases generalising to any value (that's
a lot: 1394 case!)

Thanks: Renuka Srishti and Ritesh Kumar

Modified:
    ofbiz/ofbiz-framework/trunk/applications/order/template/entry/CheckoutPayment.ftl
    ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnItemInc.ftl
    ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnItems.ftl
    ofbiz/ofbiz-framework/trunk/applications/product/template/inventory/ReceiveInventory.ftl
    ofbiz/ofbiz-framework/trunk/applications/product/template/returns/ReceiveReturn.ftl

Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/entry/CheckoutPayment.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/entry/CheckoutPayment.ftl?rev=1816291&r1=1816290&r2=1816291&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/template/entry/CheckoutPayment.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/template/entry/CheckoutPayment.ftl Sat Nov 25 12:50:25 2017
@@ -184,7 +184,7 @@ var issuerId = "";
                       <label for="checkOutPayment_${paymentMethod.paymentMethodId}">${uiLabelMap.AccountingGift}:${giftCardNumber}</label>
                         <#if paymentMethod.description?has_content>(${paymentMethod.description})</#if>
                         <a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'EG', '${paymentMethod.paymentMethodId}');" class="button">${uiLabelMap.CommonUpdate}</a>
-                        <strong>${uiLabelMap.OrderBillUpTo}:</strong> <input type="text" size="5" class="inputBox" name="amount_${paymentMethod.paymentMethodId}" value="<#if (cart.getPaymentAmount(paymentMethod.paymentMethodId)?default(0) > 0)>${cart.getPaymentAmount(paymentMethod.paymentMethodId)?string("##0.00")}</#if>" />
+                        <strong>${uiLabelMap.OrderBillUpTo}:</strong> <input type="text" size="5" class="inputBox" name="amount_${paymentMethod.paymentMethodId}" value="<#if (cart.getPaymentAmount(paymentMethod.paymentMethodId)?default(0) > 0)><@ofbizAmount amount=cart.getPaymentAmount(paymentMethod.paymentMethodId)!/></#if>"/>
                   </div>
                  </#if>
                 <#elseif "CREDIT_CARD" == paymentMethod.paymentMethodTypeId>
@@ -195,7 +195,7 @@ var issuerId = "";
                       <label for="checkOutPayment_${paymentMethod.paymentMethodId}">CC:${Static["org.apache.ofbiz.party.contact.ContactHelper"].formatCreditCard(creditCard)}</label>
                         <#if paymentMethod.description?has_content>(${paymentMethod.description})</#if>
                         <a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'EC', '${paymentMethod.paymentMethodId}');" class="button">${uiLabelMap.CommonUpdate}</a>
-                        <label for="amount_${paymentMethod.paymentMethodId}"><strong>${uiLabelMap.OrderBillUpTo}:</strong></label><input type="text" size="5" class="inputBox" id="amount_${paymentMethod.paymentMethodId}" name="amount_${paymentMethod.paymentMethodId}" value="<#if (cart.getPaymentAmount(paymentMethod.paymentMethodId)?default(0) > 0)>${cart.getPaymentAmount(paymentMethod.paymentMethodId)?string("##0.00")}</#if>" />
+                        <label for="amount_${paymentMethod.paymentMethodId}"><strong>${uiLabelMap.OrderBillUpTo}:</strong></label><input type="text" size="5" class="inputBox" id="amount_${paymentMethod.paymentMethodId}" name="amount_${paymentMethod.paymentMethodId}" value="<#if (cart.getPaymentAmount(paymentMethod.paymentMethodId)?default(0) > 0)><@ofbizAmount amount=cart.getPaymentAmount(paymentMethod.paymentMethodId)!/></#if>" />
                   </div>
                  </#if>
                 <#elseif "EFT_ACCOUNT" == paymentMethod.paymentMethodTypeId>

Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnItemInc.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnItemInc.ftl?rev=1816291&r1=1816290&r2=1816291&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnItemInc.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnItemInc.ftl Sat Nov 25 12:50:25 2017
@@ -72,7 +72,7 @@ under the License.
                 ${StringUtil.wrapString(description)?default("N/A")}
               </td>
               <td>
-                ${orderItem.amount?string("##0.00")}
+                <@ofbizAmount amount=orderItem.amount!/>
                 <#--<input type="text" size="8" name="amount_o_${rowCount}" <#if orderItem.amount?has_content>value="${orderItem.amount?string("##0.00")}"</#if>/>-->
               </td>
               <td></td>
@@ -127,7 +127,7 @@ under the License.
                   <#if "ASSET_USAGE_OUT_IN" == product.productTypeId>
                     <input type="text" size="8" name="returnPrice_o_${rowCount}" value="0.00"/>
                   <#else>
-                    <input type="text" size="8" name="returnPrice_o_${rowCount}" value="${returnableItems.get(orderItem).get("returnablePrice")?string("##0.00")}"/>
+                    <input type="text" size="8" name="returnPrice_o_${rowCount}" value="<@ofbizAmount amount=returnableItems.get(orderItem).get("returnablePrice")/>"/>
                   </#if>
                 </#if>
               </td>
@@ -191,7 +191,7 @@ under the License.
             </div>
           </td>
           <td>
-            <input type="text" size="8" name="amount_o_${rowCount}" <#if adj.amount?has_content>value="${adj.amount?string("##0.00")}"</#if>/>
+            <input type="text" size="8" name="amount_o_${rowCount}" <#if adj.amount?has_content>value="<@ofbizAmount amount=adj.amount!/>"</#if>/>
           </td>
           <td>
             <select name="returnTypeId_o_${rowCount}">
@@ -228,7 +228,7 @@ under the License.
         <input type="text" size="30" name="description_o_${rowCount}" />
       </td>
       <td>
-        <input type="text" size="8" name="amount_o_${rowCount}" value="${0.00?string("##0.00")}"/>
+        <input type="text" size="8" name="amount_o_${rowCount}" value="<@ofbizAmount amount=0.00/>"/>
       </td>
       <td>
         <select name="returnTypeId_o_${rowCount}">

Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnItems.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnItems.ftl?rev=1816291&r1=1816290&r2=1816291&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnItems.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/template/return/ReturnItems.ftl Sat Nov 25 12:50:25 2017
@@ -31,7 +31,7 @@ under the License.
         </div></td>
         <#if (adjEditable)>
            <td align="right">
-              <input type="text" size="8" name="amount_o_${rowCount}" value="${returnAdjustment.amount?default(0)?string("##0.00")}"/>
+              <input type="text" size="8" name="amount_o_${rowCount}" value="<@ofbizAmount amount=returnAdjustment.amount?default(0)/>"/>
            </td>
         <#else>
            <td align="right"><@ofbizCurrency amount=returnAdjustment.amount?default(0) isoCode=returnHeader.currencyUomId/></td>

Modified: ofbiz/ofbiz-framework/trunk/applications/product/template/inventory/ReceiveInventory.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/template/inventory/ReceiveInventory.ftl?rev=1816291&r1=1816290&r2=1816291&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/template/inventory/ReceiveInventory.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/template/inventory/ReceiveInventory.ftl Sat Nov 25 12:50:25 2017
@@ -54,7 +54,7 @@ under the License.
                   <td>${item.orderItemSeqId}</td>
                   <td>${item.productId?default("Not Found")}</td>
                   <td>${item.lotId?default("")}</td>
-                  <td>${item.unitCost?default(0)?string("##0.00")}</td>
+                  <td><@ofbizAmount amount=item.unitCost?default(0)/></td>
                   <td>${item.quantityRejected?default(0)?string.number}</td>
                   <td>${item.quantityAccepted?string.number}</td>
                   <td>

Modified: ofbiz/ofbiz-framework/trunk/applications/product/template/returns/ReceiveReturn.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/template/returns/ReceiveReturn.ftl?rev=1816291&r1=1816290&r2=1816291&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/template/returns/ReceiveReturn.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/template/returns/ReceiveReturn.ftl Sat Nov 25 12:50:25 2017
@@ -45,7 +45,7 @@ under the License.
                 <td>${item.returnId}</td>
                 <td>${item.returnItemSeqId}</td>
                 <td>${item.productId?default("Not Found")}</td>
-                <td>${item.unitCost?default(0)?string("##0.00")}</td>
+                <td><@ofbizAmount amount=item.unitCost?default(0)/></td>
                 <td>${item.quantityAccepted?string.number}</td>
               </tr>
             </#list>
@@ -204,7 +204,7 @@ under the License.
                           </#if>
                           <td align="right" nowrap="nowrap" class="label">${uiLabelMap.ProductPerUnitPrice}</td>
                           <td align="right">
-                            <input type='text' name='unitCost_o_${rowCount}' size='6' value='${unitCost?default(0)?string("##0.00")}' />
+                            <input type='text' name='unitCost_o_${rowCount}' size='6' value='<@ofbizAmount amount=unitCost?default(0)/>' />
                           </td>
                         </tr>
                       </table>