Merge pull request #7414 from KanchanChauhan/timesheet-payroll-frequency-toggle

[Fix] Payroll Frequency toggle fix
This commit is contained in:
Nabin Hait 2017-01-10 11:58:36 +05:30 committed by GitHub
commit 9215581345
2 changed files with 6 additions and 1 deletions

View File

@ -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"));
},

View File

@ -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)))