[OFBiz] SVN: r4680 - in trunk/applications/product: script/org/ofbiz/shipment/picklist webapp/facility/facility

jonesde at svn.ofbiz.org jonesde at svn.ofbiz.org
Wed Mar 16 22:32:09 EST 2005


Author: jonesde
Date: 2005-03-16 21:32:02 -0600 (Wed, 16 Mar 2005)
New Revision: 4680

Modified:
   trunk/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml
   trunk/applications/product/webapp/facility/facility/Picklist.fo.ftl
Log:
Finished (hopefully) the pick/pack report data gathering service, still quite a bit of work to do on the fo.ftl file

Modified: trunk/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml
===================================================================
--- trunk/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml	2005-03-16 19:11:02 UTC (rev 4679)
+++ trunk/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml	2005-03-17 03:32:02 UTC (rev 4680)
@@ -806,8 +806,8 @@
         <!-- 
             Creates:
               1. Standard picklistInfo Map from the getPicklistSingleInfoInline simple-method (see comment there for details)
-              2. facilityLocationInfoList (facilityLocation, picklistItemInfoList (picklistItem, orderItem, inventoryItemAndLocation, orderItemShipGrpInvRes, itemIssuanceList))
-              3. noLocationProductInfoList (product, picklistItemInfoList (picklistItem, orderItem, inventoryItemAndLocation, orderItemShipGrpInvRes, itemIssuanceList))
+              2. facilityLocationInfoList (facilityLocation, picklistItemInfoList (picklistItem, orderItem, product, inventoryItemAndLocation, orderItemShipGrpInvRes, itemIssuanceList))
+              3. noLocationProductInfoList (product, picklistItemInfoList (picklistItem, orderItem, product, inventoryItemAndLocation, orderItemShipGrpInvRes, itemIssuanceList))
         -->
         <check-permission permission="FACILITY" action="_VIEW">
             <fail-message message="Security Error: to run getPickAndPackReportInfo you must have the FACILITY_VIEW or FACILITY_ADMIN permission"/>
@@ -841,9 +841,17 @@
                     <field-to-list field-name="picklistItemInfo" list-name="picklistItemInfoTempList"/>
                     <env-to-env env-name="picklistItemInfoTempList" to-env-name="picklistItemInfoListByLocationSeqIdMap.${facilityLocation.locationSeqId}"/>
                 <else>
-                    <!-- TODO: handle case where an InventoryItem is not associated with a location -->
+                    <!-- handle case where an InventoryItem is not associated with a location -->
                     <if-not-empty field-name="picklistItemInfo.orderItem.productId">
+                        <env-to-env env-name="picklistItemInfo.orderItem.productId" to-env-name="productId"/>
+                        <entity-one entity-name="Product" value-name="productByProductIdMap.${productId}" use-cache="true">
+                            <field-map env-name="productId"/>
+                        </entity-one>
                         
+                        <clear-field field-name="picklistItemInfoTempList"/>
+                        <env-to-env env-name="picklistItemInfoListByProductIdMap.${productId}" to-env-name="picklistItemInfoTempList"/>
+                        <field-to-list field-name="picklistItemInfo" list-name="picklistItemInfoTempList"/>
+                        <env-to-env env-name="picklistItemInfoTempList" to-env-name="picklistItemInfoListByProductIdMap.${productId}"/>
                     <else>
                         <!-- Uh oh, no productId, how did this happen? -->
                         <log level="warning" message="No productId and no FacilityLocation, not showing in Picklist for PicklistItem: ${picklistItemInfo.picklistItem}"/>
@@ -854,7 +862,8 @@
             </iterate>
         </iterate>
 
-        <!-- make a inventoryItemAndLocationList from the facilityLocationByLocationSeqIdMap, which was used to guarantee uniqueness of InventoryItems -->
+        <!-- === handle the ones by FacilityLocation === -->
+        <!-- make a facilityLocationList from the facilityLocationByLocationSeqIdMap, which was used to guarantee uniqueness of FacilityLocations -->
         <iterate-map map-name="facilityLocationByLocationSeqIdMap" key-name="locationSeqId" value-name="facilityLocationList[]"/>
 
         <!-- order the facilityLocations -->
@@ -873,7 +882,24 @@
             <env-to-env env-name="facilityLocationInfo" to-env-name="facilityLocationInfoList[]"/>
         </iterate>
         
+        <!-- === handle the ones by Product === -->
+        <!-- make a productList from the productByLocationSeqIdMap, which was used to guarantee uniqueness of FacilityLocations -->
+        <iterate-map map-name="productByLocationSeqIdMap" key-name="productId" value-name="productList[]"/>
+
+        <!-- order the products -->
+        <string-to-list string="+productId" list-name="productsOrdLst"/>
+        <order-value-list list-name="productList" order-by-list-name="productsOrdLst"/>
+        
+        <!-- Now we have an ordered list of InventoryItems, create an inventoryItemAndLocationInfoList -->
+        <iterate entry-name="product" list-name="productList">
+            <clear-field field-name="productInfo"/>
+            <env-to-env env-name="product" to-env-name="productInfo.product"/>
+            <env-to-env env-name="picklistItemInfoListByProductIdMap.${product.productId}" to-env-name="productInfo.picklistItemInfoList"/>
+            <env-to-env env-name="productInfo" to-env-name="productInfoList[]"/>
+        </iterate>
+        
         <field-to-result field-name="facilityLocationInfoList"/>
+        <field-to-result field-name="noLocationProductInfoList"/>
     </simple-method>
 
     <simple-method method-name="getPicklistSingleInfoInline" short-description="getPicklistSingleInfoInline">
@@ -888,7 +914,7 @@
                - picklistBin
                - primaryOrderHeader
                - primaryOrderItemShipGroup
-               - picklistItemInfoList (picklistItem, orderItem, inventoryItemAndLocation, orderItemShipGrpInvRes, itemIssuanceList) 
+               - picklistItemInfoList (picklistItem, orderItem, product, inventoryItemAndLocation, orderItemShipGrpInvRes, itemIssuanceList) 
         -->
         <!-- expects a picklist GenericValue to be in the context, and creates a picklistInfo Map -->
         <clear-field field-name="picklistRoleInfoList"/>
@@ -923,6 +949,7 @@
             <iterate entry-name="picklistItem" list-name="picklistItemList">
                 <clear-field field-name="picklistItemInfo"/>
                 <get-related-one value-name="picklistItem" relation-name="OrderItem" to-value-name="picklistItemInfo.orderItem"/>
+                <get-related-one value-name="picklistItemInfo.orderItem" relation-name="Product" to-value-name="picklistItemInfo.product"/>
                 <get-related-one value-name="picklistItem" relation-name="InventoryItemAndLocation" to-value-name="picklistItemInfo.inventoryItemAndLocation"/>
                 <get-related-one value-name="picklistItem" relation-name="OrderItemShipGrpInvRes" to-value-name="picklistItemInfo.orderItemShipGrpInvRes"/>
                 <get-related value-name="picklistItem" relation-name="ItemIssuance" list-name="picklistItemInfo.itemIssuanceList"/>

Modified: trunk/applications/product/webapp/facility/facility/Picklist.fo.ftl
===================================================================
--- trunk/applications/product/webapp/facility/facility/Picklist.fo.ftl	2005-03-16 19:11:02 UTC (rev 4679)
+++ trunk/applications/product/webapp/facility/facility/Picklist.fo.ftl	2005-03-17 03:32:02 UTC (rev 4680)
@@ -60,18 +60,18 @@
             </fo:table-row>
         </fo:table-header>
         <fo:table-body>
-            <#if facilityLocationInfoList?has_content || inventoryItemInfoList?has_content>
+            <#if facilityLocationInfoList?has_content || noLocationProductInfoList?has_content>
                 <#assign rowColor = "white">
-                <#-- facilityLocationInfoList: facilityLocation, productInfoList (product, quantity, inventoryItemList, orderItemList) -->
+                <#-- facilityLocationInfoList: facilityLocation, picklistItemInfoList (picklistItem, orderItem, product, inventoryItemAndLocation, orderItemShipGrpInvRes, itemIssuanceList) -->
                 <#if facilityLocationInfoList?has_content>
                 <#list facilityLocationInfoList as facilityLocationInfo>
                     <#assign facilityLocation = facilityLocationInfo.facilityLocation>
-                    <#assign productInfoList = facilityLocationInfo.productInfoList>
-                    <#list productInfoList as productInfo>
-                        <#assign product = productInfo.product>
-                        <#assign quantity = productInfo.quantity>
-                        <#assign inventoryItemList = productInfo.inventoryItemList>
-                        <#assign orderItemList = productInfo.orderItemList>
+                    <#assign picklistItemInfoList = facilityLocationInfo.picklistItemInfoList>
+                    <#list picklistItemInfoList as picklistItemInfo>
+                        <#assign product = picklistItemInfo.product>
+                        <#assign quantity = picklistItemInfo.quantity>
+                        <#assign inventoryItemList = picklistItemInfo.inventoryItemList>
+                        <#assign orderItemList = picklistItemInfo.orderItemList>
                         <fo:table-row> <#-- TODO: set the row color -->
                             <fo:table-cell padding="2pt" background-color="${rowColor}">
                                 <fo:block>${facilityLocation.areaId?if_exists}-${facilityLocation.aisleId?if_exists}-${facilityLocation.sectionId?if_exists}-${facilityLocation.levelId?if_exists}-${facilityLocation.positionId?if_exists}</fo:block>
@@ -108,17 +108,12 @@
                     </#list>
                 </#list>
                 </#if>
-                <#if inventoryItemInfoList?has_content>
-                <#list inventoryItemInfoList as inventoryItemInfo>
-                    <#-- inventoryItemInfoList: List of Maps with inventoryItem, facilityLocation, orderItems, product, quantity, statusItem -->
-                    <#-- for this list, only display for inventoryItems with no location since those with locations will be displayed above -->
-                    <#if !inventoryItemInfo.facilityLocation?exists>
-                        <#assign inventoryItem = inventoryItemInfo.inventoryItem>
-                        <#assign facilityLocation = inventoryItemInfo.facilityLocation?if_exists>
-                        <#assign orderItems = inventoryItemInfo.orderItems>
-                        <#assign product = inventoryItemInfo.product>
-                        <#assign quantity = inventoryItemInfo.quantity>
-                        <#assign statusItem = inventoryItemInfo.statusItem?if_exists>
+                <#-- noLocationProductInfoList: product, picklistItemInfoList (picklistItem, orderItem, product, inventoryItemAndLocation, orderItemShipGrpInvRes, itemIssuanceList) -->
+                <#if noLocationProductInfoList?has_content>
+                <#list noLocationProductInfoList as noLocationProductInfo>
+                    <#if !noLocationProductInfo.facilityLocation?exists>
+                        <#assign product = noLocationProductInfo.product>
+                        <#assign picklistItemInfoList = noLocationProductInfo.picklistItemInfoList>
                         <fo:table-row>
                             <fo:table-cell padding="2pt" background-color="${rowColor}">
                                 <#if facilityLocation?has_content>



More information about the Svn mailing list