svn commit: r429290 - in /incubator/ofbiz/trunk/applications/order: webapp/ordermgr/WEB-INF/ webapp/ordermgr/WEB-INF/actions/entry/cart/ webapp/ordermgr/entry/cart/ widget/ordermgr/

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

svn commit: r429290 - in /incubator/ofbiz/trunk/applications/order: webapp/ordermgr/WEB-INF/ webapp/ordermgr/WEB-INF/actions/entry/cart/ webapp/ordermgr/entry/cart/ widget/ordermgr/

jacopoc
Author: jacopoc
Date: Mon Aug  7 03:12:53 2006
New Revision: 429290

URL: http://svn.apache.org/viewvc?rev=429290&view=rev
Log:
Implemented new lookup search for products limited by supplier's product if the order is a purchase order.

Added:
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh   (with props)
Modified:
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcart.ftl
    incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryCartScreens.xml
    incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryForms.xml

Added: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh?rev=429290&view=auto
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh (added)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh Mon Aug  7 03:12:53 2006
@@ -0,0 +1,48 @@
+/*
+ *
+ * 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 org.ofbiz.entity.condition.EntityExpr;
+import org.ofbiz.entity.condition.EntityFunction;
+import org.ofbiz.entity.condition.EntityOperator;
+import org.ofbiz.entity.condition.EntityFieldValue;
+import org.ofbiz.entity.condition.EntityConditionList;
+import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilDateTime;
+import org.ofbiz.order.shoppingcart.ShoppingCart;
+import org.ofbiz.order.shoppingcart.ShoppingCartEvents;
+
+productId = request.getParameter("productId");
+if (productId == null) {
+    productId = "";
+}
+
+ShoppingCart shoppingCart = ShoppingCartEvents.getCartObject(request);
+
+conditionList = new LinkedList();
+
+// make sure the look up is case insensitive
+conditionList.add(new EntityExpr(new EntityFunction.UPPER(new EntityFieldValue("productId")),
+                                 EntityOperator.LIKE, productId.toUpperCase() + "%"));
+
+conditionList.add(new EntityExpr("partyId", EntityOperator.EQUALS, shoppingCart.getOrderPartyId()));
+conditionList.add(new EntityExpr("currencyUomId", EntityOperator.EQUALS, shoppingCart.getCurrency()));
+conditions = new EntityConditionList(conditionList, EntityOperator.AND);
+
+productList = delegator.findByCondition("SupplierProduct", conditions, UtilMisc.toList("productId", "supplierProductId", "supplierProductName", "lastPrice", "minimumOrderQuantity"), UtilMisc.toList("productId"));
+productList = EntityUtil.filterByDate(productList, UtilDateTime.nowTimestamp(), "availableFromDate", "availableThruDate", true);
+context.put("productList", productList);

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?rev=429290&r1=429289&r2=429290&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Mon Aug  7 03:12:53 2006
@@ -1280,6 +1280,7 @@
 
     <request-map uri="LookupWorkEffort"><security https="true" auth="true"/><response name="success" type="view" value="LookupWorkEffort"/></request-map>
     <request-map uri="LookupBulkAddProducts"><security https="true" auth="true"/><response name="success" type="view" value="LookupBulkAddProducts"/></request-map>
+    <request-map uri="LookupBulkAddSupplierProducts"><security https="true" auth="true"/><response name="success" type="view" value="LookupBulkAddSupplierProducts"/></request-map>
     <!-- PDFs -->
     <request-map uri="order.pdf"><security https="true" auth="true"/><response name="success" type="view" value="OrderPDF"/></request-map>
     <request-map uri="return.pdf"><security https="true" auth="true"/><response name="success" type="view" value="ReturnPDF"/></request-map>
@@ -1421,6 +1422,7 @@
 
     <view-map name="LookupWorkEffort" type="screen" page="component://workeffort/widget/LookupScreens.xml#LookupWorkEffort"/>
     <view-map name="LookupBulkAddProducts" type="screen" page="component://order/widget/ordermgr/OrderEntryCartScreens.xml#LookupBulkAddProducts"/>
+    <view-map name="LookupBulkAddSupplierProducts" type="screen" page="component://order/widget/ordermgr/OrderEntryCartScreens.xml#LookupBulkAddSupplierProducts"/>
     <!-- PDFs  -->
     <view-map name="OrderPDF" type="screenfop" page="component://order/widget/ordermgr/OrderPrintForms.xml#OrderPDF" content-type="application/pdf" encoding="none"/>
     <view-map name="ReturnPDF" type="screenfop" page="component://order/widget/ordermgr/OrderPrintForms.xml#ReturnPDF" content-type="application/pdf" encoding="none"/>

Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcart.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcart.ftl?rev=429290&r1=429289&r2=429290&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcart.ftl (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcart.ftl Mon Aug  7 03:12:53 2006
@@ -95,7 +95,11 @@
     obj_lookupwindow.focus();
 }
 function quicklookup(element) {
+    <#if shoppingCart.getOrderType() == "PURCHASE_ORDER">
+    window.location='LookupBulkAddSupplierProducts?productId='+element.value;
+    <#else>
     window.location='LookupBulkAddProducts?productId='+element.value;
+    </#if>
 }
 </script>
 

Modified: incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryCartScreens.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryCartScreens.xml?rev=429290&r1=429289&r2=429290&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryCartScreens.xml (original)
+++ incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryCartScreens.xml Mon Aug  7 03:12:53 2006
@@ -159,4 +159,19 @@
             </widgets>
         </section>
     </screen>
+    <screen name="LookupBulkAddSupplierProducts">
+     <section>
+            <actions>
+                <set field="title" value="Bulk Add Supplier Product"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonOrderCatalogDecorator" location="component://order/widget/ordermgr/OrderEntryCommonScreens.xml">
+                    <decorator-section name="body">
+                        <include-form name="LookupBulkAddSupplierProducts" location="component://order/widget/ordermgr/OrderEntryForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>

Modified: incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryForms.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryForms.xml?rev=429290&r1=429289&r2=429290&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryForms.xml (original)
+++ incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryForms.xml Mon Aug  7 03:12:53 2006
@@ -150,5 +150,24 @@
             <submit/>
         </field>
     </form>
+    <form name="LookupBulkAddSupplierProducts" type="multi" use-row-submit="true" list-name="productList" title=""
+            target="BulkAddProducts" paginate-target="BulkAddSupplierProducts" default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
+        <field name="productId" widget-style="buttontext">
+            <hyperlink description="${productId}" target="/catalog/control/EditProductInventoryItems?productId=${productId}" target-type="inter-app"/>
+        </field>
+        <field name="supplierProductId" widget-style="tabletext"><display/></field>
+        <field name="supplierProductName" widget-style="tabletext"><display/></field>
+        <field name="lastPrice" widget-style="tabletext"><display/></field>
+        <field name="minimumOrderQuantity" widget-style="tabletext"><display/></field>
+        <field name="quantity" title="${uiLabelMap.OrderQuantity}">
+            <text size="5" maxlength="10"/>
+        </field>
+        <field name="itemDesiredDeliveryDate" title="${uiLabelMap.OrderDesiredDeliveryDate}">
+            <date-time/>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.OrderAddToOrder}" widget-style="smallSubmit">
+            <submit/>
+        </field>
+    </form>
 
 </forms>