svn commit: r664069 - in /ofbiz/trunk/applications: manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ product/data/ product/script/org/ofbiz/product/inventory/ product/servicedef/ product/src/org/ofbiz/product/inventory/ product/webapp/facility/...

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

svn commit: r664069 - in /ofbiz/trunk/applications: manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ product/data/ product/script/org/ofbiz/product/inventory/ product/servicedef/ product/src/org/ofbiz/product/inventory/ product/webapp/facility/...

jacopoc
Author: jacopoc
Date: Fri Jun  6 11:24:20 2008
New Revision: 664069

URL: http://svn.apache.org/viewvc?rev=664069&view=rev
Log:
Added support for non-serialized status to mark items as defective or on-hold and exclude them form the inventory reservation and issuance services; enhanced inventory counting services to consider only non serialized items with an empty status (i.e. exclude on-hold or damaged items) but also added the statusId field so that it is possible to count on-hold or damaged items.

Modified:
    ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml
    ofbiz/trunk/applications/product/data/ProductTypeData.xml
    ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml
    ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml
    ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
    ofbiz/trunk/applications/product/servicedef/services_facility.xml
    ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh
    ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml
    ofbiz/trunk/applications/product/webapp/facility/inventory/InventoryForms.xml
    ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml

Modified: ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml?rev=664069&r1=664068&r2=664069&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml (original)
+++ ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml Fri Jun  6 11:24:20 2008
@@ -262,62 +262,70 @@
                     </calculate>
                 </if-compare>
             </if-compare>
-            <if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
-                <if-compare field-name="parameters.useReservedItems" operator="equals" value="Y">
-                    <set field="inventoryItemQuantity" from-field="inventoryItem.quantityOnHandTotal"/>
-                <else>
-                    <set field="inventoryItemQuantity" from-field="inventoryItem.availableToPromiseTotal"/>
-                </else>
-                </if-compare>
-                
-                <if-not-empty field-name="inventoryItemQuantity">
-                    <!-- reduce atp on inventoryItem if availableToPromise greater than 0, if not the code at the end of this method will handle it -->
-                    <if-compare field-name="inventoryItemQuantity" operator="greater" value="0" type="Double">
-                        <if-compare-field field-name="parameters.quantityNotIssued" operator="greater" to-field-name="inventoryItemQuantity" type="Double">
-                            <set from-field="inventoryItemQuantity" field="parameters.deductAmount"/>
-                        <else>
-                            <set from-field="parameters.quantityNotIssued" field="parameters.deductAmount"/>
-                        </else>
-                        </if-compare-field>
-                        
-                        <!-- create WorkEffortInventoryAssign record -->
-                        <set from-field="parameters.workEffortId" field="issuanceCreateMap.workEffortId"/>
-                        <set from-field="inventoryItem.inventoryItemId" field="issuanceCreateMap.inventoryItemId"/>
-                        <set from-field="parameters.deductAmount" field="issuanceCreateMap.quantity"/>
-                        <call-service service-name="assignInventoryToWorkEffort" in-map-name="issuanceCreateMap">
-                        </call-service>
-
-                        <!-- instead of updating InventoryItem, add an InventoryItemDetail -->
-                        <set from-field="inventoryItem.inventoryItemId" field="createDetailMap.inventoryItemId"/>
-                        <set from-field="parameters.workEffortId" field="createDetailMap.workEffortId"/>
-                        <!-- update availableToPromiseDiff AND quantityOnHandDiff since this is an issuance -->
-                        <calculate field-name="createDetailMap.availableToPromiseDiff" type="Double">
-                            <calcop field-name="parameters.deductAmount" operator="negative"/>
-                        </calculate>
-                        <calculate field-name="createDetailMap.quantityOnHandDiff" type="Double">
-                            <calcop field-name="parameters.deductAmount" operator="negative"/>
-                        </calculate>
-                        <set field="createDetailMap.reasonEnumId" from-field="parameters.reasonEnumId"/>
-                        <set field="createDetailMap.description" from-field="parameters.description"/>
-                        <call-service service-name="createInventoryItemDetail" in-map-name="createDetailMap"/>
-                        <clear-field field-name="createDetailMap"/>
-                        
-                        <calculate field-name="quantityNotIssued" map-name="parameters">
-                            <calcop operator="subtract" field-name="parameters.quantityNotIssued">
-                                <calcop operator="get" field-name="parameters.deductAmount"/>
-                            </calcop>
-                        </calculate>
-                        <set field="balanceInventoryItemsInMap.inventoryItemId" from-field="inventoryItem.inventoryItemId"/>
-                        <call-service service-name="balanceInventoryItems" in-map-name="balanceInventoryItemsInMap"/>
-
-                        <clear-field field-name="issuanceCreateMap"/>
+            <if>
+                <condition>
+                    <and>
+                        <if-empty field-name="inventoryItem.statusId"/>
+                        <if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM"/>
+                    </and>
+                </condition>
+                <then>
+                    <if-compare field-name="parameters.useReservedItems" operator="equals" value="Y">
+                        <set field="inventoryItemQuantity" from-field="inventoryItem.quantityOnHandTotal"/>
+                    <else>
+                        <set field="inventoryItemQuantity" from-field="inventoryItem.availableToPromiseTotal"/>
+                    </else>
                     </if-compare>
-                </if-not-empty>
-
-                <!-- keep track of the last non-serialized inventory item for use if inventory is not sufficient for amount already issued -->
-                <!-- use env variable named lastNonSerInventoryItem -->
-                <set from-field="inventoryItem" field="lastNonSerInventoryItem"/>
-            </if-compare>
+                    
+                    <if-not-empty field-name="inventoryItemQuantity">
+                        <!-- reduce atp on inventoryItem if availableToPromise greater than 0, if not the code at the end of this method will handle it -->
+                        <if-compare field-name="inventoryItemQuantity" operator="greater" value="0" type="Double">
+                            <if-compare-field field-name="parameters.quantityNotIssued" operator="greater" to-field-name="inventoryItemQuantity" type="Double">
+                                <set from-field="inventoryItemQuantity" field="parameters.deductAmount"/>
+                            <else>
+                                <set from-field="parameters.quantityNotIssued" field="parameters.deductAmount"/>
+                            </else>
+                            </if-compare-field>
+                            
+                            <!-- create WorkEffortInventoryAssign record -->
+                            <set from-field="parameters.workEffortId" field="issuanceCreateMap.workEffortId"/>
+                            <set from-field="inventoryItem.inventoryItemId" field="issuanceCreateMap.inventoryItemId"/>
+                            <set from-field="parameters.deductAmount" field="issuanceCreateMap.quantity"/>
+                            <call-service service-name="assignInventoryToWorkEffort" in-map-name="issuanceCreateMap">
+                            </call-service>
+    
+                            <!-- instead of updating InventoryItem, add an InventoryItemDetail -->
+                            <set from-field="inventoryItem.inventoryItemId" field="createDetailMap.inventoryItemId"/>
+                            <set from-field="parameters.workEffortId" field="createDetailMap.workEffortId"/>
+                            <!-- update availableToPromiseDiff AND quantityOnHandDiff since this is an issuance -->
+                            <calculate field-name="createDetailMap.availableToPromiseDiff" type="Double">
+                                <calcop field-name="parameters.deductAmount" operator="negative"/>
+                            </calculate>
+                            <calculate field-name="createDetailMap.quantityOnHandDiff" type="Double">
+                                <calcop field-name="parameters.deductAmount" operator="negative"/>
+                            </calculate>
+                            <set field="createDetailMap.reasonEnumId" from-field="parameters.reasonEnumId"/>
+                            <set field="createDetailMap.description" from-field="parameters.description"/>
+                            <call-service service-name="createInventoryItemDetail" in-map-name="createDetailMap"/>
+                            <clear-field field-name="createDetailMap"/>
+                            
+                            <calculate field-name="quantityNotIssued" map-name="parameters">
+                                <calcop operator="subtract" field-name="parameters.quantityNotIssued">
+                                    <calcop operator="get" field-name="parameters.deductAmount"/>
+                                </calcop>
+                            </calculate>
+                            <set field="balanceInventoryItemsInMap.inventoryItemId" from-field="inventoryItem.inventoryItemId"/>
+                            <call-service service-name="balanceInventoryItems" in-map-name="balanceInventoryItemsInMap"/>
+    
+                            <clear-field field-name="issuanceCreateMap"/>
+                        </if-compare>
+                    </if-not-empty>
+    
+                    <!-- keep track of the last non-serialized inventory item for use if inventory is not sufficient for amount already issued -->
+                    <!-- use env variable named lastNonSerInventoryItem -->
+                    <set from-field="inventoryItem" field="lastNonSerInventoryItem"/>
+                </then>
+            </if>
         </if-compare>
     </simple-method>
 

Modified: ofbiz/trunk/applications/product/data/ProductTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/data/ProductTypeData.xml?rev=664069&r1=664068&r2=664069&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/data/ProductTypeData.xml (original)
+++ ofbiz/trunk/applications/product/data/ProductTypeData.xml Fri Jun  6 11:24:20 2008
@@ -464,6 +464,8 @@
     <StatusItem description="Being Transfered (Promised)" sequenceId="11" statusCode="BEING_TRANS_PRM" statusId="INV_BEING_TRANS_PRM" statusTypeId="INV_SERIALIZED_STTS"/>
     <StatusItem description="Returned" sequenceId="20" statusCode="RETURNED" statusId="INV_RETURNED" statusTypeId="INV_SERIALIZED_STTS"/>
     <StatusItem description="Defective" sequenceId="21" statusCode="DEFECTIVE" statusId="INV_DEFECTIVE" statusTypeId="INV_SERIALIZED_STTS"/>
+    <StatusItem description="On Hold (Non-Serialized)" sequenceId="01" statusCode="ON_HOLD_NS" statusId="INV_NS_ON_HOLD" statusTypeId="INV_NON_SER_STTS"/>
+    <StatusItem description="Defective (Non-Serialized)" sequenceId="02" statusCode="DEFECTIVE_NS" statusId="INV_NS_DEFECTIVE" statusTypeId="INV_NON_SER_STTS"/>
     <StatusValidChange condition="" statusId="INV_ON_ORDER" statusIdTo="INV_AVAILABLE" transitionName="Order Arrived"/>
     <StatusValidChange condition="" statusId="INV_AVAILABLE" statusIdTo="INV_PROMISED" transitionName="Promise"/>
     <StatusValidChange condition="" statusId="INV_AVAILABLE" statusIdTo="INV_ON_HOLD" transitionName="Hold"/>

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml?rev=664069&r1=664068&r2=664069&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml Fri Jun  6 11:24:20 2008
@@ -214,9 +214,16 @@
                 </if-compare>
             </if-compare>
             <if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
-                <if-not-empty field-name="inventoryItem.availableToPromiseTotal">
-                    <!-- reduce atp on inventoryItem if availableToPromise greater than 0, if not the code at the end of this method will handle it -->
-                    <if-compare field-name="inventoryItem.availableToPromiseTotal" operator="greater" value="0" type="Double">
+                <!-- reduce atp on inventoryItem if availableToPromise greater than 0, if not the code at the end of this method will handle it -->
+                <if>
+                    <condition>
+                        <and>
+                            <if-empty field-name="inventoryItem.statusId"/>
+                            <not><if-empty field-name="inventoryItem.availableToPromiseTotal"/></not>
+                            <if-compare field-name="inventoryItem.availableToPromiseTotal" operator="greater" value="0" type="Double"/>
+                        </and>
+                    </condition>
+                    <then>
                         <if-compare-field field-name="parameters.quantityNotIssued" operator="greater" to-field-name="inventoryItem.availableToPromiseTotal" type="Double">
                             <set field="parameters.deductAmount" from-field="inventoryItem.availableToPromiseTotal" />
                         <else>
@@ -256,15 +263,13 @@
 
                         <clear-field field-name="issuanceCreateMap"/>
                         <clear-field field-name="itemIssuanceId"/>
-                    </if-compare>
-                </if-not-empty>
 
-                <!-- keep track of the last non-serialized inventory item for use if inventory is not sufficient for amount already issued -->
-                <!-- use env variable named lastNonSerInventoryItem -->
-                <set field="lastNonSerInventoryItem" from-field="inventoryItem" />
+                        <!-- keep track of the last non-serialized inventory item for use if inventory is not sufficient for amount already issued -->
+                        <!-- use env variable named lastNonSerInventoryItem -->
+                        <set field="lastNonSerInventoryItem" from-field="inventoryItem" />
+                    </then>
+                </if>
             </if-compare>
         </if-compare>
     </simple-method>
 </simple-methods>
-
-

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml?rev=664069&r1=664068&r2=664069&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml Fri Jun  6 11:24:20 2008
@@ -27,7 +27,7 @@
                 -containerId
             If the service definitions are used then only one of these two will ever be specified, or neither of them.
 
-            Whatever it is called with, it will basicly get a list of InventoryItems and reserve the first available inventory.
+            Whatever it is called with, it will basically get a list of InventoryItems and reserve the first available inventory.
 
             If requireInventory is Y the quantity not reserved is returned, if N then a negative
             availableToPromise will be used to track quantity ordered beyond what is in stock.
@@ -417,9 +417,16 @@
                 </if-compare>
             </if-compare>
             <if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
-                <if-not-empty field-name="inventoryItem.availableToPromiseTotal">
-                    <!-- reduce atp on inventoryItem if availableToPromise greater than 0, if not the code at the end of this method will handle it -->
-                    <if-compare field-name="inventoryItem.availableToPromiseTotal" operator="greater" value="0" type="Double">
+                <!-- reduce atp on inventoryItem if availableToPromise greater than 0, if not the code at the end of this method will handle it -->
+                <if>
+                    <condition>
+                        <and>
+                            <if-empty field-name="inventoryItem.statusId"/>
+                            <not><if-empty field-name="inventoryItem.availableToPromiseTotal"/></not>
+                            <if-compare field-name="inventoryItem.availableToPromiseTotal" operator="greater" value="0" type="Double"/>
+                        </and>
+                    </condition>
+                    <then>
                         <if-compare-field field-name="parameters.quantityNotReserved" operator="greater" to-field-name="inventoryItem.availableToPromiseTotal" type="Double">
                             <set from-field="inventoryItem.availableToPromiseTotal" field="parameters.deductAmount"/>
                         <else>
@@ -457,12 +464,11 @@
                                 <calcop operator="get" field-name="deductAmount" map-name="parameters"/>
                             </calcop>
                         </calculate>
-                    </if-compare>
-                </if-not-empty>
-
-                <!-- keep track of the last non-serialized inventory item for use if inventory is not required for purchase -->
-                <!-- use env variable named lastNonSerInventoryItem -->
-                <set from-field="inventoryItem" field="lastNonSerInventoryItem"/>
+                    </then>
+                    <!-- keep track of the last non-serialized inventory item for use if inventory is not required for purchase -->
+                    <!-- use env variable named lastNonSerInventoryItem -->
+                    <set from-field="inventoryItem" field="lastNonSerInventoryItem"/>
+                </if>
             </if-compare>
         </if-compare>
     </simple-method>
@@ -612,10 +618,3 @@
         </if-compare>
     </simple-method>
 </simple-methods>
-
-
-
-
-
-
-

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml?rev=664069&r1=664068&r2=664069&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml Fri Jun  6 11:24:20 2008
@@ -638,18 +638,34 @@
                 </if-compare>
             </if-compare>
             <if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
-                <if-not-empty field-name="inventoryItem.quantityOnHandTotal">
-                    <calculate field-name="parameters.quantityOnHandTotal" type="Double">
-                        <calcop operator="get" field-name="parameters.quantityOnHandTotal"/>
-                        <calcop operator="get" field-name="inventoryItem.quantityOnHandTotal"/>
-                    </calculate>
-                </if-not-empty>
-                <if-not-empty field-name="inventoryItem.availableToPromiseTotal">
-                    <calculate field-name="parameters.availableToPromiseTotal" type="Double">
-                        <calcop operator="get" field-name="parameters.availableToPromiseTotal"/>
-                        <calcop operator="get" field-name="inventoryItem.availableToPromiseTotal"/>
-                    </calculate>
-                </if-not-empty>
+                <if>
+                    <condition>
+                        <or>
+                            <and>
+                                <not><if-empty field-name="parameters.statusId"/></not>
+                                <if-compare-field operator="equals" field-name="parameters.statusId" to-field-name="inventoryItem.statusId"/>
+                            </and>
+                            <and>
+                                <if-empty field-name="parameters.statusId"/>
+                                <if-empty field-name="inventoryItem.statusId"/>
+                            </and>
+                        </or>
+                    </condition>
+                    <then>
+                        <if-not-empty field-name="inventoryItem.quantityOnHandTotal">
+                            <calculate field-name="parameters.quantityOnHandTotal" type="Double">
+                                <calcop operator="get" field-name="parameters.quantityOnHandTotal"/>
+                                <calcop operator="get" field-name="inventoryItem.quantityOnHandTotal"/>
+                            </calculate>
+                        </if-not-empty>
+                        <if-not-empty field-name="inventoryItem.availableToPromiseTotal">
+                            <calculate field-name="parameters.availableToPromiseTotal" type="Double">
+                                <calcop operator="get" field-name="parameters.availableToPromiseTotal"/>
+                                <calcop operator="get" field-name="inventoryItem.availableToPromiseTotal"/>
+                            </calculate>
+                        </if-not-empty>
+                    </then>
+                </if>
             </if-compare>
         </iterate>
 
@@ -676,6 +692,7 @@
         <if-not-empty field-name="assocProducts">
             <set from-field="assocProducts" field="inventoryByAssocProductsParams.assocProducts"/>
             <set from-field="parameters.facilityId" field="inventoryByAssocProductsParams.facilityId"/>
+            <set from-field="parameters.statusId" field="inventoryByAssocProductsParams.statusId"/>
             <call-service service-name="getProductInventoryAvailableFromAssocProducts" in-map-name="inventoryByAssocProductsParams">
                 <result-to-field result-name="quantityOnHandTotal"/>
                 <result-to-field result-name="availableToPromiseTotal"/>

Modified: ofbiz/trunk/applications/product/servicedef/services_facility.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_facility.xml?rev=664069&r1=664068&r2=664069&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_facility.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_facility.xml Fri Jun  6 11:24:20 2008
@@ -141,6 +141,7 @@
         <description>Get Marketing Packages Available From Components In Inventory</description>
         <attribute name="productId" type="String" mode="IN" optional="false"/>
         <attribute name="facilityId" type="String" mode="IN" optional="true"/>
+        <attribute name="statusId" type="String" mode="IN" optional="true"/>
         <attribute name="quantityOnHandTotal" type="Double" mode="OUT" optional="false"/>
         <attribute name="availableToPromiseTotal" type="Double" mode="OUT" optional="false"/>
     </service>
@@ -148,6 +149,7 @@
                 location="org/ofbiz/product/inventory/InventoryServices.xml" invoke="getProductInventoryAvailable" auth="false" use-transaction="false">
         <description>Get Inventory Availability for a Product</description>
         <attribute name="productId" type="String" mode="IN" optional="false"/>
+        <attribute name="statusId" type="String" mode="IN" optional="true"/>
         <attribute name="quantityOnHandTotal" type="Double" mode="OUT" optional="false"/>
         <attribute name="availableToPromiseTotal" type="Double" mode="OUT" optional="false"/>
         <attribute name="useCache" type="Boolean" mode="IN" optional="true"/>
@@ -157,6 +159,7 @@
         <description>Get Inventory Availability for a Product constrained by a facilityId</description>
         <attribute name="productId" type="String" mode="IN" optional="false"/>
         <attribute name="facilityId" type="String" mode="IN" optional="false"/>
+        <attribute name="statusId" type="String" mode="IN" optional="true"/>
         <attribute name="quantityOnHandTotal" type="Double" mode="OUT" optional="false"/>
         <attribute name="availableToPromiseTotal" type="Double" mode="OUT" optional="false"/>
         <attribute name="useCache" type="Boolean" mode="IN" optional="true"/>
@@ -167,6 +170,7 @@
         <attribute name="productId" type="String" mode="IN" optional="false"/>
         <attribute name="facilityId" type="String" mode="IN" optional="false"/>
         <attribute name="locationSeqId" type="String" mode="IN" optional="false"/>
+        <attribute name="statusId" type="String" mode="IN" optional="true"/>
         <attribute name="quantityOnHandTotal" type="Double" mode="OUT" optional="false"/>
         <attribute name="availableToPromiseTotal" type="Double" mode="OUT" optional="false"/>
         <attribute name="useCache" type="Boolean" mode="IN" optional="true"/>
@@ -176,6 +180,7 @@
         <description>Get Inventory Availability for a Product constrained by a containerId</description>
         <attribute name="productId" type="String" mode="IN" optional="false"/>
         <attribute name="containerId" type="String" mode="IN" optional="false"/>
+        <attribute name="statusId" type="String" mode="IN" optional="true"/>
         <attribute name="quantityOnHandTotal" type="Double" mode="OUT" optional="false"/>
         <attribute name="availableToPromiseTotal" type="Double" mode="OUT" optional="false"/>
     </service>
@@ -195,6 +200,7 @@
         </description>
         <attribute name="facilityId" type="String" mode="IN" optional="true"/>
         <attribute name="assocProducts" type="List" mode="IN" optional="false"/>
+        <attribute name="statusId" type="String" mode="IN" optional="true"/>
         <attribute name="quantityOnHandTotal" type="Double" mode="OUT" optional="false"/>
         <attribute name="availableToPromiseTotal" type="Double" mode="OUT" optional="false"/>
     </service>
@@ -217,6 +223,7 @@
         <attribute name="facilityId" type="String" mode="IN" optional="false"/>
         <attribute name="productId" type="String" mode="IN" optional="false"/>
         <attribute name="minimumStock" mode="IN" type="String" optional="true"/>
+        <attribute name="statusId" type="String" mode="IN" optional="true"/>
         <attribute name="totalQuantityOnHand" mode="OUT" type="String" optional="true"/>
         <attribute name="totalAvailableToPromise" mode="OUT" type="String" optional="true"/>
         <attribute name="quantityOnOrder" mode="OUT" type="Double" optional="true"/>

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java?rev=664069&r1=664068&r2=664069&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java Fri Jun  6 11:24:20 2008
@@ -648,6 +648,7 @@
         LocalDispatcher dispatcher = dctx.getDispatcher();
         List productAssocList = (List) context.get("assocProducts");
         String facilityId = (String)context.get("facilityId");
+        String statusId = (String)context.get("statusId");
         
         Double availableToPromiseTotal = new Double(0);
         Double quantityOnHandTotal = new Double(0);
@@ -672,7 +673,7 @@
                // figure out the inventory available for this associated product
                Map resultOutput = null;
                try {
-                   Map inputMap = UtilMisc.toMap("productId", productIdTo);
+                   Map inputMap = UtilMisc.toMap("productId", productIdTo, "statusId", statusId);
                    if (facilityId != null) {
                        inputMap.put("facilityId", facilityId);
                        resultOutput = dispatcher.runSync("getInventoryAvailableByFacility", inputMap);
@@ -728,12 +729,12 @@
 
         // get a list of all available facilities for looping
         List facilities = null;
-    try {
-        if (facilityId != null) {
+        try {
+            if (facilityId != null) {
                 facilities = delegator.findByAnd("Facility", UtilMisc.toMap("facilityId", facilityId));
             } else {
                 facilities = delegator.findList("Facility", null, null, null, null, false);
-            }
+            }
         } catch (GenericEntityException e) {
             return ServiceUtil.returnError("Unable to locate facilities." + e.getMessage());
         }
@@ -815,11 +816,12 @@
         String facilityId = (String)context.get("facilityId");
         String productId = (String)context.get("productId");
         String minimumStock = (String)context.get("minimumStock");
+        String statusId = (String)context.get("statusId");
 
         Map result = new HashMap();
         Map resultOutput = new HashMap();
 
-        Map contextInput = UtilMisc.toMap("productId", productId, "facilityId", facilityId);
+        Map contextInput = UtilMisc.toMap("productId", productId, "facilityId", facilityId, "statusId", statusId);
         GenericValue product = null;
         try {
             product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId));

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh?rev=664069&r1=664068&r2=664069&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh Fri Jun  6 11:24:20 2008
@@ -176,6 +176,7 @@
         oneInventory.put("minimumStock", oneProd.getString("minimumStock"));
         oneInventory.put("reorderQuantity", oneProd.getString("reorderQuantity"));
         oneInventory.put("daysToShip", oneProd.getString("daysToShip"));
+        oneInventory.put("statusId", statusId);
         rows.add(oneInventory);
     }
 

Modified: ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml?rev=664069&r1=664068&r2=664069&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml (original)
+++ ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml Fri Jun  6 11:24:20 2008
@@ -336,6 +336,16 @@
                 </entity-options>
             </drop-down>
         </field>
+        <field name="statusId">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="StatusItem" description="${description}" key-field-name="statusId">
+                    <entity-constraint name="statusTypeId" operator="equals" value="INV_NON_SER_STTS"/>
+                </entity-options>
+                <entity-options entity-name="StatusItem" description="${description}" key-field-name="statusId">
+                    <entity-constraint name="statusTypeId" operator="equals" value="INV_SERIALIZED_STTS"/>
+                </entity-options>
+            </drop-down>
+        </field>
         <field name="offsetQOHQty" title="${uiLabelMap.ProductQtyOffsetQOHBelow}"><text/></field>
         <field name="offsetATPQty" title="${uiLabelMap.ProductQtyOffsetATPBelow}"><text/></field>
         <field name="productsSoldThruTimestamp" title="${uiLabelMap.ProductShowProductsSoldThruTimestamp}">
@@ -356,6 +366,7 @@
                 <field-map field-name="productId" env-name="productId"/>
                 <field-map field-name="facilityId" env-name="facilityId"/>
                 <field-map field-name="checkTime" env-name="checkTime"/>
+                <field-map field-name="statusId" env-name="statusId"/>
             </service>
         </row-actions>
         <field name="items" title="${uiLabelMap.ProductProductId}" widget-style="buttontext">

Modified: ofbiz/trunk/applications/product/webapp/facility/inventory/InventoryForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/inventory/InventoryForms.xml?rev=664069&r1=664068&r2=664069&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/inventory/InventoryForms.xml (original)
+++ ofbiz/trunk/applications/product/webapp/facility/inventory/InventoryForms.xml Fri Jun  6 11:24:20 2008
@@ -51,14 +51,31 @@
             <text>
                 <sub-hyperlink use-when="productId!=null" target="/catalog/control/EditProduct?productId=${productId}" target-type="inter-app" description="${uiLabelMap.ProductEditProduct} [${productId}]"/>
             </text>
-        </field>
-        <field name="statusId">
+        </field>
+        <field name="statusId" use-when="inventoryItem==null">
             <drop-down allow-empty="true">
                 <entity-options entity-name="StatusItem" description="${description}" key-field-name="statusId">
+                    <entity-constraint name="statusTypeId" operator="equals" value="INV_NON_SER_STTS"/>
+                </entity-options>
+                <entity-options entity-name="StatusItem" description="${description}" key-field-name="statusId">
+                    <entity-constraint name="statusTypeId" operator="equals" value="INV_SERIALIZED_STTS"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="statusId" use-when="inventoryItem!=null&amp;&amp;&quot;SERIALIZED_INV_ITEM&quot;.equals(inventoryItem.getString(&quot;inventoryItemTypeId&quot;))">
+            <drop-down allow-empty="false">
+                <entity-options entity-name="StatusItem" description="${description}" key-field-name="statusId">
                     <entity-constraint name="statusTypeId" operator="equals" value="INV_SERIALIZED_STTS"/>
                 </entity-options>
             </drop-down>
         </field>
+        <field name="statusId" use-when="inventoryItem!=null&amp;&amp;&quot;NON_SERIAL_INV_ITEM&quot;.equals(inventoryItem.getString(&quot;inventoryItemTypeId&quot;))">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="StatusItem" description="${description}" key-field-name="statusId">
+                    <entity-constraint name="statusTypeId" operator="equals" value="INV_NON_SER_STTS"/>
+                </entity-options>
+            </drop-down>
+        </field>
         <field name="expireDate" title="${uiLabelMap.ProductExpireDate}"/>
         <field name="facilityId">
             <drop-down allow-empty="true">

Modified: ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml?rev=664069&r1=664068&r2=664069&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Fri Jun  6 11:24:20 2008
@@ -328,6 +328,7 @@
                 <set field="productsSoldThruTimestamp" from-field="parameters.productsSoldThruTimestamp"/>
                 <set field="internalName" from-field="parameters.internalName"/>
                 <set field="productId" from-field="parameters.productId"/>
+                <set field="statusId" from-field="parameters.statusId"/>
                 <!-- do not use the countFacilityInventoryByProduct.bsh script unless the issues mentioned in it are correctly addressed -->
                 <script location="component://product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh"/>
                 <entity-one entity-name="Facility" value-name="facility"/>