From 70b93e2cd4bf598e0892672a6e2fd1ca3d545d2b Mon Sep 17 00:00:00 2001 From: Anurag Mishra <32095923+Anurag810@users.noreply.github.com> Date: Mon, 12 Aug 2019 11:46:47 +0530 Subject: [PATCH] fix: condition (#18667) --- erpnext/hr/doctype/expense_claim/expense_claim.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js index cfdb813cb8c..a9ad7c5a068 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.js +++ b/erpnext/hr/doctype/expense_claim/expense_claim.js @@ -188,8 +188,7 @@ frappe.ui.form.on("Expense Claim", { frappe.set_route("query-report", "General Ledger"); }, __("View")); } - - if (frm.doc.docstatus===1 && !cint(frm.doc.is_paid) && cint(frm.doc.grand_total) > 0 + if (frm.doc.docstatus===1 && !cint(frm.doc.is_paid) && (cint(frm.doc.total_amount_reimbursed) < cint(frm.doc.total_sanctioned_amount)) && frappe.model.can_create("Payment Entry")) { frm.add_custom_button(__('Payment'),