From 07e5758a943d600c69f6bfe2e3aea9b1e95a3ff3 Mon Sep 17 00:00:00 2001 From: Ben Cornwell-Mott Date: Tue, 26 Jul 2016 21:00:43 -0700 Subject: [PATCH] Timesheets update on date changes in Salary Slip --- erpnext/hr/doctype/salary_slip/salary_slip.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index f83d1448ec..3bc7f0e22e 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -61,9 +61,8 @@ class SalarySlip(TransactionBase): self.pull_sal_struct(ss_doc) def set_time_sheet(self): - if self.salary_slip_based_on_timesheet and not self.get('timesheets'): + if self.salary_slip_based_on_timesheet: self.set("timesheets", []) - timesheets = frappe.db.sql(""" select * from `tabTimesheet` where employee = %(employee)s and start_date BETWEEN %(start_date)s AND %(end_date)s and (status = 'Submitted' or status = 'Billed')""", {'employee': self.employee, 'start_date': self.start_date, 'end_date': self.end_date}, as_dict=1)