diff --git a/hrms/payroll/doctype/payroll_entry/payroll_entry.js b/hrms/payroll/doctype/payroll_entry/payroll_entry.js index b28cab0acf..f828d560ad 100644 --- a/hrms/payroll/doctype/payroll_entry/payroll_entry.js +++ b/hrms/payroll/doctype/payroll_entry/payroll_entry.js @@ -128,10 +128,14 @@ frappe.ui.form.on('Payroll Entry', { add_context_buttons: function (frm) { if (frm.doc.salary_slips_submitted || (frm.doc.__onload && frm.doc.__onload.submitted_ss)) { frm.events.add_bank_entry_button(frm); - } else if (frm.doc.salary_slips_created && frm.doc.status != 'Queued') { - frm.add_custom_button(__("Submit Salary Slip"), function () { + } else if (frm.doc.salary_slips_created && frm.doc.status !== "Queued") { + frm.add_custom_button(__("Submit Salary Slip"), function() { submit_salary_slip(frm); }).addClass("btn-primary"); + } else if (!frm.doc.salary_slips_created && frm.doc.status === "Failed") { + frm.add_custom_button(__("Create Salary Slips"), function() { + frm.trigger("create_salary_slips"); + }).addClass("btn-primary"); } }, diff --git a/hrms/payroll/doctype/payroll_entry/payroll_entry.py b/hrms/payroll/doctype/payroll_entry/payroll_entry.py index e3f03680bc..df24d5cbcb 100644 --- a/hrms/payroll/doctype/payroll_entry/payroll_entry.py +++ b/hrms/payroll/doctype/payroll_entry/payroll_entry.py @@ -1099,8 +1099,9 @@ def log_payroll_failure(process, payroll_entry, error): def create_salary_slips_for_employees(employees, args, publish_progress=True): + payroll_entry = frappe.get_doc("Payroll Entry", args.payroll_entry) + try: - payroll_entry = frappe.get_doc("Payroll Entry", args.payroll_entry) salary_slips_exist_for = get_existing_salary_slips(employees, args) count = 0 diff --git a/hrms/payroll/doctype/salary_component/salary_component.js b/hrms/payroll/doctype/salary_component/salary_component.js index 7e2e286930..dbf75140ac 100644 --- a/hrms/payroll/doctype/salary_component/salary_component.js +++ b/hrms/payroll/doctype/salary_component/salary_component.js @@ -38,11 +38,6 @@ frappe.ui.form.on('Salary Component', { frm.set_value("is_flexible_benefit", 0); } }, - is_income_tax_component: function(frm) { - if (cint(frm.doc.is_income_tax_component)) { - frm.set_value("variable_based_on_taxable_salary", 1); - } - }, variable_based_on_taxable_salary: function(frm) { if(frm.doc.variable_based_on_taxable_salary){ set_value_for_condition_and_formula(frm); diff --git a/hrms/payroll/doctype/salary_component/salary_component.json b/hrms/payroll/doctype/salary_component/salary_component.json index f7e7785fa6..1c0cad7379 100644 --- a/hrms/payroll/doctype/salary_component/salary_component.json +++ b/hrms/payroll/doctype/salary_component/salary_component.json @@ -17,9 +17,9 @@ "column_break_4", "depends_on_payment_days", "is_tax_applicable", - "is_income_tax_component", "deduct_full_tax_on_selected_payroll_date", "variable_based_on_taxable_salary", + "is_income_tax_component", "exempted_from_income_tax", "round_to_the_nearest_integer", "statistical_component", @@ -266,7 +266,7 @@ "icon": "fa fa-flag", "index_web_pages_for_search": 1, "links": [], - "modified": "2023-07-31 13:35:37.413696", + "modified": "2023-08-25 13:35:37.413696", "modified_by": "Administrator", "module": "Payroll", "name": "Salary Component", diff --git a/hrms/payroll/doctype/salary_component/salary_component.py b/hrms/payroll/doctype/salary_component/salary_component.py index 6de93e38b7..5a19d0de32 100644 --- a/hrms/payroll/doctype/salary_component/salary_component.py +++ b/hrms/payroll/doctype/salary_component/salary_component.py @@ -9,11 +9,6 @@ class SalaryComponent(Document): def validate(self): self.validate_abbr() - self.set_tax_component() - - def set_tax_component(self): - if self.is_income_tax_component: - self.variable_based_on_taxable_salary = 1 def on_update(self): self.invalidate_cache()