Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Rushabh Mehta 2012-11-19 13:06:44 +01:00
commit 04a7fc447f
11 changed files with 31 additions and 16 deletions

View File

@ -92,3 +92,5 @@ cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
doc.total_score = flt(total);
refresh_field('total_score');
}
cur_frm.fields_dict.employee.get_query = erpnext.utils.employee_query;

View File

@ -22,9 +22,4 @@ cur_frm.cscript.employee = function(doc,cdt,cdn){
refresh_field('employee_name');
}
//Employee
//-----------------------------
cur_frm.fields_dict['employee'].get_query = function(doc,cdt,cdn) {
return 'SELECT `tabEmployee`.`name`, `tabEmployee`.`employee_name` FROM `tabEmployee` WHERE `tabEmployee`.status = "Active" AND `tabEmployee`.`docstatus`!= 2 AND (`tabEmployee`.`employee_name` LIKE "%s" OR `tabEmployee`.`%(key)s` LIKE "%s") ORDER BY `tabEmployee`.`name` ASC LIMIT 50';
}
cur_frm.fields_dict.employee.get_query = erpnext.utils.employee_query;

View File

@ -66,3 +66,5 @@ cur_frm.cscript.make_salary_structure = function(doc,dt,dn,det){
}
cur_frm.fields_dict.user_id.get_query = erpnext.utils.profile_query;
cur_frm.fields_dict.reports_to.get_query = erpnext.utils.employee_query;

View File

@ -255,3 +255,5 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
}
cur_frm.cscript.notify(doc, args);
}
cur_frm.fields_dict.employee.get_query = erpnext.utils.employee_query;

View File

@ -78,3 +78,5 @@ calculate_total_leaves_allocated = function(doc, dt, dn) {
set_multiple(dt,dn,{carry_forwarded_leaves : 0,total_leaves_allocated : flt(doc.new_leaves_allocated)});
}
}
cur_frm.fields_dict.employee.get_query = erpnext.utils.employee_query;

View File

@ -99,3 +99,5 @@ calculate_total_days = function(doc, dt, dn) {
}
}
}
cur_frm.fields_dict.employee.get_query = erpnext.utils.employee_query;

View File

@ -138,3 +138,5 @@ cur_frm.cscript.leave_encashment_amount = cur_frm.cscript.arrear_amount;
cur_frm.cscript.validate = function(doc, dt, dn) {
calculate_all(doc, dt, dn);
}
cur_frm.fields_dict.employee.get_query = erpnext.utils.employee_query;

View File

@ -107,3 +107,5 @@ var calculate_totals = function(doc, cdt, cdn) {
cur_frm.cscript.validate = function(doc, cdt, cdn) {
calculate_totals(doc, cdt, cdn);
}
cur_frm.fields_dict.employee.get_query = erpnext.utils.employee_query;

View File

@ -22,5 +22,13 @@ erpnext.utils.profile_query = function() {
from `tabProfile` where ifnull(enabled, 0)=1 and docstatus < 2 and \
name not in ('Administrator', 'Guest') and (%(key)s like \"%s\" or \
concat_ws(' ', first_name, middle_name, last_name) like \"%%%s\") \
limit 50";
order by name asc limit 50";
};
// employee related get query
erpnext.utils.employee_query = function() {
return "select name, employee_name from `tabEmployee` \
where status = 'Active' and docstatus < 2 and \
(employee_name like \"%%%s\" or %(key)s like \"%s\") \
order by name asc limit 50";
};

View File

@ -85,9 +85,9 @@ cur_frm.cscript.transaction = function(doc,cdt,cdn){
}
cur_frm.fields_dict.system_user.get_query = erpnext.profile_query;
cur_frm.fields_dict.system_user.get_query = erpnext.utils.profile_query;
cur_frm.fields_dict.approving_user.get_query = erpnext.profile_query;
cur_frm.fields_dict.approving_user.get_query = erpnext.utils.profile_query;
// System Role Trigger
// -----------------------
@ -112,3 +112,5 @@ cur_frm.fields_dict['master_name'].get_query = function(doc){
else
return 'SELECT `tabItem`.`name` FROM `tabItem` WHERE `tabItem`.`name` = "cheating done to avoid null" ORDER BY `tabItem`.`name` DESC LIMIT 50';
}
cur_frm.fields_dict.to_emp.get_query = erpnext.utils.employee_query;

View File

@ -38,12 +38,8 @@ cur_frm.fields_dict['parent_sales_person'].get_query = function(doc,cdt,cdn) {
return 'SELECT `tabSales Person`.`name`,`tabSales Person`.`parent_sales_person` FROM `tabSales Person` WHERE `tabSales Person`.`is_group` = "Yes" AND `tabSales Person`.`docstatus`!= 2 AND `tabSales Person`.`name` !="'+doc.sales_person_name+'" AND `tabSales Person`.%(key)s LIKE "%s" ORDER BY `tabSales Person`.`name` ASC LIMIT 50';
}
//get query select Territory
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
return 'SELECT `tabTerritory`.`name` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
}
// ******************** ITEM Group ********************************
cur_frm.fields_dict['target_details'].grid.get_field("item_group").get_query = function(doc, cdt, cdn) {
return 'SELECT `tabItem Group`.name FROM `tabItem Group` WHERE `tabItem Group`.is_group="No" AND `tabItem Group`.docstatus != 2 AND `tabItem Group`.%(key)s LIKE "%s" LIMIT 50'
}
cur_frm.fields_dict.employee.get_query = erpnext.utils.employee_query;