svn commit: r779159 - in /ofbiz/trunk/applications: order/webapp/ordermgr/WEB-INF/ product/script/org/ofbiz/shipment/picklist/ product/webapp/facility/WEB-INF/ product/webapp/facility/facility/ product/widget/facility/

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

svn commit: r779159 - in /ofbiz/trunk/applications: order/webapp/ordermgr/WEB-INF/ product/script/org/ofbiz/shipment/picklist/ product/webapp/facility/WEB-INF/ product/webapp/facility/facility/ product/widget/facility/

mor-2
Author: mor
Date: Wed May 27 13:18:03 2009
New Revision: 779159

URL: http://svn.apache.org/viewvc?rev=779159&view=rev
Log:
Minor fixes to the service printPickSheets to throw user friendly error message when user enter either zero or negative value for number of ordersfor printing a pick sheet, for a group

Modified:
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
    ofbiz/trunk/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml
    ofbiz/trunk/applications/product/webapp/facility/facility/PicklistOptions.ftl
    ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml

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=779159&r1=779158&r2=779159&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Wed May 27 13:18:03 2009
@@ -1525,7 +1525,12 @@
     <request-map uri="order.pdf"><security https="true" auth="true"/><response name="success" type="view" value="OrderPDF"/></request-map>
     <request-map uri="return.pdf"><security https="true" auth="true"/><response name="success" type="view" value="ReturnPDF"/></request-map>
     <request-map uri="shipGroups.pdf"><security https="true" auth="true"/><response name="success" type="view" value="ShipGroupsPDF"/></request-map>
-    <request-map uri="orderPickSheet.pdf"><security https="true" auth="true"/><response name="success" type="view" value="OrderPickSheetPDF"/></request-map>
+    <request-map uri="orderPickSheet.pdf">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="printPickSheets"/>
+        <response name="success" type="view" value="OrderPickSheetPDF"/>
+        <response name="error" type="view" value="orderview"/>
+    </request-map>
 
     <request-map uri="LookupProductCategory">
         <security auth="true" https="true"/>

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml?rev=779159&r1=779158&r2=779159&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml Wed May 27 13:18:03 2009
@@ -672,9 +672,18 @@
 
     <!-- print pick sheet -->
     <simple-method method-name="printPickSheets" short-description="Print pick sheets for orders">
+        <if-empty field="parameters.maxNumberOfOrdersToPrint">
+            <add-error error-list-name="error_list"><fail-message message="Please specify the number of orders to print pick sheet"/></add-error>
+        <else>
+            <if-compare field="parameters.maxNumberOfOrdersToPrint" operator="less-equals" value="0" type="Long">
+                <add-error error-list-name="error_list"><fail-message message="Cannot specify negative value."/></add-error>
+            </if-compare>
+        </else>
+        </if-empty>
+        <check-errors/>
+
         <now-timestamp field="nowTimestamp"/>
         <set-service-fields service-name="findOrdersToPickMove" map="parameters" to-map="findOrdersToPickMoveMap"/>
-
         <call-service service-name="findOrdersToPickMove" in-map-name="findOrdersToPickMoveMap">
             <result-to-field result-name="pickMoveInfoList"/>
         </call-service>
@@ -693,22 +702,15 @@
             </iterate>
         </else>
         </if-not-empty>
-        <set field="printListCounter" value="0" type="Long"/>
+        <set field="counter" value="0" type="Long"/>
         <iterate list="toPrintList" entry="toPrint">
-            <if>
-                <condition>
-                    <or>
-                        <if-empty field="parameters.maxNumberOfOrdersToPrint"/>
-                        <if-compare-field field="printListCounter" operator="less" to-field="parameters.maxNumberOfOrdersToPrint" type="Long"/>
-                    </or>
-                </condition>
-                <then>
-                    <set field="orderHeaderMap.orderId" from-field="toPrint.orderHeader.orderId"/>
-                    <set field="orderHeaderMap.pickSheetPrintedDate" from-field="nowTimestamp"/>
-                    <call-service service-name="updateOrderHeader" in-map-name="orderHeaderMap"/>
-                    <set field="printListCounter" value="${printListCounter + 1}" type="Long"/>
-                </then>
-            </if>
+            <if-compare-field field="counter" operator="less" to-field="parameters.maxNumberOfOrdersToPrint" type="Long">
+                <set field="orderHeaderMap.orderId" from-field="toPrint.orderHeader.orderId"/>
+                <set field="orderHeaderMap.pickSheetPrintedDate" from-field="nowTimestamp"/>
+                <call-service service-name="updateOrderHeader" in-map-name="orderHeaderMap"/>
+                <set field="counter" value="${counter + 1}" type="Long"/>
+                <clear-field field="orderHeaderMap"/>
+            </if-compare-field>
         </iterate>
         <field-to-result field="pickMoveInfoList" result-name="pickMoveInfoList"/>
     </simple-method>

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml?rev=779159&r1=779158&r2=779159&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml Wed May 27 13:18:03 2009
@@ -647,9 +647,11 @@
         <response name="success" type="view" value="PickMoveStock"/>
         <response name="error" type="view" value="PickMoveStock"/>
     </request-map>
-    <request-map uri="PrintPickSheets">
+    <request-map uri="printPickSheets">
         <security https="true" auth="true"/>
+        <event type="service" invoke="printPickSheets"/>
         <response name="success" type="view" value="PrintPickSheets.pdf"/>
+        <response name="error" type="view" value="PicklistOptions"/>
     </request-map>
     <request-map uri="ReviewOrdersNotPickedOrPacked">
         <security https="true" auth="true"/>

Modified: ofbiz/trunk/applications/product/webapp/facility/facility/PicklistOptions.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/facility/PicklistOptions.ftl?rev=779159&r1=779158&r2=779159&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/facility/PicklistOptions.ftl (original)
+++ ofbiz/trunk/applications/product/webapp/facility/facility/PicklistOptions.ftl Wed May 27 13:18:03 2009
@@ -146,7 +146,7 @@
                         </td>
                         <td>
                             <#if orderReadyToPickInfoList?has_content>
-                                <form method="post" action="<@ofbizUrl>PrintPickSheets</@ofbizUrl>">
+                                <form method="post" action="<@ofbizUrl>printPickSheets</@ofbizUrl>">
                                     <input type="hidden" name="printGroupName" value="${groupName?if_exists}"/>
                                     <input type="hidden" name="facilityId" value="${facilityId?if_exists}"/>
                                     <input type="hidden" name="groupByShippingMethod" value="${requestParameters.groupByShippingMethod?if_exists}"/>

Modified: ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml?rev=779159&r1=779158&r2=779159&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Wed May 27 13:18:03 2009
@@ -1211,7 +1211,6 @@
                 <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                 <set field="facilityId" from-field="parameters.facilityId"/>
-                <service service-name="printPickSheets"/>
                 <script location="component://order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy"/>
             </actions>
             <widgets>