Skip to content

Commit

Permalink
fix(Employee Advance): Return/Deduction from Salary button visibility (
Browse files Browse the repository at this point in the history
…#31011)

(cherry picked from commit 3016ed9)
  • Loading branch information
ruchamahabal authored and mergify[bot] committed May 13, 2022
1 parent 7d8e334 commit 7c94387
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions erpnext/hr/doctype/employee_advance/employee_advance.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 7c94387

Please sign in to comment.