svn commit: r778463 - in /ofbiz/trunk/applications/order: config/ entitydef/ script/org/ofbiz/order/order/ servicedef/ webapp/ordermgr/WEB-INF/ webapp/ordermgr/WEB-INF/actions/return/ webapp/ordermgr/return/ widget/ordermgr/

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

svn commit: r778463 - in /ofbiz/trunk/applications/order: config/ entitydef/ script/org/ofbiz/order/order/ servicedef/ webapp/ordermgr/WEB-INF/ webapp/ordermgr/WEB-INF/actions/return/ webapp/ordermgr/return/ widget/ordermgr/

mor-2
Author: mor
Date: Mon May 25 18:02:47 2009
New Revision: 778463

URL: http://svn.apache.org/viewvc?rev=778463&view=rev
Log:
Enable audit for few fields on ReturnItem entity namely returnTypeId, returnReasonId, returnQuantity, receivedQuantity and returnPrice. The history of changes on these fields
can be viewed through new tab Return History. Also added a new service for creating return status and removed the inline code that was used earlier to create Return Status.
Patch applied from Awdesh Singh Parihar, part of OFBIZ-2483 (https://issues.apache.org/jira/browse/OFBIZ-2483)

Added:
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/ReturnHistory.groovy   (with props)
Modified:
    ofbiz/trunk/applications/order/config/OrderUiLabels.xml
    ofbiz/trunk/applications/order/entitydef/entitymodel.xml
    ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml
    ofbiz/trunk/applications/order/servicedef/secas.xml
    ofbiz/trunk/applications/order/servicedef/services_return.xml
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
    ofbiz/trunk/applications/order/webapp/ordermgr/return/ReturnForms.xml
    ofbiz/trunk/applications/order/webapp/ordermgr/return/returnLinks.ftl
    ofbiz/trunk/applications/order/widget/ordermgr/OrderReturnScreens.xml

Modified: ofbiz/trunk/applications/order/config/OrderUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderUiLabels.xml?rev=778463&r1=778462&r2=778463&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/config/OrderUiLabels.xml (original)
+++ ofbiz/trunk/applications/order/config/OrderUiLabels.xml Mon May 25 18:02:47 2009
@@ -6983,6 +6983,9 @@
         <value xml:lang="zh">在其它交付订单上</value>
         <value xml:lang="zh_CN">在其他订单中接收</value>
     </property>
+    <property key="OrderReceivedQtyHistory">
+        <value xml:lang="en">Received Quantity History</value>
+    </property>
     <property key="OrderReference">
         <value xml:lang="de">Referenz</value>
         <value xml:lang="en">Reference</value>
@@ -7663,6 +7666,9 @@
         <value xml:lang="zh">退货头</value>
         <value xml:lang="zh_CN">退货单</value>
     </property>
+    <property key="OrderReturnHistory">
+        <value xml:lang="en">Return History</value>
+    </property>
     <property key="OrderReturnId">
         <value xml:lang="de">Retoure ID</value>
         <value xml:lang="en">Return ID</value>
@@ -7785,6 +7791,9 @@
         <value xml:lang="th">คืนราคา</value>
         <value xml:lang="zh">退货价格</value>
     </property>
+    <property key="OrderReturnPriceHistory">
+        <value xml:lang="en">Return Price History</value>
+    </property>
     <property key="OrderReturnPriceNotIncludeTax">
         <value xml:lang="de">Preis enthält keine Steueranpassungen</value>
         <value xml:lang="en">Price not includes tax  adjustments</value>
@@ -7809,6 +7818,9 @@
         <value xml:lang="th">การกลับคืนจำนวน</value>
         <value xml:lang="zh">退货数量</value>
     </property>
+    <property key="OrderReturnQtyHistory">
+        <value xml:lang="en">Return Quantity History</value>
+    </property>
     <property key="OrderReturnReason">
         <value xml:lang="de">Grund</value>
         <value xml:lang="en">Reason</value>
@@ -7821,6 +7833,9 @@
         <value xml:lang="th">เหตุผล</value>
         <value xml:lang="zh">原因</value>
     </property>
+    <property key="OrderReturnReasonHistory">
+        <value xml:lang="en">Return Reason History</value>
+    </property>
     <property key="OrderReturnReceive">
         <value xml:lang="de">Retoure entgegennehmen</value>
         <value xml:lang="en">Receive Return</value>
@@ -7935,6 +7950,9 @@
         <value xml:lang="th">ประเภท</value>
         <value xml:lang="zh">类型</value>
     </property>
+    <property key="OrderReturnTypeHistory">
+        <value xml:lang="en">Return Type History</value>
+    </property>
     <property key="OrderReturned">
         <value xml:lang="de">Zurückgesendet</value>
         <value xml:lang="en">Returned</value>

Modified: ofbiz/trunk/applications/order/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/entitydef/entitymodel.xml?rev=778463&r1=778462&r2=778463&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/order/entitydef/entitymodel.xml Mon May 25 18:02:47 2009
@@ -2413,10 +2413,10 @@
             title="Return Item Entity">
         <field name="returnId" type="id-ne"></field>
         <field name="returnItemSeqId" type="id-ne"></field>
-        <field name="returnReasonId" type="id">
+        <field name="returnReasonId" type="id" enable-audit-log="true">
             <description>why item is returned: did not like, wrong item, damaged, etc. etc.</description>
         </field>
-        <field name="returnTypeId" type="id">
+        <field name="returnTypeId" type="id" enable-audit-log="true">
             <description>actually used for disbursement type: store credit, cash refund, exchange</description>
         </field>
         <field name="returnItemTypeId" type="id">
@@ -2430,9 +2430,9 @@
         <field name="orderItemSeqId" type="id"></field>
         <field name="statusId" type="id"></field>
         <field name="expectedItemStatus" type="id"></field>
-        <field name="returnQuantity" type="fixed-point"><description>promised by the customer</description></field>
-        <field name="receivedQuantity" type="fixed-point"><description>actually received from the customer</description></field>
-        <field name="returnPrice" type="currency-amount"></field>
+        <field name="returnQuantity" type="fixed-point" enable-audit-log="true"><description>promised by the customer</description></field>
+        <field name="receivedQuantity" type="fixed-point" enable-audit-log="true"><description>actually received from the customer</description></field>
+        <field name="returnPrice" type="currency-amount" enable-audit-log="true"></field>
         <field name="returnItemResponseId" type="id"></field>
         <prim-key field="returnId"/>
         <prim-key field="returnItemSeqId"/>
@@ -2550,6 +2550,7 @@
         <field name="statusId" type="id"></field>
         <field name="returnId" type="id"></field>
         <field name="returnItemSeqId" type="id"></field>
+        <field name="changeByUserLoginId" type="id"></field>
         <field name="statusDatetime" type="date-time"></field>
         <prim-key field="returnStatusId"/>
         <relation type="one" fk-name="RTN_STTS_STTS" rel-entity-name="StatusItem">
@@ -2562,6 +2563,9 @@
             <key-map field-name="returnId"/>
             <key-map field-name="returnItemSeqId"/>
         </relation>
+        <relation type="one" fk-name="RS_USRLGN" title="ChangeBy" rel-entity-name="UserLogin">
+            <key-map field-name="changeByUserLoginId" rel-field-name="userLoginId"/>
+        </relation>
     </entity>
     <entity entity-name="ReturnType"
             package-name="org.ofbiz.order.return"

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml?rev=778463&r1=778462&r2=778463&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml Mon May 25 18:02:47 2009
@@ -531,19 +531,6 @@
                 <!-- update the status for the item -->
                 <set field="returnItem.statusId" value="RETURN_RECEIVED"/>
                 <store-value value-field="returnItem"/>
-
-                <!-- create status change history -->
-                <!-- TODO: this should be done with a createReturnStatus service call -->
-                <make-value entity-name="ReturnStatus" value-field="newReturnStatus"/>
-                <sequenced-id sequence-name="ReturnStatus" field="newReturnStatus.returnStatusId"/>
-
-                <set field="newReturnStatus.returnId" from-field="returnItem.returnItemSeqId"/>
-                <set field="newReturnStatus.returnId" from-field="returnItem.returnId"/>
-                <set field="newReturnStatus.statusId" from-field="returnItem.statusId"/>
-
-                <now-timestamp field="newReturnStatus.statusDatetime"/>
-
-                <create-value value-field="newReturnStatus"/>
             </if-compare-field>
 
             <!-- update the returnItem with at least receivedQuantity, and also statusId if applicable -->
@@ -583,16 +570,6 @@
             <set field="returnHeaderCtx.statusId" value="RETURN_RECEIVED"/>
             <set from-field="returnHeader.returnId" field="returnHeaderCtx.returnId"/>
             <call-service service-name="updateReturnHeader" in-map-name="returnHeaderCtx"/>
-            <!-- create the status history -->
-            <make-value entity-name="ReturnStatus" value-field="newValue"/>
-            <sequenced-id sequence-name="ReturnStatus" field="newValue.returnStatusId"/>
-
-            <set field="newValue.returnId" from-field="returnHeader.returnId"/>
-            <set field="newValue.statusId" value="RETURN_RECEIVED"/>
-
-            <now-timestamp field="newValue.statusDatetime"/>
-
-            <create-value value-field="newValue"/>
         </if-compare>
 
         <!-- return the current return header status -->
@@ -1106,4 +1083,18 @@
         </else>
         </if-not-empty>
     </simple-method>
+    
+    <simple-method method-name="createReturnStatus" short-description="Create Return Status">
+        <entity-one value-field="returnHeader" entity-name="ReturnHeader">
+            <field-map field-name="returnId" from-field="parameters.returnId"/>
+        </entity-one>
+        <make-value entity-name="ReturnStatus" value-field="newEntity"/>
+        <sequenced-id sequence-name="ReturnStatus" field="newEntity.returnStatusId"/>
+        <set field="newEntity.returnId" from-field="parameters.returnId"/>
+        <set field="newEntity.statusId" from-field="returnHeader.statusId"/>
+        <set field="newEntity.changeByUserLoginId" from-field="userLogin.userLoginId"/>
+        <now-timestamp field="newEntity.statusDatetime"/>
+        <create-value value-field="newEntity"/>
+    </simple-method>
+    
 </simple-methods>
\ No newline at end of file

Modified: ofbiz/trunk/applications/order/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/secas.xml?rev=778463&r1=778462&r2=778463&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/secas.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/secas.xml Mon May 25 18:02:47 2009
@@ -176,6 +176,10 @@
     </eca>
 
     <!-- Return ECAs -->
+
+    <eca service="createReturnHeader" event="commit">
+        <action service="createReturnStatus" mode="sync"/>
+    </eca>    
     <eca service="updateReturnHeader" event="commit">
         <action service="checkReturnComplete" mode="sync"/>
     </eca>
@@ -194,6 +198,7 @@
         <action service="createTrackingCodeOrderReturns" mode="sync" run-as-user="system"/>
         <action service="sendReturnAcceptNotification" mode="async" persist="true"/>
         <action service="processRefundImmediatelyReturn" mode="sync"/>
+        <action service="createReturnStatus" mode="sync"/>
     </eca>
 
     <eca service="updateReturnHeader" event="commit">
@@ -205,6 +210,7 @@
         <action service="processRepairReplacementReturn" mode="sync"/>
         <action service="processCreditReturn" mode="sync"/>
         <action service="processRefundOnlyReturn" mode="sync"/>
+        <action service="createReturnStatus" mode="sync"/>
     </eca>
     <eca service="updateReturnStatusFromReceipt" event="global-commit">
         <condition field-name="returnHeaderStatus" operator="equals" value="RETURN_RECEIVED"/>
@@ -220,16 +226,19 @@
         <condition field-name="oldStatusId" operator="not-equals" value="RETURN_COMPLETED"/>
         <action service="sendReturnCompleteNotification" mode="async" persist="true"/>
         <action service="processSubscriptionReturn" mode="sync"/>
+        <action service="createReturnStatus" mode="sync"/>
     </eca>
     <eca service="updateReturnHeader" event="commit">
         <condition field-name="statusId" operator="equals" value="RETURN_CANCELLED"/>
         <condition field-name="oldStatusId" operator="not-equals" value="RETURN_CANCELLED"/>
         <action service="cancelReturnItems" mode="sync"/>
+        <action service="createReturnStatus" mode="sync"/>
         <action service="sendReturnCancelNotification" mode="async" persist="true"/>
     </eca>
     <eca service="updateReturnHeader" event="commit">
         <condition field-name="statusId" operator="equals" value="SUP_RETURN_SHIPPED"/>
         <condition field-name="oldStatusId" operator="not-equals" value="SUP_RETURN_SHIPPED"/>
+        <action service="createReturnStatus" mode="sync"/>
         <action service="processWaitReplacementReturn" mode="sync"/>
     </eca>
 
@@ -351,4 +360,4 @@
         <set field-name="emailTemplateSettingId" value="CUST_REQ_COMPLETED"/>
         <action service="sendMailFromTemplateSetting" mode="sync"/>
     </eca>
-</service-eca>
+</service-eca>
\ No newline at end of file

Modified: ofbiz/trunk/applications/order/servicedef/services_return.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_return.xml?rev=778463&r1=778462&r2=778463&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services_return.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services_return.xml Mon May 25 18:02:47 2009
@@ -339,4 +339,9 @@
         <attribute name="returnId" type="String" mode="IN" optional="true"/>
         <attribute name="inventoryItemId" type="String" mode="IN" optional="true"/>
     </service>
+    <service name="createReturnStatus" default-entity-name="ReturnHeader" engine="simple"
+            location="component://order/script/org/ofbiz/order/order/OrderReturnServices.xml" invoke="createReturnStatus">
+        <description>Create Return Status</description>
+        <attribute name="returnId" type="String" mode="IN" optional="false"/>
+    </service>
 </services>

Added: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/ReturnHistory.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/ReturnHistory.groovy?rev=778463&view=auto
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/ReturnHistory.groovy (added)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/ReturnHistory.groovy Mon May 25 18:02:47 2009
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.ofbiz.entity.condition.EntityCondition;
+import org.ofbiz.entity.condition.EntityOperator;
+
+commonReturnHistoryCond = [EntityCondition.makeCondition("changedEntityName", EntityOperator.EQUALS, "ReturnItem"),
+                           EntityCondition.makeCondition("changedFieldName", EntityOperator.EQUALS, entityField),
+                           EntityCondition.makeCondition("pkCombinedValueText", EntityOperator.LIKE, returnId + "%"),
+                           EntityCondition.makeCondition("newValueText", EntityOperator.NOT_EQUAL, null),
+                           EntityCondition.makeCondition("oldValueText", EntityOperator.NOT_EQUAL, null)];
+
+returnHistoryList = delegator.findList("EntityAuditLog", EntityCondition.makeCondition(commonReturnHistoryCond, EntityOperator.AND), null, null, null, false);
+
+orderReturnItemHistories = [];
+returnHistoryList.each { returnHistory ->
+    if ("returnTypeId".equals(entityField) || "returnReasonId".equals(entityField)) {
+        if (returnHistory.newValueText.toString() != returnHistory.oldValueText.toString()) {
+            orderReturnItemHistories.add(returnHistory);
+        }
+    } else if ((Float.valueOf(returnHistory.oldValueText)).compareTo(Float.valueOf(returnHistory.newValueText)) != 0) {
+            orderReturnItemHistories.add(returnHistory);
+    }
+}
+context.orderReturnItemHistories = orderReturnItemHistories;
\ No newline at end of file

Propchange: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/ReturnHistory.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/ReturnHistory.groovy
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/return/ReturnHistory.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?rev=778463&r1=778462&r2=778463&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Mon May 25 18:02:47 2009
@@ -1531,6 +1531,11 @@
         <security auth="true" https="true"/>
         <response name="success" type="view" value="LookupProductCategory"/>
     </request-map>
+    
+    <request-map uri="ReturnHistory">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="ReturnHistory"/>
+    </request-map>
 
     <request-map uri="LookupContent"><security auth="true" https="true"/><response name="success" type="view" value="LookupContent"/></request-map>
     <!--
@@ -1712,5 +1717,6 @@
     <view-map name="OrderPickSheetPDF" type="screenfop" page="component://product/widget/facility/FacilityScreens.xml#PrintPickSheets.fo" content-type="application/pdf" encoding="none"/>
 
     <view-map name="SendConfirmationMail" type="screen" page="component://order/widget/ordermgr/OrderViewScreens.xml#SendOrderConfirmation"/>
+    <view-map name="ReturnHistory" type="screen" page="component://order/widget/ordermgr/OrderReturnScreens.xml#OrderReturnHistory"/>
     <!-- end of view mappings -->
 </site-conf>

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/return/ReturnForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/return/ReturnForms.xml?rev=778463&r1=778462&r2=778463&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/return/ReturnForms.xml (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/return/ReturnForms.xml Mon May 25 18:02:47 2009
@@ -177,4 +177,52 @@
             <display-entity entity-name="StatusItem" key-field-name="statusId" description="${description}"/>
         </field>
     </form>
+
+    <form name="ReturnStatusHistory" type="list" list-name="orderReturnStatusHistories"
+            odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <field name="returnId"><display description="${returnId}"/></field>
+        <field name="statusId"><display-entity entity-name="StatusItem" description="${description}"/></field>
+        <field name="statusDatetime" title="${uiLabelMap.CommonDate}"><display/></field>
+        <field name="changeByUserLoginId" title="${uiLabelMap.FormFieldTitle_modifiedByUserLoginId}"><display/></field>
+    </form>
+    <form name="ReturnAndReceivedQuantityHistory" type="list" list-name="orderReturnItemHistories"
+            odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <field name="returnId"><display description="${returnId}"/></field>
+        <field name="oldValueText"><display/></field>
+        <field name="newValueText"><display/></field>
+        <field name="changedDate"><display/></field>
+        <field name="changedByInfo" title="${uiLabelMap.FormFieldTitle_modifiedByUserLoginId}"><display/></field>
+    </form>
+    <form name="ReturnReasonHistory" type="list" list-name="orderReturnItemHistories"
+            odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <field name="returnId"><display description="${returnId}"/></field>
+        <field name="oldValueText">
+            <display-entity entity-name="ReturnReason" description="${description}" key-field-name="returnReasonId"/>
+        </field>
+        <field name="newValueText">
+            <display-entity entity-name="ReturnReason" description="${description}" key-field-name="returnReasonId"/>
+        </field>
+        <field name="changedDate" title="${uiLabelMap.CommonDate}"><display/></field>
+        <field name="changedByInfo" title="${uiLabelMap.FormFieldTitle_modifiedByUserLoginId}"><display/></field>
+    </form>
+    <form name="ReturnTypeHistory" type="list" list-name="orderReturnItemHistories"
+            odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <field name="returnId"><display description="${returnId}"/></field>
+        <field name="oldValueText">
+            <display-entity entity-name="ReturnType" description="${description}" key-field-name="returnTypeId"/>
+        </field>
+        <field name="newValueText">
+            <display-entity entity-name="ReturnType" description="${description}" key-field-name="returnTypeId"/>
+        </field>
+        <field name="changedDate" title="${uiLabelMap.CommonDate}"><display/></field>
+        <field name="changedByInfo" title="${uiLabelMap.FormFieldTitle_modifiedByUserLoginId}"><display/></field>
+    </form>
+    <form name="ReturnPriceHistory" type="list" list-name="orderReturnItemHistories"
+            odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <field name="returnId"><display description="${returnId}"/></field>
+        <field name="oldValueText"><display type="currency"/></field>
+        <field name="newValueText"><display type="currency"/></field>
+        <field name="changedDate" title="${uiLabelMap.CommonDate}"><display/></field>
+        <field name="changedByInfo" title="${uiLabelMap.FormFieldTitle_modifiedByUserLoginId}"><display/></field>
+    </form>
 </forms>

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/return/returnLinks.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnLinks.ftl?rev=778463&r1=778462&r2=778463&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/return/returnLinks.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/return/returnLinks.ftl Mon May 25 18:02:47 2009
@@ -22,10 +22,12 @@
     <ul>
         <li<#if selected="OrderReturnHeader"> class="selected"</#if>><a href="<@ofbizUrl>returnMain?returnId=${returnId?if_exists}</@ofbizUrl>">${uiLabelMap.OrderReturnHeader}</a></li>
         <li<#if selected="OrderReturnItems"> class="selected"</#if>><a href="<@ofbizUrl>returnItems?returnId=${returnId?if_exists}</@ofbizUrl>">${uiLabelMap.OrderReturnItems}</a></li>
+        <li<#if selected="OrderReturnHistory"> class="selected"</#if>><a href="<@ofbizUrl>ReturnHistory?returnId=${returnId?if_exists}</@ofbizUrl>">${uiLabelMap.OrderReturnHistory}</a></li>
     </ul>
     <br/>
 </div>
 <div>
+    <#if selected != "OrderReturnHistory">
     <a href="<@ofbizUrl>return.pdf?returnId=${returnId?if_exists}</@ofbizUrl>" class="buttontext">PDF</a>
     <#if returnId?exists>
       <#assign returnItems = delegator.findByAnd("ReturnItem", Static["org.ofbiz.base.util.UtilMisc"].toMap("returnId", returnId, "returnTypeId", "RTN_REFUND"))/>
@@ -35,6 +37,7 @@
         <a href="<@ofbizUrl>setOrderCurrencyAgreementShipDates?partyId=${partyId?if_exists}&originOrderId=${orderId?if_exists}</@ofbizUrl>" class="buttontext">${uiLabelMap.OrderCreateExchangeOrder} ${uiLabelMap.CommonFor} ${orderId?if_exists}</a>
       </#if>
     </#if>
+    </#if>
 </div>
 <#else>
   <h1>${uiLabelMap.OrderCreateNewReturn}</h1>

Modified: ofbiz/trunk/applications/order/widget/ordermgr/OrderReturnScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/OrderReturnScreens.xml?rev=778463&r1=778462&r2=778463&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/OrderReturnScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/OrderReturnScreens.xml Mon May 25 18:02:47 2009
@@ -186,4 +186,197 @@
             </widgets>
         </section>
     </screen>
+
+    <screen name="OrderReturnHistory">
+        <section>
+            <actions>
+                <set field="titleProperty" value="OrderReturnHistory"/>
+                <set field="headerItem" value="return"/>
+                <set field="tabButtonItem" value="OrderReturnHistory"/>
+                <set field="returnId" from-field="parameters.returnId"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/return/ReturnItems.groovy"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonOrderReturnDecorator">
+                    <decorator-section name="body">
+                        <include-screen name="ReturnStatusHistory"/>
+                        <include-screen name="ReturnTypeHistory"/>
+                        <include-screen name="ReturnReasonHistory"/>
+                        <include-screen name="ReturnQuantityHistory"/>
+                        <include-screen name="ReceivedQuantityHistory"/>
+                        <include-screen name="ReturnPriceHistory"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="ReturnStatusHistory">
+        <section>
+            <actions>
+                <entity-and entity-name="ReturnStatus" list="orderReturnStatusHistories">
+                    <field-map field-name="returnId"/>
+                </entity-and>
+            </actions>
+            <widgets>
+                <section>
+                    <condition>
+                        <not>
+                            <if-empty field="orderReturnStatusHistories"/>
+                        </not>
+                    </condition>
+                    <widgets>
+                        <screenlet id="ReturnStatusHistoryPanel" title="${uiLabelMap.OrderOrderReturn} ${uiLabelMap.CommonStatusHistory}" collapsible="true">
+                            <include-form location="component://order/webapp/ordermgr/return/ReturnForms.xml" name="ReturnStatusHistory"/>
+                        </screenlet>
+                    </widgets>
+                    <fail-widgets>
+                        <screenlet title="${uiLabelMap.OrderOrderReturn} ${uiLabelMap.CommonStatusHistory}">
+                            <label text="${uiLabelMap.OrderHistoryNotAvailable}"/>
+                        </screenlet>
+                    </fail-widgets>
+                </section>
+            </widgets>
+        </section>
+    </screen>
+    
+    <screen name="ReturnTypeHistory">
+        <section>
+            <actions>
+                <set field="entityField" value="returnTypeId"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/return/ReturnHistory.groovy"/>
+            </actions>
+            <widgets>
+                <section>
+                    <condition>
+                        <not>
+                            <if-empty field="orderReturnItemHistories"/>
+                        </not>
+                    </condition>
+                    <widgets>
+                        <screenlet id="ReturnTypeHistoryPanel" title="${uiLabelMap.OrderReturnTypeHistory}" collapsible="true">
+                            <include-form location="component://order/webapp/ordermgr/return/ReturnForms.xml" name="ReturnTypeHistory"/>
+                        </screenlet>
+                    </widgets>
+                    <fail-widgets>
+                        <screenlet title="${uiLabelMap.OrderReturnTypeHistory}">
+                            <label text="${uiLabelMap.OrderHistoryNotAvailable}"/>
+                        </screenlet>
+                    </fail-widgets>
+                </section>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="ReturnReasonHistory">
+        <section>
+            <actions>
+                <set field="entityField" value="returnReasonId"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/return/ReturnHistory.groovy"/>
+            </actions>
+            <widgets>
+                <section>
+                    <condition>
+                        <not>
+                            <if-empty field="orderReturnItemHistories"/>
+                        </not>
+                    </condition>
+                    <widgets>
+                        <screenlet id="ReturnReasonHistoryPanel" title="${uiLabelMap.OrderReturnReasonHistory}" collapsible="true">
+                            <include-form location="component://order/webapp/ordermgr/return/ReturnForms.xml" name="ReturnReasonHistory"/>
+                        </screenlet>
+                    </widgets>
+                    <fail-widgets>
+                        <screenlet title="${uiLabelMap.OrderReturnReasonHistory}">
+                            <label text="${uiLabelMap.OrderHistoryNotAvailable}"/>
+                        </screenlet>
+                    </fail-widgets>
+                </section>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="ReturnQuantityHistory">
+        <section>
+            <actions>
+                <set field="entityField" value="returnQuantity"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/return/ReturnHistory.groovy"/>
+            </actions>
+            <widgets>
+                <section>
+                    <condition>
+                        <not>
+                            <if-empty field="orderReturnItemHistories"/>
+                        </not>
+                    </condition>
+                    <widgets>
+                        <screenlet id="ReturnQuantityHistoryPanel" title="${uiLabelMap.OrderReturnQtyHistory}" collapsible="true">
+                            <include-form location="component://order/webapp/ordermgr/return/ReturnForms.xml" name="ReturnAndReceivedQuantityHistory"/>
+                        </screenlet>
+                    </widgets>
+                    <fail-widgets>
+                        <screenlet title="${uiLabelMap.OrderReturnQtyHistory}">
+                            <label text="${uiLabelMap.OrderHistoryNotAvailable}"/>
+                        </screenlet>
+                    </fail-widgets>
+                </section>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="ReceivedQuantityHistory">
+        <section>
+            <actions>
+                <set field="entityField" value="receivedQuantity"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/return/ReturnHistory.groovy"/>
+            </actions>
+            <widgets>
+                <section>
+                    <condition>
+                        <not>
+                            <if-empty field="orderReturnItemHistories"/>
+                        </not>
+                    </condition>
+                    <widgets>
+                        <screenlet id="ReceivedQuantityHistoryPanel" title="${uiLabelMap.OrderReceivedQtyHistory}" collapsible="true">
+                            <include-form location="component://order/webapp/ordermgr/return/ReturnForms.xml" name="ReturnAndReceivedQuantityHistory"/>
+                        </screenlet>
+                    </widgets>
+                    <fail-widgets>
+                        <screenlet title="${uiLabelMap.OrderReceivedQtyHistory}">
+                            <label text="${uiLabelMap.OrderHistoryNotAvailable}"/>
+                        </screenlet>
+                    </fail-widgets>
+                </section>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="ReturnPriceHistory">
+        <section>
+            <actions>
+                <set field="entityField" value="returnPrice"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/return/ReturnHistory.groovy"/>
+            </actions>
+            <widgets>
+                <section>
+                    <condition>
+                        <not>
+                            <if-empty field="orderReturnItemHistories"/>
+                        </not>
+                    </condition>
+                    <widgets>
+                        <screenlet id="ReturnPriceHistoryPanel" title="${uiLabelMap.OrderReturnPriceHistory}" collapsible="true">
+                            <include-form location="component://order/webapp/ordermgr/return/ReturnForms.xml" name="ReturnPriceHistory"/>
+                        </screenlet>
+                    </widgets>
+                    <fail-widgets>
+                        <screenlet title="${uiLabelMap.OrderReturnPriceHistory}">
+                            <label text="${uiLabelMap.OrderHistoryNotAvailable}"/>
+                        </screenlet>
+                    </fail-widgets>
+                </section>
+            </widgets>
+        </section>
+    </screen>
 </screens>
\ No newline at end of file