fix: Payment Entry button is visible even when claim is fully paid

This commit is contained in:
Rucha Mahabal
2022-08-09 18:15:41 +05:30
parent 6d269a4d89
commit d820757359

View File

@@ -254,9 +254,11 @@ frappe.ui.form.on("Expense Claim", {
}, __("View"));
}
if (frm.doc.docstatus===1 && !cint(frm.doc.is_paid) && cint(frm.doc.grand_total) > 0
&& (cint(frm.doc.total_amount_reimbursed) < cint(frm.doc.total_sanctioned_amount))
&& frappe.model.can_create("Payment Entry")) {
if (
frm.doc.docstatus === 1
&& frm.doc.status !== "Paid"
&& frappe.model.can_create("Payment Entry")
) {
frm.add_custom_button(__('Payment'),
function() { frm.events.make_payment_entry(frm); }, __('Create'));
}