svn commit: r534254 - in /ofbiz/trunk/applications: party/webapp/partymgr/party/ product/webapp/catalog/product/ product/webapp/facility/WEB-INF/actions/inventory/ product/webapp/facility/inventory/ 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: r534254 - in /ofbiz/trunk/applications: party/webapp/partymgr/party/ product/webapp/catalog/product/ product/webapp/facility/WEB-INF/actions/inventory/ product/webapp/facility/inventory/ product/widget/facility/

jaz-3
Author: jaz
Date: Tue May  1 15:12:53 2007
New Revision: 534254

URL: http://svn.apache.org/viewvc?view=rev&rev=534254
Log:
refactored inventory view screen to use form widget; 99% exactly the same (except for additional fields) as the previous version; only difference right now is the display of facility locations

Added:
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/PhysicalInventoryVariance.bsh   (with props)
Removed:
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/EditInventoryItem.bsh
    ofbiz/trunk/applications/product/webapp/facility/inventory/EditInventoryItem.ftl
Modified:
    ofbiz/trunk/applications/party/webapp/partymgr/party/SerializedInventorySummary.ftl
    ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml
    ofbiz/trunk/applications/product/webapp/facility/inventory/InventoryForms.xml
    ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml

Modified: ofbiz/trunk/applications/party/webapp/partymgr/party/SerializedInventorySummary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/party/SerializedInventorySummary.ftl?view=diff&rev=534254&r1=534253&r2=534254
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/party/SerializedInventorySummary.ftl (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/party/SerializedInventorySummary.ftl Tue May  1 15:12:53 2007
@@ -37,7 +37,7 @@
                 <#list inventoryItemList as inventoryItem>
                     <#assign product = inventoryItem.getRelatedOne('Product')?if_exists>
                     <tr>
-                        <td>${inventoryItem.inventoryItemId}</td>
+                        <td><a href="/facility/control/EditInventoryItem?inventoryItemId=${inventoryItem.inventoryItemId}&externalLoginKey=${requestAttributes.externalLoginKey?if_exists}" class="linktext">${inventoryItem.inventoryItemId}</a></td>
                         <td>
                             <#if product?has_content>
                                 <#if product.isVariant?default('N') == 'Y'>

Modified: ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml?view=diff&rev=534254&r1=534253&r2=534254
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml Tue May  1 15:12:53 2007
@@ -25,13 +25,13 @@
         <auto-fields-service service-name="updateProduct" map-name="product"/>
     </form>
     <form name="EditProduct" type="single" target="updateProduct" title="" default-map-name="product"
-        default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
+        default-title-style="tableheadtext" default-widget-style="inputBox">
 
         <alt-target use-when="product==null" target="createProduct"/>
 
         <field use-when="product==null" name="isCreate"><hidden value="true"/></field>
 
-        <field use-when="product!=null" name="productId" title="${uiLabelMap.ProductProductId}" tooltip="${uiLabelMap.ProductNotModificationRecreatingProduct}" widget-style="tabletext"><display/></field>
+        <field use-when="product!=null" name="productId" title="${uiLabelMap.ProductProductId}" tooltip="&amp;nbsp;${uiLabelMap.ProductNotModificationRecreatingProduct}" widget-style="tabletext"><display/></field>
         <field use-when="product==null&amp;&amp;productId==null" name="productId" title="${uiLabelMap.ProductProductId}"><text size="20" maxlength="20"/></field>
         <field use-when="product==null&amp;&amp;productId!=null" name="productId" title="${uiLabelMap.ProductProductId}" tooltip="${uiLabelMap.ProductNotFindProductId} [${productId}]"><text size="20" maxlength="20"/></field>
 

Added: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/PhysicalInventoryVariance.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/PhysicalInventoryVariance.bsh?view=auto&rev=534254
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/PhysicalInventoryVariance.bsh (added)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/PhysicalInventoryVariance.bsh Tue May  1 15:12:53 2007
@@ -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 java.util.*;
+import org.ofbiz.entity.*;
+import org.ofbiz.base.util.*;
+
+// get physicalInventoryAndVarianceDatas if this is a NON_SERIAL_INV_ITEM
+if (inventoryItem != null && "NON_SERIAL_INV_ITEM".equals(inventoryItem.getString("inventoryItemTypeId"))) {
+    physicalInventoryAndVariances = delegator.findByAnd("PhysicalInventoryAndVariance", UtilMisc.toMap("inventoryItemId", inventoryItemId), UtilMisc.toList("-physicalInventoryDate", "-physicalInventoryId"));
+    physicalInventoryAndVarianceDatas = new ArrayList(physicalInventoryAndVariances.size());
+    physicalInventoryAndVarianceIter = physicalInventoryAndVariances.iterator();
+    while (physicalInventoryAndVarianceIter.hasNext()) {
+        physicalInventoryAndVariance = physicalInventoryAndVarianceIter.next();
+        physicalInventoryAndVarianceData = new HashMap();
+        physicalInventoryAndVarianceDatas.add(physicalInventoryAndVarianceData);
+
+        physicalInventoryAndVarianceData.put("physicalInventoryAndVariance", physicalInventoryAndVariance);
+        physicalInventoryAndVarianceData.put("varianceReason", physicalInventoryAndVariance.getRelatedOneCache("VarianceReason"));
+        physicalInventoryAndVarianceData.put("person", physicalInventoryAndVariance.getRelatedOne("Person"));
+        physicalInventoryAndVarianceData.put("partyGroup", physicalInventoryAndVariance.getRelatedOne("PartyGroup"));
+    }
+
+    context.put("physicalInventoryAndVarianceDatas", physicalInventoryAndVarianceDatas);
+}

Propchange: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/PhysicalInventoryVariance.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/PhysicalInventoryVariance.bsh
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/PhysicalInventoryVariance.bsh
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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?view=diff&rev=534254&r1=534253&r2=534254
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/inventory/InventoryForms.xml (original)
+++ ofbiz/trunk/applications/product/webapp/facility/inventory/InventoryForms.xml Tue May  1 15:12:53 2007
@@ -20,8 +20,79 @@
 
 <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/widget-form.xsd">
+    <form name="EditInventoryItem" type="single" target="UpdateInventoryItem" title="">
+        <actions>
+            <set field="inventoryItemTypeId" from-field="inventoryItem.inventoryItemTypeId"/>
+            <set field="productId" from-field="inventoryItem.productId"/>
+            <set field="facilityId" from-field="inventoryItem.facilityId"/>
+            <set field="locationSeqId" from-field="inventoryItem.locationSeqId"/>
+            <entity-one entity-name="FacilityLocation" value-name="facilityLocation">
+                <field-map field-name="locationSeqId" env-name="locationSeqId"/>
+                <field-map field-name="facilityId" env-name="facilityId"/>                
+            </entity-one>
+        </actions>
+        <alt-target use-when="inventoryItemId==null" target="CreateInventoryItem"/>
+        <auto-fields-service service-name="updateInventoryItem" map-name="inventoryItem"/>
+
+        <!-- ignored fields -->
+        <field name="oldAvailableToPromise"><ignored/></field>
+        <field name="oldQuantityOnHand"><ignored/></field>
+
+        <!-- custom formatted fields -->
+        <field use-when="inventoryItem!=null" name="inventoryItemId" tooltip="&amp;nbsp;${uiLabelMap.ProductNotModificationRecrationInventoryItem}"><display/></field>
+        <field use-when="inventoryItem==null" name="inventoryItemId"><text/></field>
+        <field name="inventoryItemTypeId">
+            <drop-down allow-empty="false">
+                <entity-options entity-name="InventoryItemType" description="${description}" key-field-name="inventoryItemTypeId"/>
+            </drop-down>
+        </field>
+        <field name="productId">
+            <text>
+                <sub-hyperlink use-when="productId!=null" target="/catalog/control/EditProduct?productId=${productId}" target-type="inter-app" description="Edit Product [${productId}]"/>
+            </text>
+        </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_SERIALIZED_STTS"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="facilityId">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="Facility" description="${facilityName}" key-field-name="facilityId">
+                    <entity-order-by field-name="facilityName"/>
+                </entity-options>
+                <sub-hyperlink use-when="facilityId!=null" target="EditFacility?facilityId=${facilityId}" description="Edit Facility [${facilityId}]"/>
+            </drop-down>                        
+        </field>
+        <field name="locationSeqId" title="${uiLabelMap.ProductFacilityLocation}">
+            <lookup target-form-name="LookupFacilityLocation">
+                <sub-hyperlink use-when="locationSeqId!=null" target="EditFacilityLocation?facilityId=${facilityId}&amp;locationSeqId=${locationSeqId}"></sub-hyperlink>
+            </lookup>
+        </field>        
+        <field name="partyId">
+            <lookup target-form-name="LookupPartyName"/>
+        </field>
+        <field name="ownerPartyId">
+            <lookup target-form-name="LookupPartyName"/>
+        </field>
+        <field name="unitCost"><text/></field>
+
+        <field use-when="inventoryItemTypeId.equals(&quot;NON_SERIAL_INV_ITEM&quot;)" name="totals" title="${uiLabelMap.ProductAvailablePromiseQuantityHand}">
+            <display description="${inventoryItem.availableToPromiseTotal} / ${inventoryItem.quantityOnHandTotal}"/>
+        </field>
+        
+        <field use-when="inventoryItem!=null" name="submit" title="Update">
+            <submit/>
+        </field>
+        <field use-when="inventoryItem==null" name="submit" title="Create">
+            <submit/>
+        </field>
+    </form>
+
     <form name="CreatePhysicalInventoryAndVariance" type="single" target="createPhysicalInventoryAndVariance" title=""
-        default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
+            default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
         <auto-fields-service service-name="createPhysicalInventoryAndVariance"/>
         <field name="physicalInventoryId"><ignored/></field>
         <field name="physicalInventoryDate"><ignored/></field>

Modified: ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml?view=diff&rev=534254&r1=534253&r2=534254
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Tue May  1 15:12:53 2007
@@ -454,8 +454,11 @@
                 <set field="headerItem" value="facility"/>
                 <set field="tabButtonItem" value="EditFacilityInventoryItems"/>
                 <set field="displayWithNoFacility" value="Y"/>
-
-                <script location="component://product/webapp/facility/WEB-INF/actions/inventory/EditInventoryItem.bsh"/>
+                <set field="facilityId" from-field="parameters.facilityId"/>
+                <set field="inventoryItemId" from-field="parameters.inventoryItemId"/>
+                
+                <entity-one entity-name="Facility" value-name="facility" auto-field-map="true"/>
+                <entity-one entity-name="InventoryItem" value-name="inventoryItem" auto-field-map="true"/>
                 <entity-condition entity-name="OrderItemShipGrpInvRes" list-name="inventoryItemReservations">
                     <condition-list combine="and">
                         <condition-expr field-name="inventoryItemId" operator="equals" env-name="inventoryItemId"/>
@@ -464,25 +467,68 @@
                 </entity-condition>
             </actions>
             <widgets>
+                <section>
+                    <condition>
+                        <and>
+                            <not>
+                                <if-empty field-name="inventoryItem"/>
+                            </not>
+                            <if-empty field-name="facility"/>
+                        </and>
+                    </condition>
+                    <actions>
+                        <set field="parameters.facilityId" from-field="inventoryItem.facilityId"/>
+                        <set field="facilityId" from-field="inventoryItem.facilityId"/>
+                        <entity-one entity-name="Facility" value-name="facility"/>
+                    </actions>
+                    <widgets/>
+                </section>
                 <decorator-screen name="CommonFacilityDecorator" location="${parameters.commonFacilityDecoratorLocation}">
                     <decorator-section name="body">
-                        <platform-specific>
-                            <html><html-template location="component://product/webapp/facility/inventory/EditInventoryItem.ftl"/></html>
-                        </platform-specific>
-                        <container>
+                        <section>
+                            <condition>
+                                <not><if-empty field-name="inventoryItem"/></not>
+                            </condition>
+                            <widgets>
+                                <container style="widget-container">
+                                    <link target="EditInventoryItem?facilityId=${facilityId}" text="${uiLabelMap.ProductNewInventoryItem}" style="buttontext"/>
+                                    <link target="TransferInventoryItem?inventoryItemId=${inventoryItemId}&amp;facilityId=${facilityId}" text="${uiLabelMap.ProductTransferItem}" style="buttontext"/>
+                                    <link target="ViewInventoryItemDetail?inventoryItemId=${inventoryItemId}&amp;facilityId=${facilityId}" text="${uiLabelMap.ProductInventoryDetails}" style="buttontext"/>
+                                </container>
+                            </widgets>
+                            <fail-widgets>
+                                <container style="widget-container">
+                                    <link target="EditInventoryItem?facilityId=${facilityId}" text="${uiLabelMap.ProductNewInventoryItem}" style="buttontext"/>
+                                </container>
+                            </fail-widgets>
+                        </section>
+
+                        <container style="widget-container">
+                            <include-form name="EditInventoryItem" location="component://product/webapp/facility/inventory/InventoryForms.xml"/>  
+                        </container>
+                        <container style="widget-container">
                             <label style="head2">${uiLabelMap.ProductInventoryItemReservations}</label>
                         </container>
-                        <include-form name="InventoryItemReservations" location="component://product/webapp/facility/inventory/InventoryForms.xml"/>
+                        <container style="widget-container">
+                            <include-form name="InventoryItemReservations" location="component://product/webapp/facility/inventory/InventoryForms.xml"/>
+                        </container>
                         <section>
                             <condition>
                                 <if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM"/>
                             </condition>
+                            <actions>
+                                <script location="component://product/webapp/facility/WEB-INF/actions/inventory/PhysicalInventoryVariance.bsh"/>
+                            </actions>
                             <widgets>
-                                <container>
+                                <container style="widget-container">
                                     <label style="head2">${uiLabelMap.ProductPhysicalInventoryVariances}</label>
                                 </container>
-                                <include-form name="CreatePhysicalInventoryAndVariance" location="component://product/webapp/facility/inventory/InventoryForms.xml"/>
-                                <include-form name="ViewPhysicalInventoryAndVariance" location="component://product/webapp/facility/inventory/InventoryForms.xml"/>
+                                <container style="widget-container">
+                                    <include-form name="CreatePhysicalInventoryAndVariance" location="component://product/webapp/facility/inventory/InventoryForms.xml"/>
+                                </container>
+                                <container style="widget-container">
+                                    <include-form name="ViewPhysicalInventoryAndVariance" location="component://product/webapp/facility/inventory/InventoryForms.xml"/>
+                                </container>
                             </widgets>
                         </section>
                     </decorator-section>