[OFBiz] SVN: r7856 - in trunk/applications/product: config webapp/catalog/WEB-INF/actions/product webapp/catalog/product widget/catalog

jacopo@svn.ofbiz.org jacopo at svn.ofbiz.org
Sat Jun 24 04:04:42 CDT 2006


Author: jacopo
Date: 2006-06-24 04:04:24 -0500 (Sat, 24 Jun 2006)
New Revision: 7856

Added:
   trunk/applications/product/webapp/catalog/product/EditVirtualProductInventory.ftl
Modified:
   trunk/applications/product/config/ProductUiLabels.properties
   trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.bsh
   trunk/applications/product/webapp/catalog/product/EditProductInventoryItems.ftl
   trunk/applications/product/widget/catalog/ProductScreens.xml
Log:
Changed the EditProductInventoryItems screen in ProductScreens.xml to display a summary of variant products inventory when a virtual product is being browsed.
Thanks to Scott Gray for the patch (Apache OFBIZ-46) that I've committed with some minor mods.

Modified: trunk/applications/product/config/ProductUiLabels.properties
===================================================================
--- trunk/applications/product/config/ProductUiLabels.properties	2006-06-24 05:05:32 UTC (rev 7855)
+++ trunk/applications/product/config/ProductUiLabels.properties	2006-06-24 09:04:24 UTC (rev 7856)
@@ -252,7 +252,7 @@
 ProductAddProductFeatureFromCategory=Add Product Feature From Category or Group
 ProductAddProductFeatureFromGroup=Add Product Feature From Group
 ProductAddProductFeatureID=Add Product Feature with ID
-ProductAddProductFeatureInBulk=Adding Product Features in Bulk 
+ProductAddProductFeatureInBulk=Adding Product Features in Bulk
 ProductAddProductFeatureTypeId=Add Product Feature with Type and ID Code
 ProductAddProductKeyword=Add product keyword
 ProductAddProductsUsingDefaultQuantities=Add Products in this Category to the Cart using Default Quantities
@@ -270,7 +270,7 @@
 ProductAisle=Aisle
 ProductAllowCo=Allow Co
 ProductAllowCoAddr=Allow Company Addr
-ProductAllowMessage=Used with allow company address 
+ProductAllowMessage=Used with allow company address
 ProductAllowUSPS=Allow USPS
 ProductAllowUSPSAddr=Allow USPS Addr (PO Box, RR, etc)
 ProductAlternate=Alternate
@@ -531,7 +531,7 @@
 ProductFacilityType=Facility Type
 ProductFacilityTypeId=Facility Type ID
 ProductFacilityViewPermissionError=You do not have permission to view this page. ("FACILITY_VIEW" or "FACILITY_ADMIN" needed)
-ProductFacilityDefaultWeightUnit=Default Weight Unit 
+ProductFacilityDefaultWeightUnit=Default Weight Unit
 ProductFastLoadCatalogIntoCache=Fast Load Catalog into Cache
 ProductFeature=Feature
 ProductFeatureApplicationType=Feature Application Type
@@ -633,7 +633,7 @@
 ProductInventoryTransfer=Inventory Transfer
 ProductInventoryTransfersFor=Inventory Transfers for
 ProductInventoryXfers=Inventory Xfers
-ProductInInventory = In Inventory 
+ProductInInventory = In Inventory
 ProductInProduction = In Production
 ProductIssedOrdered=Issed  : Ordered
 ProductIssue=Issue
@@ -1021,7 +1021,7 @@
 ProductRequireCustomerAmount=Require the customer to enter an amount.
 ProductRequireInventory=Require Inventory
 ProductRequireInventoryForPurchase=Require Inventory For Purchase
-ProductRequireMessage=Setting ignored if Allow is 'N' 
+ProductRequireMessage=Setting ignored if Allow is 'N'
 ProductRequireUSPS=Require USPS
 ProductRequireUSPSAddr=Require USPS Addr (PO Box, RR, etc)
 ProductRequirementMethodEnumId=Requirement Method Enum Id
@@ -1242,6 +1242,7 @@
 ProductVariantAdd=Add Variant Products
 ProductVariantProduct=Is VARIANT Product ?
 ProductVariantProductIds=Variant Product IDs
+ProductVariantProductInventorySummary=Variant Product Inventory Summary
 ProductVariants=Variants
 ProductViewEstimates=View Estimates
 ProductViewLabelImage=View Label Image
@@ -1360,7 +1361,7 @@
 CommonTotalPercProfit=Total Perc Profit
 CommonTotalPrice=Total Price
 CommonTotalProfit=Total Profit
-FormFieldTitle_productCategoryId=Product Category Id 
+FormFieldTitle_productCategoryId=Product Category Id
 FormFieldTitle_prodCatalogCategoryTypeId=Product Catalog Category Type Id
 FormFieldTitle_primaryStoreGroupId=Primary Store Group Id
 FormFieldTitle_storeName=Store Name
@@ -1374,7 +1375,7 @@
 FormFieldTitle_viewCartOnAdd=View Cart On Add
 FormFieldTitle_autoSaveCart=Auto Save Cart
 FormFieldTitle_autoApproveReviews=Auto Approve Reviews
-FormFieldTitle_isDemoStore=Is Demo Store 
+FormFieldTitle_isDemoStore=Is Demo Store
 FormFieldTitle_isImmediatelyFulfilled=Is Immediately Fulfilled
 FormFieldTitle_inventoryFacilityId=Inventory Facility Id
 FormFieldTitle_oneInventoryFacility=One Inventory Facility
@@ -1449,7 +1450,7 @@
 FormFieldTitle_dataSourceId=Data Source Id
 FormFieldTitle_privilegeEnumId=Privilege Enum Id
 FormFieldTitle_serviceName=Service Name
-FormFieldTitle_contentName=Content Name 
+FormFieldTitle_contentName=Content Name
 FormFieldTitle_localeString=Locale String
 FormFieldTitle_mimeTypeId=Mime Type Id
 FormFieldTitle_characterSetId=Character Set Id
@@ -1476,9 +1477,9 @@
 FormFieldTitle_costComponentCalcId=Cost Component Calc Id
 FormFieldTitle_cost=Cost
 FormFieldTitle_costUomId=Cost Uom Id
-FormFieldTitle_deleteCostComponent=Delete Cost Component 
+FormFieldTitle_deleteCostComponent=Delete Cost Component
 FormFieldTitle_costComponentTypePrefix=Cost Component Type Prefix
-FormFieldTitle_orderDate=Order Date 
+FormFieldTitle_orderDate=Order Date
 FormFieldTitle_orderId=Order Id
 FormFieldTitle_orderItemSeqId=Order Item Seq Id
 FormFieldTitle_itemStatusId=Item Status Id

Modified: trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.bsh
===================================================================
--- trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.bsh	2006-06-24 05:05:32 UTC (rev 7855)
+++ trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.bsh	2006-06-24 09:04:24 UTC (rev 7856)
@@ -1,28 +1,19 @@
 /*
- *  Copyright (c) 2003-2005 The Open For Business Project - www.ofbiz.org
+ * $Id$
  *
- *  Permission is hereby granted, free of charge, to any person obtaining a 
- *  copy of this software and associated documentation files (the "Software"), 
- *  to deal in the Software without restriction, including without limitation 
- *  the rights to use, copy, modify, merge, publish, distribute, sublicense, 
- *  and/or sell copies of the Software, and to permit persons to whom the 
- *  Software is furnished to do so, subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included 
- *  in all copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
- *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
- *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
- *  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 
- *  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 
- *  OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR 
- *  THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *@author     David E. Jones
- *@author     Brad Steiner
- *@version    $Rev$
- *@since      2.2
+ * Copyright 2001-2006 The Apache Software Foundation
+ * 
+ * Licensed 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 java.util.*;
@@ -33,103 +24,140 @@
 import org.ofbiz.widget.html.*;
 import org.ofbiz.securityext.login.*;
 
-quantitySummaryByFacility = new HashMap();
-manufacturingInQuantitySummaryByFacility = new HashMap();
-manufacturingOutQuantitySummaryByFacility = new HashMap();
-// The warehouse list is selected
-showAllFacilities = parameters.get("showAllFacilities");
-if (showAllFacilities != null && showAllFacilities.equals("Y")) {
-    facilityList = delegator.findAll("Facility");
-} else {
-    facilityList = delegator.findByAnd("ProductFacility", UtilMisc.toMap("productId", productId));
-}
-facilityIterator = facilityList.iterator();
-dispatcher = request.getAttribute("dispatcher");
-Map contextInput = null;
-Map resultOutput = null;
-// For every warehouse the product's atp and qoh 
-// are obtained (calling the "getInventoryAvailableByFacility" service)
-while (facilityIterator.hasNext()) {
-    facility = facilityIterator.next();
-    contextInput = UtilMisc.toMap("productId",productId, "facilityId", facility.getString("facilityId"));
-    resultOutput = dispatcher.runSync("getInventoryAvailableByFacility",contextInput);
-    quantitySummary = new HashMap();
-    quantitySummary.put("facilityId", facility.getString("facilityId"));
-    quantitySummary.put("totalQuantityOnHand", resultOutput.get("quantityOnHandTotal"));
-    quantitySummary.put("totalAvailableToPromise", resultOutput.get("availableToPromiseTotal"));
-    quantitySummaryByFacility.put(facility.getString("facilityId"), quantitySummary);
-}
+//If product is virtual gather summary data from variants
+if (product.getString("isVirtual") != null && product.getString("isVirtual").equals("Y")) {
+    //Get the virtual product feature types
+    result = dispatcher.runSync("getProductFeaturesByType", UtilMisc.toMap("productId", productId, "productFeatureApplTypeId", "SELECTABLE_FEATURE"));
+    featureTypeIds = result.get("productFeatureTypes");
+    //Get the variants
+    result = dispatcher.runSync("getAllProductVariants", UtilMisc.toMap("productId", productId));
+    variants = result.get("assocProducts");
+    variantIterator = variants.iterator();
+    variantInventorySummaries = new ArrayList();
+    while(variantIterator.hasNext()) {
+        variant = variantIterator.next();
 
-productInventoryItems = delegator.findByAnd("InventoryItem", 
-        UtilMisc.toMap("productId", productId), 
-        UtilMisc.toList("facilityId", "-datetimeReceived", "-inventoryItemId"));
+        //create a map of each variant id and inventory summary (all facilities)
+        variantInventorySummary = new HashMap();
+        variantInventorySummary.put("productId", variant.getString("productIdTo"));
+        inventoryAvailable = dispatcher.runSync("getProductInventoryAvailable", UtilMisc.toMap("productId", variantInventorySummary.get("productId")));
+        variantInventorySummary.put("availableToPromiseTotal", inventoryAvailable.get("availableToPromiseTotal"));
+        variantInventorySummary.put("quantityOnHandTotal", inventoryAvailable.get("quantityOnHandTotal"));
 
-// TODO: get all incoming shipments not yet arrived coming into each facility that this product is in, use a view entity with ShipmentAndItem
-findIncomingShipmentsConds = new LinkedList();
+        //add the applicable features to the map
+        featureTypeIdsIterator = featureTypeIds.iterator();
+        while (featureTypeIdsIterator.hasNext()) {
+            featureTypeId = featureTypeIdsIterator.next();
+            result = dispatcher.runSync("getProductFeatures", UtilMisc.toMap("productId", variant.getString("productIdTo"), "type", "STANDARD_FEATURE", "distinct", featureTypeId));
+            variantFeatures = result.get("productFeatures");
+            if (variantFeatures.size() > 0) {
+                //there should only be one result in this collection
+                variantInventorySummary.put(featureTypeId, variantFeatures.iterator().next());
+            }
+        }
+        variantInventorySummaries.add(variantInventorySummary);
+    }
+    context.put("featureTypeIds", featureTypeIds);
+    context.put("variantInventorySummaries", variantInventorySummaries);
+} else { //Gather information for a non virtual product
+    quantitySummaryByFacility = new HashMap();
+    manufacturingInQuantitySummaryByFacility = new HashMap();
+    manufacturingOutQuantitySummaryByFacility = new HashMap();
+    // The warehouse list is selected
+    showAllFacilities = parameters.get("showAllFacilities");
+    if (showAllFacilities != null && showAllFacilities.equals("Y")) {
+        facilityList = delegator.findAll("Facility");
+    } else {
+        facilityList = delegator.findByAnd("ProductFacility", UtilMisc.toMap("productId", productId));
+    }
+    facilityIterator = facilityList.iterator();
+    dispatcher = request.getAttribute("dispatcher");
+    Map contextInput = null;
+    Map resultOutput = null;
+    // For every warehouse the product's atp and qoh
+    // are obtained (calling the "getInventoryAvailableByFacility" service)
+    while (facilityIterator.hasNext()) {
+        facility = facilityIterator.next();
+        contextInput = UtilMisc.toMap("productId",productId, "facilityId", facility.getString("facilityId"));
+        resultOutput = dispatcher.runSync("getInventoryAvailableByFacility",contextInput);
+        quantitySummary = new HashMap();
+        quantitySummary.put("facilityId", facility.getString("facilityId"));
+        quantitySummary.put("totalQuantityOnHand", resultOutput.get("quantityOnHandTotal"));
+        quantitySummary.put("totalAvailableToPromise", resultOutput.get("availableToPromiseTotal"));
+        quantitySummaryByFacility.put(facility.getString("facilityId"), quantitySummary);
+    }
 
-findIncomingShipmentsConds.add(new EntityExpr("productId", EntityOperator.EQUALS, productId));
+    productInventoryItems = delegator.findByAnd("InventoryItem",
+            UtilMisc.toMap("productId", productId),
+            UtilMisc.toList("facilityId", "-datetimeReceived", "-inventoryItemId"));
 
-findIncomingShipmentsTypeConds = new LinkedList();
-findIncomingShipmentsTypeConds.add(new EntityExpr("shipmentTypeId", EntityOperator.EQUALS, "INCOMING_SHIPMENT"));
-findIncomingShipmentsTypeConds.add(new EntityExpr("shipmentTypeId", EntityOperator.EQUALS, "PURCHASE_SHIPMENT"));
-findIncomingShipmentsTypeConds.add(new EntityExpr("shipmentTypeId", EntityOperator.EQUALS, "SALES_RETURN"));
-findIncomingShipmentsConds.add(new EntityConditionList(findIncomingShipmentsTypeConds, EntityOperator.OR));
+    // TODO: get all incoming shipments not yet arrived coming into each facility that this product is in, use a view entity with ShipmentAndItem
+    findIncomingShipmentsConds = new LinkedList();
 
-findIncomingShipmentsStatusConds = new LinkedList();
-findIncomingShipmentsStatusConds.add(new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "SHIPMENT_DELIVERED"));
-findIncomingShipmentsStatusConds.add(new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "SHIPMENT_CANCELLED"));
-findIncomingShipmentsStatusConds.add(new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "PURCH_SHIP_RECEIVED"));
-findIncomingShipmentsConds.add(new EntityConditionList(findIncomingShipmentsStatusConds, EntityOperator.AND));
+    findIncomingShipmentsConds.add(new EntityExpr("productId", EntityOperator.EQUALS, productId));
 
-findIncomingShipmentsStatusCondition = new EntityConditionList(findIncomingShipmentsConds, EntityOperator.AND);
-incomingShipmentAndItems = delegator.findByCondition("ShipmentAndItem", findIncomingShipmentsStatusCondition, null, UtilMisc.toList("-estimatedArrivalDate"));
-incomingShipmentAndItemIter = incomingShipmentAndItems.iterator();
-while (incomingShipmentAndItemIter.hasNext()) {
-    incomingShipmentAndItem = incomingShipmentAndItemIter.next();
-    facilityId = incomingShipmentAndItem.getString("destinationFacilityId");
+    findIncomingShipmentsTypeConds = new LinkedList();
+    findIncomingShipmentsTypeConds.add(new EntityExpr("shipmentTypeId", EntityOperator.EQUALS, "INCOMING_SHIPMENT"));
+    findIncomingShipmentsTypeConds.add(new EntityExpr("shipmentTypeId", EntityOperator.EQUALS, "PURCHASE_SHIPMENT"));
+    findIncomingShipmentsTypeConds.add(new EntityExpr("shipmentTypeId", EntityOperator.EQUALS, "SALES_RETURN"));
+    findIncomingShipmentsConds.add(new EntityConditionList(findIncomingShipmentsTypeConds, EntityOperator.OR));
 
-    quantitySummary = quantitySummaryByFacility.get(facilityId);
-    if (quantitySummary == null) {
-        quantitySummary = new HashMap();
-        quantitySummary.put("facilityId", facilityId);
-        quantitySummaryByFacility.put(facilityId, quantitySummary);
-    }
+    findIncomingShipmentsStatusConds = new LinkedList();
+    findIncomingShipmentsStatusConds.add(new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "SHIPMENT_DELIVERED"));
+    findIncomingShipmentsStatusConds.add(new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "SHIPMENT_CANCELLED"));
+    findIncomingShipmentsStatusConds.add(new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "PURCH_SHIP_RECEIVED"));
+    findIncomingShipmentsConds.add(new EntityConditionList(findIncomingShipmentsStatusConds, EntityOperator.AND));
 
-    incomingShipmentAndItemList = quantitySummary.get("incomingShipmentAndItemList");
-    if (incomingShipmentAndItemList == null) {
-        incomingShipmentAndItemList = new LinkedList();
-        quantitySummary.put("incomingShipmentAndItemList", incomingShipmentAndItemList);
+    findIncomingShipmentsStatusCondition = new EntityConditionList(findIncomingShipmentsConds, EntityOperator.AND);
+    incomingShipmentAndItems = delegator.findByCondition("ShipmentAndItem", findIncomingShipmentsStatusCondition, null, UtilMisc.toList("-estimatedArrivalDate"));
+    incomingShipmentAndItemIter = incomingShipmentAndItems.iterator();
+    while (incomingShipmentAndItemIter.hasNext()) {
+        incomingShipmentAndItem = incomingShipmentAndItemIter.next();
+        facilityId = incomingShipmentAndItem.getString("destinationFacilityId");
+
+        quantitySummary = quantitySummaryByFacility.get(facilityId);
+        if (quantitySummary == null) {
+            quantitySummary = new HashMap();
+            quantitySummary.put("facilityId", facilityId);
+            quantitySummaryByFacility.put(facilityId, quantitySummary);
+        }
+
+        incomingShipmentAndItemList = quantitySummary.get("incomingShipmentAndItemList");
+        if (incomingShipmentAndItemList == null) {
+            incomingShipmentAndItemList = new LinkedList();
+            quantitySummary.put("incomingShipmentAndItemList", incomingShipmentAndItemList);
+        }
+
+        incomingShipmentAndItemList.add(incomingShipmentAndItem);
     }
 
-    incomingShipmentAndItemList.add(incomingShipmentAndItem);
-}
+    // --------------------
+    // Production Runs
+    contextInput = UtilMisc.toMap("productId", productId, "userLogin", userLogin);
+    resultOutput = dispatcher.runSync("getProductManufacturingSummaryByFacility", contextInput);
+    // incoming products
+    manufacturingInQuantitySummaryByFacility = resultOutput.get("summaryInByFacility");
+    // outgoing products (materials)
+    manufacturingOutQuantitySummaryByFacility = resultOutput.get("summaryOutByFacility");
 
-// --------------------
-// Production Runs
-contextInput = UtilMisc.toMap("productId", productId, "userLogin", userLogin);
-resultOutput = dispatcher.runSync("getProductManufacturingSummaryByFacility", contextInput);
-// incoming products
-manufacturingInQuantitySummaryByFacility = resultOutput.get("summaryInByFacility");
-// outgoing products (materials)
-manufacturingOutQuantitySummaryByFacility = resultOutput.get("summaryOutByFacility");
+    showEmpty = "true".equals(request.getParameter("showEmpty"));
 
-showEmpty = "true".equals(request.getParameter("showEmpty"));
+    // Find oustanding purchase orders for this item.  The orders and the items cannot be completed, cancelled, or rejected
+    purchaseOrderConditions = UtilMisc.toList(new EntityExpr("orderStatusId", EntityOperator.NOT_EQUAL, "ORDER_COMPLETED"),
+            new EntityExpr("orderStatusId", EntityOperator.NOT_EQUAL, "ORDER_CANCELLED"),
+            new EntityExpr("orderStatusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED"),
+            new EntityExpr("itemStatusId", EntityOperator.NOT_EQUAL, "ITEM_COMPLETED"),
+            new EntityExpr("itemStatusId", EntityOperator.NOT_EQUAL, "ITEM_CANCELLED"),
+            new EntityExpr("itemStatusId", EntityOperator.NOT_EQUAL, "ITEM_REJECTED"));
+    purchaseOrderConditions.add(new EntityExpr("orderTypeId", EntityOperator.EQUALS, "PURCHASE_ORDER"));
+    purchaseOrderConditions.add(new EntityExpr("productId", EntityOperator.EQUALS, productId));
+    purchaseOrders = delegator.findByCondition("OrderHeaderAndItems", new EntityConditionList(purchaseOrderConditions, EntityOperator.AND),
+            null, UtilMisc.toList("estimatedDeliveryDate DESC", "orderDate"));
 
-// Find oustanding purchase orders for this item.  The orders and the items cannot be completed, cancelled, or rejected
-purchaseOrderConditions = UtilMisc.toList(new EntityExpr("orderStatusId", EntityOperator.NOT_EQUAL, "ORDER_COMPLETED"),
-        new EntityExpr("orderStatusId", EntityOperator.NOT_EQUAL, "ORDER_CANCELLED"),
-        new EntityExpr("orderStatusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED"),
-        new EntityExpr("itemStatusId", EntityOperator.NOT_EQUAL, "ITEM_COMPLETED"),
-        new EntityExpr("itemStatusId", EntityOperator.NOT_EQUAL, "ITEM_CANCELLED"),
-        new EntityExpr("itemStatusId", EntityOperator.NOT_EQUAL, "ITEM_REJECTED"));
-purchaseOrderConditions.add(new EntityExpr("orderTypeId", EntityOperator.EQUALS, "PURCHASE_ORDER"));
-purchaseOrderConditions.add(new EntityExpr("productId", EntityOperator.EQUALS, productId));
-purchaseOrders = delegator.findByCondition("OrderHeaderAndItems", new EntityConditionList(purchaseOrderConditions, EntityOperator.AND), 
-        null, UtilMisc.toList("estimatedDeliveryDate DESC", "orderDate"));
-
-context.put("productInventoryItems", productInventoryItems);
-context.put("quantitySummaryByFacility", quantitySummaryByFacility);
-context.put("manufacturingInQuantitySummaryByFacility", manufacturingInQuantitySummaryByFacility);
-context.put("manufacturingOutQuantitySummaryByFacility", manufacturingOutQuantitySummaryByFacility);
-context.put("showEmpty", showEmpty);
-context.put("purchaseOrders", purchaseOrders);
+    context.put("productInventoryItems", productInventoryItems);
+    context.put("quantitySummaryByFacility", quantitySummaryByFacility);
+    context.put("manufacturingInQuantitySummaryByFacility", manufacturingInQuantitySummaryByFacility);
+    context.put("manufacturingOutQuantitySummaryByFacility", manufacturingOutQuantitySummaryByFacility);
+    context.put("showEmpty", showEmpty);
+    context.put("purchaseOrders", purchaseOrders);
+}

Modified: trunk/applications/product/webapp/catalog/product/EditProductInventoryItems.ftl
===================================================================
--- trunk/applications/product/webapp/catalog/product/EditProductInventoryItems.ftl	2006-06-24 05:05:32 UTC (rev 7855)
+++ trunk/applications/product/webapp/catalog/product/EditProductInventoryItems.ftl	2006-06-24 09:04:24 UTC (rev 7856)
@@ -102,12 +102,6 @@
     </#if>
 </#if>
 <br/>
-
-<#if (product.isVirtual)?if_exists == "Y">
-    <div class="head3">${uiLabelMap.ProductWarningVirtualProduct}.</div>
-</#if>
-
-<br/>
 <#if productId?exists>
     <table border="1" cellpadding="2" cellspacing="0">
     <tr>

Added: trunk/applications/product/webapp/catalog/product/EditVirtualProductInventory.ftl
===================================================================
--- trunk/applications/product/webapp/catalog/product/EditVirtualProductInventory.ftl	2006-06-24 05:05:32 UTC (rev 7855)
+++ trunk/applications/product/webapp/catalog/product/EditVirtualProductInventory.ftl	2006-06-24 09:04:24 UTC (rev 7856)
@@ -0,0 +1,38 @@
+<#--
+$Id: $
+
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed 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.
+-->
+<table border="1" cellpadding="2" cellspacing="0">
+    <tr>
+        <td><div class="tabletext"><b>${uiLabelMap.ProductProductId}</b></div></td>
+            <#list featureTypeIds as featureTypeId>
+                <#assign featureType = delegator.findByPrimaryKey("ProductFeatureType", Static["org.ofbiz.base.util.UtilMisc"].toMap("productFeatureTypeId", featureTypeId))>
+                <td><div class="tabletext"><b>${featureType.description}</b></div></td>
+            </#list>
+        <td><div class="tabletext"><b>${uiLabelMap.ProductQoh}</b></div></td>
+        <td><div class="tabletext"><b>${uiLabelMap.ProductAtp}</b></div></td>
+    </tr>
+    <#list variantInventorySummaries as variantSummary>
+    <tr>
+        <td><a href="/catalog/control/EditProductInventoryItems?productId=${variantSummary.productId}" class="buttontext">${variantSummary.productId}</a></td>
+            <#list featureTypeIds as featureTypeId>
+                <td><div class="tabletext"><b>${variantSummary[featureTypeId].description}</b></div></td>
+            </#list>
+        <td><div class="tabletext">${variantSummary.quantityOnHandTotal}</b></div></td>
+        <td><div class="tabletext">${variantSummary.availableToPromiseTotal}</b></div></td>
+    </tr>
+    </#list>
+</table>


Property changes on: trunk/applications/product/webapp/catalog/product/EditVirtualProductInventory.ftl
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + "Date Rev Author URL Id"
Name: svn:eol-style
   + native

Modified: trunk/applications/product/widget/catalog/ProductScreens.xml
===================================================================
--- trunk/applications/product/widget/catalog/ProductScreens.xml	2006-06-24 05:05:32 UTC (rev 7855)
+++ trunk/applications/product/widget/catalog/ProductScreens.xml	2006-06-24 09:04:24 UTC (rev 7856)
@@ -423,11 +423,24 @@
             <widgets>
                 <decorator-screen name="CommonProductDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
-                        <platform-specific>
-                            <html><html-template location="component://product/webapp/catalog/product/EditProductInventoryItems.ftl"/></html>
-                        </platform-specific>
-                        <container><label style="head1">${uiLabelMap.ProductOutstandingPurchaseOrders}</label></container>
-                        <include-form name="OutstandingPurchaseOrders" location="component://product/webapp/catalog/product/ProductForms.xml"/>
+                        <section>
+                            <condition>
+                                <if-compare field-name="product.isVirtual" operator="equals" type="String" value="Y"/>
+                            </condition>
+                            <widgets>
+                                <container><label style="head2">${uiLabelMap.ProductVariantProductInventorySummary}</label></container>
+                                <platform-specific>
+                                    <html><html-template location="component://product/webapp/catalog/product/EditVirtualProductInventory.ftl"/></html>
+                                </platform-specific>
+                            </widgets>
+                            <fail-widgets>
+                                <platform-specific>
+                                    <html><html-template location="component://product/webapp/catalog/product/EditProductInventoryItems.ftl"/></html>
+                                </platform-specific>
+                                <container><label style="head1">${uiLabelMap.ProductOutstandingPurchaseOrders}</label></container>
+                                <include-form name="OutstandingPurchaseOrders" location="component://product/webapp/catalog/product/ProductForms.xml"/>
+                            </fail-widgets>
+                        </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>



More information about the Svn mailing list