You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Si Chen <si...@opensourcestrategies.com> on 2007/03/21 16:56:08 UTC

[Fwd: svn commit: r520784 - /ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh]

Jacopo,

Why does this .bsh method not use the getSuppliersForProduct service?

Si

Re: [Fwd: svn commit: r520784 - /ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.bsh]

Posted by Jacopo Cappellato <ti...@sastau.it>.
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:
> jacopoc@apache.org
> Date:
> Wed, 21 Mar 2007 07:41:13 -0000
> To:
> commits@ofbiz.apache.org
> 
> To:
> commits@ofbiz.apache.org
> 
> 
> 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);
> 
>