You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jo...@apache.org on 2011/02/20 11:43:02 UTC

svn commit: r1072551 - in /ofbiz/trunk/applications: order/servicedef/ order/webapp/ordermgr/return/ product/script/org/ofbiz/shipment/receipt/ product/script/org/ofbiz/shipment/shipment/

Author: jonesde
Date: Sun Feb 20 10:43:02 2011
New Revision: 1072551

URL: http://svn.apache.org/viewvc?rev=1072551&view=rev
Log:
More changes to support CUSTOMER_* return types instead of just CUSTOMER_RETURN to facilitate certain customizations; fixed two issues with needsInventoryReceive causing it to not run because the SECA rule looking for it was attached to a service that was often called without passing that in; changed the quickReceiveReturn change of status to received to be more robust by looking at the status instead of figuring it out based on item types

Modified:
    ofbiz/trunk/applications/order/servicedef/secas.xml
    ofbiz/trunk/applications/order/webapp/ordermgr/return/returnItems.ftl
    ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
    ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml

Modified: ofbiz/trunk/applications/order/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/secas.xml?rev=1072551&r1=1072550&r2=1072551&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/secas.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/secas.xml Sun Feb 20 10:43:02 2011
@@ -195,7 +195,9 @@ under the License.
     </eca>
     <eca service="updateReturnHeader" event="return">
         <condition field-name="statusId" operator="equals" value="RETURN_ACCEPTED"/>
-        <condition field-name="needsInventoryReceive" operator="equals" value="Y"/>
+        <!-- The quickReceiveReturn service checks this, and some status update calls may not pass it in, so don't
+             check it here or the option may be ignored.
+         <condition field-name="needsInventoryReceive" operator="equals" value="Y"/> -->
         <action service="quickReceiveReturn" mode="sync"/>
     </eca>
     <eca service="updateReturnHeader" event="commit">

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=1072551&r1=1072550&r2=1072551&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/return/returnItems.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/return/returnItems.ftl Sun Feb 20 10:43:02 2011
@@ -69,7 +69,7 @@ under the License.
 </#macro>
 
     <#if returnHeader?has_content>
-      <#if returnHeader.destinationFacilityId?has_content && returnHeader.statusId == "RETURN_ACCEPTED" && returnHeader.returnHeaderTypeId == "CUSTOMER_RETURN">
+      <#if returnHeader.destinationFacilityId?has_content && returnHeader.statusId == "RETURN_ACCEPTED" && returnHeader.returnHeaderTypeId?starts_with("CUSTOMER_")>
         <#list returnShipmentIds as returnShipmentId>
           <a href="/facility/control/ViewShipment?shipmentId=${returnShipmentId.shipmentId}${externalKeyParam}" class="buttontext">${uiLabelMap.ProductShipmentId} ${returnShipmentId.shipmentId}</a>
           <a href="/facility/control/ReceiveReturn?facilityId=${returnHeader.destinationFacilityId}&amp;returnId=${returnHeader.returnId?if_exists}&amp;shipmentId=${returnShipmentId.shipmentId}${externalKeyParam}" class="buttontext">${uiLabelMap.OrderReceiveReturn}</a>
@@ -98,11 +98,7 @@ under the License.
           <form method="post" action="<@o...@ofbizUrl>">
           <input type="hidden" name="_useRowSubmit" value="Y" />
         <table cellspacing="0" class="basic-table">
-          <#if "CUSTOMER_RETURN" == returnHeader.returnHeaderTypeId>
-            <#assign readOnly = (returnHeader.statusId != "RETURN_REQUESTED")>
-          <#else>
-            <#assign readOnly = (returnHeader.statusId != "SUP_RETURN_REQUESTED")>
-          </#if>
+          <#assign readOnly = (returnHeader.statusId != "RETURN_REQUESTED" && returnHeader.statusId != "SUP_RETURN_REQUESTED")>
           <tr><td colspan="10"><h3>${uiLabelMap.OrderOrderReturn} #${returnId}</h3></td></tr>
 
           <#-- information about orders and amount refunded/credited on past returns -->
@@ -336,13 +332,14 @@ under the License.
         <#if (returnHeader.statusId == "RETURN_REQUESTED" || returnHeader.statusId == "SUP_RETURN_REQUESTED") && (rowCount > 0)>
         <br />
         <form name="acceptReturn" method="post" action="<@o...@ofbizUrl>">
-          <#if "CUSTOMER_RETURN" == returnHeader.returnHeaderTypeId>
+          <#if returnHeader.returnHeaderTypeId?starts_with("CUSTOMER_")>
             <#assign statusId = "RETURN_ACCEPTED">
           <#else>
             <#assign statusId = "SUP_RETURN_ACCEPTED">
           </#if>
           <input type="hidden" name="returnId" value="${returnId}" />
           <input type="hidden" name="statusId" value="${statusId}" />
+          <input type="hidden" name="needsInventoryReceive" value="${returnHeader.needsInventoryReceive!"N"}" />
           <div align="right"><input type="submit" value="${uiLabelMap.OrderReturnAccept}" /></div>
         </form>
         </#if>

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml?rev=1072551&r1=1072550&r2=1072551&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml Sun Feb 20 10:43:02 2011
@@ -330,12 +330,12 @@ under the License.
                 <set field="returnHeader.needsInventoryReceive" value="N"/>
                 <store-value value-field="returnHeader"/>
 
-                <!-- check if we need to manually update the status -->
-                <if-compare-field field="nonProductItems" to-field="returnItemCount" operator="equals" type="Long">
+                <!-- always check/update the ReturnHeader status, even though it might have been from the receiving above, just make sure -->
+                <if-compare field="returnHeader.statusId" operator="not-equals" value="RETURN_RECEIVED">
                     <set field="retStCtx.returnId" from-field="returnHeader.returnId"/>
                     <set field="retStCtx.statusId" value="RETURN_RECEIVED"/>
                     <call-service service-name="updateReturnHeader" in-map-name="retStCtx"/>
-                </if-compare-field>
+                </if-compare>
             <else>
                 <log level="info" message="Not receiving inventory for returnId ${returnHeader.returnId}, no inventory information available."/>
             </else>

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml?rev=1072551&r1=1072550&r2=1072551&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml Sun Feb 20 10:43:02 2011
@@ -303,7 +303,7 @@ under the License.
         <!-- later different behavior for customer vs. returns would happen here -->
         <if>
             <condition>
-                <if-compare value="CUSTOMER_RETURN" field="returnHeader.returnHeaderTypeId" operator="equals"/>
+                <if-compare field="returnHeader.returnHeaderTypeId" operator="contains" value="CUSTOMER_"/>
             </condition>
             <then>
                 <set field="shipmentCtx.shipmentTypeId" value="SALES_RETURN"/>
@@ -311,7 +311,7 @@ under the License.
             </then>
         <else-if>
             <condition>
-                <if-compare value="VENDOR_RETURN" field="returnHeader.returnHeaderTypeId" operator="equals"/>
+                <if-compare field="returnHeader.returnHeaderTypeId" operator="equals" value="VENDOR_RETURN"/>
             </condition>
             <then>
                 <set field="shipmentCtx.shipmentTypeId" value="PURCHASE_RETURN"/>