Trend analyzer fix due to project field movement to item level in pur cycle
This commit is contained in:
parent
d0c9d422af
commit
e2f0c5dfd0
@ -101,8 +101,13 @@ report.get_query = function() {
|
|||||||
if(supp_type) add_cond += ' AND t1.supplier_type = "'+supp_type+'"';
|
if(supp_type) add_cond += ' AND t1.supplier_type = "'+supp_type+'"';
|
||||||
break;
|
break;
|
||||||
case 'Project' : pro = this.get_filter('Profile', 'Project').get_value();
|
case 'Project' : pro = this.get_filter('Profile', 'Project').get_value();
|
||||||
|
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';
|
col = 'DISTINCT t1.project_name';
|
||||||
if(pro) add_cond += ' AND t1.project_name = "'+pro+'"';
|
if(pro) add_cond += ' AND t1.project_name = "'+pro+'"';
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'Item Group' : ig = this.get_filter('Profile', 'Item Group').get_value();
|
case 'Item Group' : ig = this.get_filter('Profile', 'Item Group').get_value();
|
||||||
if(ig) sp_cond += ' AND parent.name = "'+ig+'"';
|
if(ig) sp_cond += ' AND parent.name = "'+ig+'"';
|
||||||
|
@ -118,6 +118,9 @@ if supplier_type or based_on == 'Supplier Type':
|
|||||||
|
|
||||||
# Project
|
# Project
|
||||||
if project or based_on == 'Project':
|
if project or based_on == 'Project':
|
||||||
|
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')
|
add_cond += ' AND t1.project_name = "%s"' % (based_on != 'Project' and project or '%(value)s')
|
||||||
|
|
||||||
# Column to be seleted for group by condition
|
# Column to be seleted for group by condition
|
||||||
|
Loading…
x
Reference in New Issue
Block a user