ofbiz-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jler...@apache.org
Subject svn commit: r1666836 - in /ofbiz/trunk/applications/order: src/org/ofbiz/order/order/OrderReturnServices.java webapp/ordermgr/return/returnItems.ftl
Date Sun, 15 Mar 2015 20:09:23 GMT
Author: jleroux
Date: Sun Mar 15 20:09:23 2015
New Revision: 1666836

URL: http://svn.apache.org/r1666836
Log:
A patch from Christian Carlow for "returnItems.ftl freemarker null error when returnPrice
or returnQuantity is  null" https://issues.apache.org/jira/browse/OFBIZ-6142

Error:
FreeMarker template error: The following has evaluated to null or missing: ==> null [in
template "component://order/webapp/ordermgr/return/returnItems.ftl" at line 155, column 48]
To reproduce just update the quantity or price of a return item to blank.

Fix:
Prevents Freemarker errors from appearing in the quantity and price input fields when they
are set to blank. Perhaps logic should be implemented to prevent the fields from being updated
to blank but as of right now its allowed which cause the errors to appear which make the screen
look very messy. This patch basically cleans up the screen if either of those scenarios occur.
Prevents OrderView.groovy getReturnableItems error which prevents page from displaying when
returnQuantity gets set to blank due to getReturnableQuantity in OrderReturnServices.java.

Modified:
    ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
    ofbiz/trunk/applications/order/webapp/ordermgr/return/returnItems.ftl

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?rev=1666836&r1=1666835&r2=1666836&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Sun
Mar 15 20:09:23 2015
@@ -439,7 +439,9 @@ public class OrderReturnServices {
                     }
                     String returnStatus = returnHeader.getString("statusId");
                     if (!returnStatus.equals("RETURN_CANCELLED")) {
-                        returnedQty = returnedQty.add(returnItem.getBigDecimal("returnQuantity"));
+                        if(!UtilValidate.isEmpty(returnItem.getBigDecimal("returnQuantity"))){
+                            returnedQty = returnedQty.add(returnItem.getBigDecimal("returnQuantity"));
  
+                        } 
                     }
                 }
                 if (returnedQty.compareTo(orderQty) < 0) {

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/return/returnItems.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnItems.ftl?rev=1666836&r1=1666835&r2=1666836&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/return/returnItems.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/return/returnItems.ftl Sun Mar 15 20:09:23
2015
@@ -151,8 +151,6 @@ under the License.
               <#if (item.get("returnQuantity")?? && item.get("returnPrice")??)>
                  <#assign returnTotal = returnTotal + item.get("returnQuantity") * item.get("returnPrice")
>
                  <#assign returnItemSubTotal = item.get("returnQuantity") * item.get("returnPrice")
>
-              <#else>
-                 <#assign returnItemSubTotal = null >  <#-- otherwise the last item's
might carry over -->
               </#if>
               <tr valign="middle"<#if alt_row> class="alternate-row"</#if>>
                 <td><a href="<@ofbizUrl>orderview?orderId=${item.orderId}</@ofbizUrl>"
class="buttontext">${item.orderId}</a> - ${item.orderItemSeqId?default("N/A")}
@@ -179,7 +177,7 @@ under the License.
                     <#if readOnly>
                         ${item.returnQuantity?string.number}
                     <#else>
-                        <input name="returnQuantity_o_${rowCount}" value="${item.returnQuantity}"
type="text" size="8" align="right" />
+                        <input name="returnQuantity_o_${rowCount}" value="${item.returnQuantity?if_exists}"
type="text" size="8" align="right" />
                     </#if>
                     <#if item.receivedQuantity??>
                     <br />${uiLabelMap.OrderTotalQuantityReceive}: ${item.receivedQuantity}
@@ -192,7 +190,7 @@ under the License.
                     <#if readOnly>
                         <@ofbizCurrency amount=item.returnPrice isoCode=orderHeader.currencyUom/>
                     <#else>
-                        <input name="returnPrice_o_${rowCount}" value="${item.returnPrice}"
type="text" size="8" align="right" />
+                        <input name="returnPrice_o_${rowCount}" value="${item.returnPrice?if_exists}"
type="text" size="8" align="right" />
                     </#if>
                     </div></td>
                 <td>



Mime
View raw message