From 141c543f9765b11df09fef4e57157b2aae5fd172 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 23 Jan 2019 12:14:55 +0530 Subject: [PATCH] Update journal_entry.js --- .../doctype/journal_entry/journal_entry.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index c0a9a965e2..0aa62d510c 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -174,16 +174,18 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({ out.filters.push([jvd.reference_type, "per_billed", "<", 100]); } + + if(jvd.party_type && jvd.party) { + var party_field = ""; + if(jvd.reference_type.indexOf("Sales")===0) { + var party_field = "customer"; + } else if (jvd.reference_type.indexOf("Purchase")===0) { + var party_field = "supplier"; + } - var party_field = ""; - if(jvd.reference_type.indexOf("Sales")===0) { - var party_field = "customer"; - } else if (jvd.reference_type.indexOf("Purchase")===0) { - var party_field = "supplier"; - } - - if (party_field) { - out.filters.push([jvd.reference_type, party_field, "=", jvd.party]); + if (party_field) { + out.filters.push([jvd.reference_type, party_field, "=", jvd.party]); + } } return out;