[Fix] Payroll Frequency toggle fix
This commit is contained in:
parent
0dab40f4a1
commit
2b41f9d548
@ -7,6 +7,7 @@ frappe.ui.form.on("Process Payroll", {
|
|||||||
frm.doc.start_date = '';
|
frm.doc.start_date = '';
|
||||||
frm.doc.end_date = '';
|
frm.doc.end_date = '';
|
||||||
frm.doc.payroll_frequency = '';
|
frm.doc.payroll_frequency = '';
|
||||||
|
frm.toggle_reqd(['payroll_frequency'], !frm.doc.salary_slip_based_on_timesheet);
|
||||||
},
|
},
|
||||||
|
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
@ -25,6 +26,10 @@ frappe.ui.form.on("Process Payroll", {
|
|||||||
frm.trigger("set_start_end_dates");
|
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) {
|
payment_account: function(frm) {
|
||||||
frm.toggle_display(['make_bank_entry'], (frm.doc.payment_account!="" && frm.doc.payment_account!="undefined"));
|
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):
|
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):
|
if not self.get(fieldname):
|
||||||
frappe.throw(_("Please set {0}").format(self.meta.get_label(fieldname)))
|
frappe.throw(_("Please set {0}").format(self.meta.get_label(fieldname)))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user