diff --git a/erpnext/payroll/doctype/salary_slip/test_salary_slip.py b/erpnext/payroll/doctype/salary_slip/test_salary_slip.py index 9ed6686d48..178cd5c9d0 100644 --- a/erpnext/payroll/doctype/salary_slip/test_salary_slip.py +++ b/erpnext/payroll/doctype/salary_slip/test_salary_slip.py @@ -141,7 +141,6 @@ class TestSalarySlip(unittest.TestCase): create_salary_structure_assignment, ) - no_of_days = self.get_no_of_days() # Payroll based on attendance frappe.db.set_value("Payroll Settings", None, "payroll_based_on", "Attendance") @@ -168,9 +167,6 @@ class TestSalarySlip(unittest.TestCase): ss = make_salary_slip_for_payment_days_dependency_test("test_payment_days_based_component@salary.com", salary_structure.name) self.assertEqual(ss.absent_days, 1) - days_in_month = no_of_days[0] - no_of_holidays = no_of_days[1] - ss.reload() payment_days_based_comp_amount = 0 for component in ss.earnings: @@ -992,13 +988,14 @@ def make_salary_structure_for_payment_days_based_component_dependency(): return salary_structure_doc def make_salary_slip_for_payment_days_dependency_test(employee, salary_structure): - employee = frappe.db.get_value("Employee", { - "user_id": employee - }, + employee = frappe.db.get_value( + "Employee", + {"user_id": employee}, ["name", "company", "employee_name"], - as_dict=True) + as_dict=True + ) - salary_slip_name = frappe.db.get_value("Salary Slip", {"employee": frappe.db.get_value("Employee", {"user_id": employee})}) + salary_slip_name = frappe.db.get_value("Salary Slip", {"employee": employee.name}) if not salary_slip_name: salary_slip = make_salary_slip(salary_structure, employee=employee.name) @@ -1009,4 +1006,4 @@ def make_salary_slip_for_payment_days_dependency_test(employee, salary_structure else: salary_slip = frappe.get_doc("Salary Slip", salary_slip_name) - return salary_slip \ No newline at end of file + return salary_slip