Hello,

I would like to introduce into my web site the best sales by product
I try to use (in a groovy file) :

delegator.findByAnd("OrderReportSalesGroupByProduct", [productStoreId : 
productStoreId])

I have the following error :

Error rendering screen 
[component://mobilier/widget/CatalogScreens.xml#categorydetail]: 
org.ofbiz.base.util.GeneralException: Error running Groovy script at location 
[component://mobilier/webapp/mobilier/WEB-INF/actions/catalog/CategoryDetail.groovy]
 (SQL Exception while executing the following:SELECT OH.PRODUCT_STORE_ID, 
PS.STORE_NAME, OI.PRODUCT_ID, PR.INTERNAL_NAME, OH.ORDER_DATE, OH.STATUS_ID, 
OI.STATUS_ID, OH.ORDER_TYPE_ID, RL.PARTY_ID, RL.ROLE_TYPE_ID, SUM(OI.QUANTITY), 
SUM(OI.UNIT_PRICE) FROM (((public.ORDER_HEADER OH INNER JOIN public.ORDER_ITEM 
OI ON OH.ORDER_ID = OI.ORDER_ID) INNER JOIN public.ORDER_ROLE RL ON OH.ORDER_ID 
= RL.ORDER_ID) INNER JOIN public.PRODUCT PR ON OI.PRODUCT_ID = PR.PRODUCT_ID) 
INNER JOIN public.PRODUCT_STORE PS ON OH.PRODUCT_STORE_ID = PS.PRODUCT_STORE_ID 
WHERE (OH.PRODUCT_STORE_ID = ?) GROUP BY OH.PRODUCT_STORE_ID, PS.STORE_NAME, 
OI.PRODUCT_ID, PR.INTERNAL_NAME (ERROR: column "oh.order_date" must appear in 
the GROUP BY clause or be used in an aggregate function))

I read 
http://www.nabble.com/how-to-see-data-in-view-table--td17765415.html#a17765415

How can I order by quantity ?
Do you have a solution ?

Thanks

Eric 

Reply via email to