get_payroll_period return name, fix hard coded leave period
This commit is contained in:
parent
31eeff00f7
commit
58363e6bbd
@ -493,9 +493,9 @@ class SalarySlip(TransactionBase):
|
||||
# Calculate total exemption declaration
|
||||
exemption_amount = 0
|
||||
if frappe.db.exists("Employee Tax Exemption Declaration", {"employee": self.employee,
|
||||
"payroll_period": payroll_period.parent, "docstatus": 1}):
|
||||
"payroll_period": payroll_period.name, "docstatus": 1}):
|
||||
exemption_amount = frappe.db.get_value("Employee Tax Exemption Declaration",
|
||||
{"employee": self.employee, "payroll_period": "2018", "docstatus": 1}, #fix period
|
||||
{"employee": self.employee, "payroll_period": payroll_period.name, "docstatus": 1}, #fix period
|
||||
"total_exemption_amount")
|
||||
annual_earning = annual_earning - exemption_amount
|
||||
|
||||
|
@ -236,7 +236,7 @@ def get_leave_period(from_date, to_date, company):
|
||||
return leave_period
|
||||
|
||||
def get_payroll_period(from_date, to_date, company):
|
||||
payroll_period = frappe.db.sql("""select pd.parent, pd.start_date, pd.end_date from
|
||||
payroll_period = frappe.db.sql("""select pp.name, pd.start_date, pd.end_date from
|
||||
`tabPayroll Period Date` pd join `tabPayroll Period` pp on
|
||||
pd.parent=pp.name where pd.start_date<=%s and pd.end_date>= %s
|
||||
and pp.company=%s""", (from_date, to_date, company), as_dict=1)
|
||||
|
Loading…
Reference in New Issue
Block a user