Merge pull request #7414 from KanchanChauhan/timesheet-payroll-frequency-toggle
[Fix] Payroll Frequency toggle fix
This commit is contained in:
commit
9215581345
@ -7,6 +7,7 @@ frappe.ui.form.on("Process Payroll", {
|
||||
frm.doc.start_date = '';
|
||||
frm.doc.end_date = '';
|
||||
frm.doc.payroll_frequency = '';
|
||||
frm.toggle_reqd(['payroll_frequency'], !frm.doc.salary_slip_based_on_timesheet);
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
@ -25,6 +26,10 @@ frappe.ui.form.on("Process Payroll", {
|
||||
frm.trigger("set_start_end_dates");
|
||||
},
|
||||
|
||||
salary_slip_based_on_timesheet: function(frm) {
|
||||
frm.toggle_reqd(['payroll_frequency'], !frm.doc.salary_slip_based_on_timesheet);
|
||||
},
|
||||
|
||||
payment_account: function(frm) {
|
||||
frm.toggle_display(['make_bank_entry'], (frm.doc.payment_account!="" && frm.doc.payment_account!="undefined"));
|
||||
},
|
||||
|
@ -68,7 +68,7 @@ class ProcessPayroll(Document):
|
||||
|
||||
|
||||
def check_mandatory(self):
|
||||
for fieldname in ['company', 'payroll_frequency', 'start_date', 'end_date']:
|
||||
for fieldname in ['company', 'start_date', 'end_date']:
|
||||
if not self.get(fieldname):
|
||||
frappe.throw(_("Please set {0}").format(self.meta.get_label(fieldname)))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user