Jacopo,
Why does this .bsh method not use the getSuppliersForProduct service? Si Author: jacopoc Date: Wed Mar 21 00:41:12 2007 New Revision: 520784 URL: http://svn.apache.org/viewvc?view=rev&rev=520784 Log: Added from/thru dates to the list of fields returned by the query on SupplierProduct. They are needed to filter discontinued items (see the call to EntityUtil.filterByDate(...)). Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh?view=diff&rev=520784&r1=520783&r2=520784 ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh Wed Mar 21 00:41:12 2007 @@ -45,6 +45,6 @@ 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 = delegator.findByCondition("SupplierProduct", conditions, UtilMisc.toList("productId", "supplierProductId", "supplierProductName", "lastPrice", "minimumOrderQuantity", "availableFromDate", "availableThruDate"), UtilMisc.toList("productId")); productList = EntityUtil.filterByDate(productList, UtilDateTime.nowTimestamp(), "availableFromDate", "availableThruDate", true); context.put("productList", productList); |
Si,
I guess that the main reason is that the script has been copied from the similar one used in sales orders. Another problem would be that the lookup by the first letters of the product id is not currently supported by the getSuppliersForProduct But all in all it would be great to refactor the script to use that service. Jacopo Si Chen wrote: > Jacopo, > > Why does this .bsh method not use the getSuppliersForProduct service? > > Si > > ------------------------------------------------------------------------ > > Subject: > svn commit: r520784 - > /ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh > From: > [hidden email] > Date: > Wed, 21 Mar 2007 07:41:13 -0000 > To: > [hidden email] > > To: > [hidden email] > > > Author: jacopoc > Date: Wed Mar 21 00:41:12 2007 > New Revision: 520784 > > URL: http://svn.apache.org/viewvc?view=rev&rev=520784 > Log: > Added from/thru dates to the list of fields returned by the query on SupplierProduct. > They are needed to filter discontinued items (see the call to EntityUtil.filterByDate(...)). > > Modified: > ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh > > Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh > URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh?view=diff&rev=520784&r1=520783&r2=520784 > ============================================================================== > --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh (original) > +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh Wed Mar 21 00:41:12 2007 > @@ -45,6 +45,6 @@ > 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 = delegator.findByCondition("SupplierProduct", conditions, UtilMisc.toList("productId", "supplierProductId", "supplierProductName", "lastPrice", "minimumOrderQuantity", "availableFromDate", "availableThruDate"), UtilMisc.toList("productId")); > productList = EntityUtil.filterByDate(productList, UtilDateTime.nowTimestamp(), "availableFromDate", "availableThruDate", true); > context.put("productList", productList); > > |
Free forum by Nabble | Edit this page |