Skip to content

Commit

Permalink
fix: allow setting payroll frequency for timesheet based payroll entr…
Browse files Browse the repository at this point in the history
…y, calculate salary slip dates if payroll frequency is set not if its not a timesheet based salary slip

(cherry picked from commit 8abf1c4)

# Conflicts:
#	hrms/payroll/doctype/payroll_entry/payroll_entry.json
  • Loading branch information
AyshaHakeem authored and mergify[bot] committed Jan 24, 2025
1 parent 5d50429 commit 650c05b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
5 changes: 4 additions & 1 deletion hrms/payroll/doctype/payroll_entry/payroll_entry.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"reqd": 1
},
{
"depends_on": "eval:doc.salary_slip_based_on_timesheet == 0",
"fieldname": "payroll_frequency",
"fieldtype": "Select",
"label": "Payroll Frequency",
Expand Down Expand Up @@ -336,7 +335,11 @@
"icon": "fa fa-cog",
"is_submittable": 1,
"links": [],
<<<<<<< HEAD
"modified": "2023-10-10 14:21:24.517349",
=======
"modified": "2025-01-22 15:27:16.652848",
>>>>>>> 8abf1c4e (fix: allow setting payroll frequency for timesheet based payroll entry, calculate salary slip dates if payroll frequency is set not if its not a timesheet based salary slip)
"modified_by": "Administrator",
"module": "Payroll",
"name": "Payroll Entry",
Expand Down
5 changes: 0 additions & 5 deletions hrms/payroll/doctype/salary_slip/salary_slip.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,6 @@ frappe.ui.form.on("Salary Slip", {
["hourly_wages", "timesheets"],
cint(frm.doc.salary_slip_based_on_timesheet) === 1,
);

frm.toggle_display(
["payment_days", "total_working_days", "leave_without_pay"],
frm.doc.payroll_frequency != "",
);
},

get_emp_and_working_day_details: function (frm) {
Expand Down
6 changes: 3 additions & 3 deletions hrms/payroll/doctype/salary_slip/salary_slip.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def validate(self):
self.validate_dates()
self.check_existing()

if not self.salary_slip_based_on_timesheet:
if self.payroll_frequency:
self.get_date_details()

if not (len(self.get("earnings")) or len(self.get("deductions"))):
Expand Down Expand Up @@ -321,7 +321,7 @@ def get_emp_and_working_day_details(self):
self.set("earnings", [])
self.set("deductions", [])

if not self.salary_slip_based_on_timesheet:
if self.payroll_frequency:
self.get_date_details()

self.validate_dates()
Expand Down Expand Up @@ -1913,7 +1913,7 @@ def set_status(self, status=None):

def process_salary_structure(self, for_preview=0):
"""Calculate salary after salary structure details have been updated"""
if not self.salary_slip_based_on_timesheet:
if self.payroll_frequency:
self.get_date_details()
self.pull_emp_details()
self.get_working_days_details(for_preview=for_preview)
Expand Down

0 comments on commit 650c05b

Please sign in to comment.