From 2df0788c11332dba959a2065041e5a4f7c98aa9f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 28 Aug 2017 11:23:33 +0530 Subject: [PATCH] Validate for negative outstanding reference only if party is Customer or Supplier (#10568) --- erpnext/accounts/doctype/payment_entry/payment_entry.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 92a805f37df..12e46c42d3c 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -569,7 +569,7 @@ frappe.ui.form.on('Payment Entry', { }) var allocated_negative_outstanding = 0; - if((frm.doc.payment_type=="Receive" && frm.doc.party_type=="Customer") || + if ((frm.doc.payment_type=="Receive" && frm.doc.party_type=="Customer") || (frm.doc.payment_type=="Pay" && frm.doc.party_type=="Supplier") || (frm.doc.payment_type=="Pay" && frm.doc.party_type=="Employee")) { if(total_positive_outstanding_including_order > paid_amount) { @@ -579,7 +579,7 @@ frappe.ui.form.on('Payment Entry', { } var allocated_positive_outstanding = paid_amount + allocated_negative_outstanding; - } else { + } else if (in_list(["Customer", "Supplier"], frm.doc.party_type)) { if(paid_amount > total_negative_outstanding) { if(total_negative_outstanding == 0) { frappe.msgprint(__("Cannot {0} {1} {2} without any negative outstanding invoice",