Filter

22 views
Skip to first unread message

Rohit Waghchaure

unread,
Mar 12, 2013, 5:53:43 AM3/12/13
to erpnext-dev...@googlegroups.com
Hell Sir

            I have added following custom filter but it does not working for following query

Query:-
  select * from (select dsr.site_id,dsr.site_name,a.vendor_id,a.types_of_services,ifnull(v.no_of_employee,0),ifnull(a.present_vendor,0),ifnull((v.no_of_employee),0)-ifnull((a.present_vendor),0) as Short_Fall,dsr.name,a.modified from (select f.site_id,f.site_name,f.name,f.modified from (select site_id,site_name,max(modified) as maxtime from `tabDaily Site Report` group by site_id) as x inner join `tabDaily Site Report` as f on f.site_id=x.site_id and f.modified=x.maxtime) as dsr join `tabDSR Vendor Detail Main` as a  on a.parent=dsr.name join `tabVendor Master Detail` v on v.parent=dsr.site_id and v.types_of_services=a.types_of_services order by dsr.name) as z where z.Short_Fall=0 order by z.name 
 
Custom filter code:-
report.customize_filters = function() {
 this.add_filter({fieldname:'Site Id', label:'Site Id', fieldtype:'Link',parent:'Site',options:'Site'});
}


Thanx and regards
Rohit

Rushabh Mehta

unread,
Mar 12, 2013, 6:11:14 AM3/12/13
to erpnext-dev...@googlegroups.com
Can you send code samples using gist.github.com or pastebin?

Please follow formatting guidelines where ever you can. It makes the task of helping you easier.


W: https://erpnext.com
T: @rushabh_mehta

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/YpJP70Cyn-MJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rohit Waghchaure

unread,
Mar 12, 2013, 6:42:27 AM3/12/13
to erpnext-dev...@googlegroups.com
Hello Sir
                I have added my code on following link .
Thanx and Regards
Rohit

Nabin Hait

unread,
Mar 12, 2013, 7:53:34 AM3/12/13
to erpnext-dev...@googlegroups.com
Add condition of site id in the query like following format:
`site_id` LIKE '%(site_id)s%%'

Also, while adding filter, fieldname should not have any spaces, use any single word like "site_id"

Regards,
Nabin Hait
Reply all
Reply to author
Forward
0 new messages