Skip to content

Commit

Permalink
Merge pull request #829 from frappe/version-14-hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchamahabal authored Aug 29, 2023
2 parents ca98ad0 + 3289557 commit 6c25eb9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
8 changes: 6 additions & 2 deletions hrms/payroll/doctype/payroll_entry/payroll_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
},

Expand Down
3 changes: 2 additions & 1 deletion hrms/payroll/doctype/payroll_entry/payroll_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 0 additions & 5 deletions hrms/payroll/doctype/salary_component/salary_component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions hrms/payroll/doctype/salary_component/salary_component.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
5 changes: 0 additions & 5 deletions hrms/payroll/doctype/salary_component/salary_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6c25eb9

Please sign in to comment.