You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2015/03/15 21:11:52 UTC

svn commit: r1666837 - in /ofbiz/branches/release14.12: ./ applications/order/src/org/ofbiz/order/order/OrderReturnServices.java applications/order/webapp/ordermgr/return/returnItems.ftl

Author: jleroux
Date: Sun Mar 15 20:11:51 2015
New Revision: 1666837

URL: http://svn.apache.org/r1666837
Log:
"Applied fix from trunk for revision: 1666836" 
------------------------------------------------------------------------
r1666836 | jleroux | 2015-03-15 21:09:23 +0100 (dim., 15 mars 2015) | 10 lines

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/branches/release14.12/   (props changed)
    ofbiz/branches/release14.12/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
    ofbiz/branches/release14.12/applications/order/webapp/ordermgr/return/returnItems.ftl

Propchange: ofbiz/branches/release14.12/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Mar 15 20:11:51 2015
@@ -8,4 +8,4 @@
 /ofbiz/branches/json-integration-refactoring:1634077-1635900
 /ofbiz/branches/multitenant20100310:921280-927264
 /ofbiz/branches/release13.07:1547657
-/ofbiz/trunk:1649072,1649083-1649084,1649086,1649090,1649096,1649230,1649238-1649239,1649248,1649272,1649275,1649280-1649281,1649283,1649285-1649286,1649291,1649329,1649331,1649384,1649393,1649666,1649742,1650240,1650348,1650357,1650583,1650642,1650678,1650821,1650882,1650887,1650938,1651593,1652312,1652361,1652638,1652641,1652672,1652688,1652706,1652725,1652731,1652739,1652852,1653248,1653296,1653456,1653597,1653614,1654175,1654273,1654509,1654670,1654672-1654673,1654683-1654684,1654824,1655046,1655668,1655979,1656014,1656185,1656198,1656445,1656983,1657323,1657506-1657507,1657514,1657714,1657790,1657848,1658364,1658662,1658882,1659224,1659965,1660031,1660053,1660389,1660444,1660579,1661303,1661328,1661760,1661778,1661853,1661862,1661873,1661940,1661951,1661977,1662119-1662120,1662361,1662500,1662812,1662919,1663202,1663912,1663979,1664602,1664604,1664696,1665154,1665162,1665535,1666404,1666511,1666633
+/ofbiz/trunk:1649072,1649083-1649084,1649086,1649090,1649096,1649230,1649238-1649239,1649248,1649272,1649275,1649280-1649281,1649283,1649285-1649286,1649291,1649329,1649331,1649384,1649393,1649666,1649742,1650240,1650348,1650357,1650583,1650642,1650678,1650821,1650882,1650887,1650938,1651593,1652312,1652361,1652638,1652641,1652672,1652688,1652706,1652725,1652731,1652739,1652852,1653248,1653296,1653456,1653597,1653614,1654175,1654273,1654509,1654670,1654672-1654673,1654683-1654684,1654824,1655046,1655668,1655979,1656014,1656185,1656198,1656445,1656983,1657323,1657506-1657507,1657514,1657714,1657790,1657848,1658364,1658662,1658882,1659224,1659965,1660031,1660053,1660389,1660444,1660579,1661303,1661328,1661760,1661778,1661853,1661862,1661873,1661940,1661951,1661977,1662119-1662120,1662361,1662500,1662812,1662919,1663202,1663912,1663979,1664602,1664604,1664696,1665154,1665162,1665535,1666404,1666511,1666633,1666836

Modified: ofbiz/branches/release14.12/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release14.12/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?rev=1666837&r1=1666836&r2=1666837&view=diff
==============================================================================
--- ofbiz/branches/release14.12/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original)
+++ ofbiz/branches/release14.12/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Sun Mar 15 20:11:51 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/branches/release14.12/applications/order/webapp/ordermgr/return/returnItems.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/release14.12/applications/order/webapp/ordermgr/return/returnItems.ftl?rev=1666837&r1=1666836&r2=1666837&view=diff
==============================================================================
--- ofbiz/branches/release14.12/applications/order/webapp/ordermgr/return/returnItems.ftl (original)
+++ ofbiz/branches/release14.12/applications/order/webapp/ordermgr/return/returnItems.ftl Sun Mar 15 20:11:51 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="<@o...@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>