From 3016ed958e9ac962172a68372c2a25aea7d433f0 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Fri, 13 May 2022 20:01:14 +0530 Subject: [PATCH] fix(Employee Advance): Return/Deduction from Salary button visibility (#31011) --- erpnext/hr/doctype/employee_advance/employee_advance.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/hr/doctype/employee_advance/employee_advance.js b/erpnext/hr/doctype/employee_advance/employee_advance.js index 7d1c7cbf4a..37ae75aeb6 100644 --- a/erpnext/hr/doctype/employee_advance/employee_advance.js +++ b/erpnext/hr/doctype/employee_advance/employee_advance.js @@ -65,9 +65,10 @@ frappe.ui.form.on('Employee Advance', { ); } - if (frm.doc.docstatus === 1 && - (flt(frm.doc.claimed_amount) < flt(frm.doc.paid_amount) && flt(frm.doc.paid_amount) != flt(frm.doc.return_amount))) { - + if ( + frm.doc.docstatus === 1 + && (flt(frm.doc.claimed_amount) < flt(frm.doc.paid_amount) - flt(frm.doc.return_amount)) + ) { if (frm.doc.repay_unclaimed_amount_from_salary == 0 && frappe.model.can_create("Journal Entry")) { frm.add_custom_button(__("Return"), function() { frm.trigger('make_return_entry');