From 9755a78c81530f1a8d331f8ef1e81ce2d191c196 Mon Sep 17 00:00:00 2001 From: Aysha Date: Fri, 10 Jan 2025 15:37:22 +0530 Subject: [PATCH 1/2] fix: enable opening tax balance config for existing employees during salary assignment --- .../salary_structure_assignment.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/hrms/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py b/hrms/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py index 00dc6a5eba..4d58a805da 100644 --- a/hrms/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py +++ b/hrms/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py @@ -172,14 +172,7 @@ def are_opening_entries_required(self) -> bool: if not get_tax_component(self.salary_structure): return False - if self.has_emp_joined_after_payroll_period_start() and not self.has_existing_salary_slips(): - return True - else: - if not self.docstatus.is_draft() and ( - self.taxable_earnings_till_date or self.tax_deducted_till_date - ): - return True - return False + return True def has_existing_salary_slips(self) -> bool: return bool( From a286e424c8836b946e8185c6b000527dc653b5e0 Mon Sep 17 00:00:00 2001 From: Aysha Date: Mon, 13 Jan 2025 16:50:41 +0530 Subject: [PATCH 2/2] fix: remove unused helper functions --- .../salary_structure_assignment.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/hrms/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py b/hrms/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py index 4d58a805da..01dcf89017 100644 --- a/hrms/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py +++ b/hrms/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py @@ -174,21 +174,6 @@ def are_opening_entries_required(self) -> bool: return True - def has_existing_salary_slips(self) -> bool: - return bool( - frappe.db.exists( - "Salary Slip", - {"employee": self.employee, "docstatus": 1}, - ) - ) - - def has_emp_joined_after_payroll_period_start(self) -> bool: - date_of_joining = getdate(frappe.db.get_value("Employee", self.employee, "date_of_joining")) - payroll_period = get_payroll_period(self.from_date, self.from_date, self.company) - if not payroll_period or date_of_joining > getdate(payroll_period.start_date): - return True - return False - def get_assigned_salary_structure(employee, on_date): if not employee or not on_date: