Author: jleroux Date: Sat Jan 21 11:15:17 2017 New Revision: 1779724 URL: http://svn.apache.org/viewvc?rev=1779724&view=rev Log: Fixed: "View Order" throws exception in getReturnableQuantity (OFBIZ-9157)
Steps to Reproduce: - Create a sales order - Add 1 orderitem with no unitPrice set (unitPrice = null) for the product - set the status of the order to completed - go to order-management and try to open the order for display like: https://localhost:8443/ordermgr/control/orderview?orderId=XXXXX Expected: - the order is displayed with status completed Actual: - A groovy exception is displayed. Analysis: The service "getReturnableQuantity" throws an exception because it returns the returnablePrice = null, because the unitPrice of the orderItem was null. The OUT field returnablePrice is mandatory according to the service-definition. The return parameter is set but the value is null, hence the exception. Solution: adjust the service-definition to allow for "null" value of the returnablePrice OUT parameter. Thanks: Leonard Lin Modified: ofbiz/trunk/applications/order/servicedef/services_return.xml Modified: ofbiz/trunk/applications/order/servicedef/services_return.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_return.xml?rev=1779724&r1=1779723&r2=1779724&view=diff ============================================================================== --- ofbiz/trunk/applications/order/servicedef/services_return.xml (original) +++ ofbiz/trunk/applications/order/servicedef/services_return.xml Sat Jan 21 11:15:17 2017 @@ -297,7 +297,7 @@ under the License. <description>Get the quantity allowed for an item to be returned</description> <attribute name="orderItem" type="org.apache.ofbiz.entity.GenericValue" mode="IN" optional="false"/> <attribute name="returnableQuantity" type="BigDecimal" mode="OUT" optional="false"/> - <attribute name="returnablePrice" type="BigDecimal" mode="OUT" optional="false"/> + <attribute name="returnablePrice" type="BigDecimal" mode="OUT" optional="true"/> </service> <service name="getReturnableItems" engine="java" location="org.apache.ofbiz.order.order.OrderReturnServices" invoke="getReturnableItems">

