Trend analyzer fix due to project field movement to item level in pur cycle

This commit is contained in:
Nabin Hait 2011-10-21 14:55:16 +05:30
parent d0c9d422af
commit e2f0c5dfd0
2 changed files with 11 additions and 3 deletions

View File

@ -101,8 +101,13 @@ report.get_query = function() {
if(supp_type) add_cond += ' AND t1.supplier_type = "'+supp_type+'"';
break;
case 'Project' : pro = this.get_filter('Profile', 'Project').get_value();
col = 'DISTINCT t1.project_name';
if(pro) add_cond += ' AND t1.project_name = "'+pro+'"';
if (inList(['Purchase Order', 'Purchase Receipt', 'Payable Voucher'], trans)) {
col = 'DISTINCT t2.project_name';
if(pro) add_cond += ' AND t2.project_name = "'+pro+'"';
} else {
col = 'DISTINCT t1.project_name';
if(pro) add_cond += ' AND t1.project_name = "'+pro+'"';
}
break;
case 'Item Group' : ig = this.get_filter('Profile', 'Item Group').get_value();
if(ig) sp_cond += ' AND parent.name = "'+ig+'"';

View File

@ -118,7 +118,10 @@ if supplier_type or based_on == 'Supplier Type':
# Project
if project or based_on == 'Project':
add_cond += ' AND t1.project_name = "%s"' % (based_on != 'Project' and project or '%(value)s')
if trans in ['Purchase Order', 'Purchase Receipt', 'Payable Voucher']:
add_cond += ' AND t2.project_name = "%s"' % (based_on != 'Project' and project or '%(value)s')
else:
add_cond += ' AND t1.project_name = "%s"' % (based_on != 'Project' and project or '%(value)s')
# Column to be seleted for group by condition
# ==============================================