svn commit: r940851 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/order/OrderReturnServices.java specialpurpose/googlecheckout/servicedef/secas.xml

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

svn commit: r940851 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/order/OrderReturnServices.java specialpurpose/googlecheckout/servicedef/secas.xml

mor-2
Author: mor
Date: Tue May  4 13:35:19 2010
New Revision: 940851

URL: http://svn.apache.org/viewvc?rev=940851&view=rev
Log:
Fixed a bug in vendor return. The service getReturnableItems returns a map containing the returable quantity corresponding to an item along with
certain other things. Earlier this service was returning an empty map for a purchase order and a vendor return. On order detail page action
block there is a check on this map and if the map comes out to be empty the system does not show the options to create return for the
purchase order. Similary if you create a vendor return directly from the Return Header screen and try to add items on the Return Item screen
using an order Id, this display a message "No returnable items found for order"

Also the method sendItemsShipped in the service sendGoogleShipRequest was throwing a NPE because the code try to pull a product through
ItemIssuance > OrderItem > Product

In the vendor return of type refund the items are issued to the return shipment and a purchase return invoice is generated and hence the process
is not linked to any Order. Adding a condition on the ECA so that this service is not invoked.


Modified:
    ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
    ofbiz/trunk/specialpurpose/googlecheckout/servicedef/secas.xml

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=940851&r1=940850&r2=940851&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 Tue May  4 13:35:19 2010
@@ -492,6 +492,7 @@ public class OrderReturnServices {
                     }
                     // items not issued/shipped are considered as returnable only if they are
                     // not physical items
+                    if ("SALES_ORDER".equals(orderHeader.getString("orderTypeId"))) {
                     BigDecimal quantityIssued = orderItemQuantityIssued.getBigDecimal("quantityIssued");
                     if (UtilValidate.isEmpty(quantityIssued) || quantityIssued.compareTo(BigDecimal.ZERO) == 0) {
                         try {
@@ -505,6 +506,7 @@ public class OrderReturnServices {
                         }
 
                     }
+                    }
                     Map serviceResult = null;
                     try {
                         serviceResult = dispatcher.runSync("getReturnableQuantity", UtilMisc.toMap("orderItem", item));

Modified: ofbiz/trunk/specialpurpose/googlecheckout/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlecheckout/servicedef/secas.xml?rev=940851&r1=940850&r2=940851&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/googlecheckout/servicedef/secas.xml (original)
+++ ofbiz/trunk/specialpurpose/googlecheckout/servicedef/secas.xml Tue May  4 13:35:19 2010
@@ -49,6 +49,7 @@ under the License.
     <eca service="updateShipment" event="commit" run-on-failure="false" run-on-error="false">
         <condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/>
         <condition field-name="statusId" operator="equals" value="SHIPMENT_SHIPPED"/>
+        <condition field-name="shipmentTypeId" operator="not-equals" value="PURCHASE_RETURN"/>
         <action service="sendGoogleShipRequest" mode="sync"/>
     </eca>