Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: timesheet based salary slip (backport #2686) #2696

Merged
merged 3 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions hrms/payroll/doctype/payroll_entry/payroll_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,10 @@ frappe.ui.form.on("Payroll Entry", {

salary_slip_based_on_timesheet: function (frm) {
frm.toggle_reqd(["payroll_frequency"], !frm.doc.salary_slip_based_on_timesheet);
hrms.set_payroll_frequency_to_null(frm);
},

set_start_end_dates: function (frm) {
if (!frm.doc.salary_slip_based_on_timesheet) {
if (frm.doc.payroll_frequency) {
frappe.call({
method: "hrms.payroll.doctype.payroll_entry.payroll_entry.get_start_end_dates",
args: {
Expand Down
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)
ruchamahabal marked this conversation as resolved.
Show resolved Hide resolved
"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
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ frappe.ui.form.on("Salary Structure", {

salary_slip_based_on_timesheet: function (frm) {
frm.trigger("toggle_fields");
hrms.set_payroll_frequency_to_null(frm);
},

preview_salary_slip: function (frm) {
Expand Down
Loading