mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 22:49:19 +00:00
[Fix] Filters to get employee in Payroll
This commit is contained in:
@@ -22,7 +22,7 @@ class ProcessPayroll(Document):
|
||||
|
||||
sal_struct = frappe.db.sql("""
|
||||
select name from `tabSalary Structure`
|
||||
where docstatus != 2 and company = %(company)s and
|
||||
where docstatus != 2 and is_active = 'Yes' and company = %(company)s and
|
||||
ifnull(salary_slip_based_on_timesheet,0) = %(salary_slip_based_on_timesheet)s""",
|
||||
{"company": self.company, "salary_slip_based_on_timesheet":self.salary_slip_based_on_timesheet})
|
||||
|
||||
@@ -51,8 +51,8 @@ class ProcessPayroll(Document):
|
||||
|
||||
def get_joining_releiving_condition(self):
|
||||
cond = """
|
||||
and ifnull(t1.date_of_joining, '0000-00-00') <= '%(from_date)s'
|
||||
and ifnull(t1.relieving_date, '2199-12-31') >= '%(to_date)s'
|
||||
and ifnull(t1.date_of_joining, '0000-00-00') <= '%(to_date)s'
|
||||
and ifnull(t1.relieving_date, '2199-12-31') >= '%(from_date)s'
|
||||
""" % {"from_date": self.from_date, "to_date": self.to_date}
|
||||
return cond
|
||||
|
||||
|
||||
@@ -28,7 +28,15 @@ frappe.ui.form.on('Salary Structure', {
|
||||
type: "deduction"
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
frm.set_query("employee", "employees", function(doc) {
|
||||
return {
|
||||
query: "erpnext.controllers.queries.employee_query",
|
||||
filters: {
|
||||
company: doc.company
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
@@ -182,11 +190,3 @@ frappe.ui.form.on('Salary Detail', {
|
||||
calculate_totals(frm.doc);
|
||||
}
|
||||
})
|
||||
|
||||
frappe.ui.form.on('Salary Structure Employee', {
|
||||
onload: function(frm) {
|
||||
frm.set_query("employee","employees", function(doc,cdt,cdn) {
|
||||
return{ query: "erpnext.controllers.queries.employee_query" }
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user