Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
4083084d32
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
wn.provide('erpnext.utils');
|
wn.provide('erpnext.utils');
|
||||||
|
|
||||||
// profile related get_query
|
// searches for enabled profiles
|
||||||
erpnext.utils.profile_query = function() {
|
erpnext.utils.profile_query = function() {
|
||||||
return "select name, concat_ws(' ', first_name, middle_name, last_name) \
|
return "select name, concat_ws(' ', first_name, middle_name, last_name) \
|
||||||
from `tabProfile` where ifnull(enabled, 0)=1 and docstatus < 2 and \
|
from `tabProfile` where ifnull(enabled, 0)=1 and docstatus < 2 and \
|
||||||
@ -25,10 +25,18 @@ erpnext.utils.profile_query = function() {
|
|||||||
order by name asc limit 50";
|
order by name asc limit 50";
|
||||||
};
|
};
|
||||||
|
|
||||||
// employee related get query
|
// searches for active employees
|
||||||
erpnext.utils.employee_query = function() {
|
erpnext.utils.employee_query = function() {
|
||||||
return "select name, employee_name from `tabEmployee` \
|
return "select name, employee_name from `tabEmployee` \
|
||||||
where status = 'Active' and docstatus < 2 and \
|
where status = 'Active' and docstatus < 2 and \
|
||||||
(employee_name like \"%%%s\" or %(key)s like \"%s\") \
|
(%(key)s like \"%s\" or employee_name like \"%%%s\") \
|
||||||
order by name asc limit 50";
|
order by name asc limit 50";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// searches for leads which are not converted
|
||||||
|
erpnext.utils.lead_query = function() {
|
||||||
|
return "select name, lead_name, company_name from `tabLead` \
|
||||||
|
where docstatus < 2 and ifnull(status, '') != 'Converted' and \
|
||||||
|
(%(key)s like \"%s\" or lead_name like \"%%%s\" or company_name like \"%%%s\") \
|
||||||
|
order by lead_name asc limit 50";
|
||||||
|
};
|
||||||
|
@ -117,12 +117,7 @@ cur_frm.fields_dict['customer_group'].get_query = function(doc,dt,dn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -----
|
cur_frm.fields_dict.lead_name.get_query = erpnext.utils.lead_query;
|
||||||
// lead
|
|
||||||
// -----
|
|
||||||
cur_frm.fields_dict['lead_name'].get_query = function(doc,dt,dn){
|
|
||||||
return 'SELECT `tabLead`.`name` FROM `tabLead` WHERE `tabLead`.`status`!="Converted" AND `tabLead`.%(key)s LIKE "%s" ORDER BY `tabLead`.`name` ASC LIMIT 50';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Transaction History
|
// Transaction History
|
||||||
|
@ -209,3 +209,5 @@ cur_frm.cscript['Declare Opportunity Lost'] = function(){
|
|||||||
//get query select Territory
|
//get query select Territory
|
||||||
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
||||||
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';}
|
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.lead.get_query = erpnext.utils.lead_query;
|
@ -148,10 +148,7 @@ cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) {
|
|||||||
return 'SELECT name,CONCAT(first_name," ",ifnull(last_name,"")) As FullName,department,designation FROM tabContact WHERE customer = "'+ doc.customer +'" AND docstatus != 2 AND name LIKE "%s" ORDER BY name ASC LIMIT 50';
|
return 'SELECT name,CONCAT(first_name," ",ifnull(last_name,"")) As FullName,department,designation FROM tabContact WHERE customer = "'+ doc.customer +'" AND docstatus != 2 AND name LIKE "%s" ORDER BY name ASC LIMIT 50';
|
||||||
}
|
}
|
||||||
|
|
||||||
//lead
|
cur_frm.fields_dict.lead.get_query = erpnext.utils.lead_query;
|
||||||
cur_frm.fields_dict['lead'].get_query = function(doc,cdt,cdn){
|
|
||||||
return 'SELECT `tabLead`.name, `tabLead`.lead_name FROM `tabLead` WHERE `tabLead`.%(key)s LIKE "%s" ORDER BY `tabLead`.`name` ASC LIMIT 50';
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_frm.cscript.lead = function(doc, cdt, cdn) {
|
cur_frm.cscript.lead = function(doc, cdt, cdn) {
|
||||||
if(doc.lead) {
|
if(doc.lead) {
|
||||||
|
@ -6,6 +6,14 @@ cur_frm.cscript.onload = function(doc) {
|
|||||||
concat_ws(' ', first_name, middle_name, last_name) like \"%%%s\") \
|
concat_ws(' ', first_name, middle_name, last_name) like \"%%%s\") \
|
||||||
limit 50";
|
limit 50";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
cur_frm.fields_dict.lead.get_query = function() {
|
||||||
|
return "select name, lead_name from `tabLead` \
|
||||||
|
where docstatus < 2 and \
|
||||||
|
(%(key)s like \"%s\" or lead_name like \"%%%s\" or \
|
||||||
|
company_name like \"%%%s\") \
|
||||||
|
order by lead_name asc limit 50";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.refresh = function(doc, dt, dn) {
|
cur_frm.cscript.refresh = function(doc, dt, dn) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user