From deeb1380b14a8adca07e3e0b3daf5b1d39054700 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 13 Nov 2017 13:52:05 +0530 Subject: [PATCH] Ignore paid credit note in outstanding invoices in Payment Entry (#11534) --- erpnext/accounts/doctype/payment_entry/payment_entry.js | 1 - erpnext/accounts/utils.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 52d8a2d5ce..c5e0306486 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -252,7 +252,6 @@ frappe.ui.form.on('Payment Entry', { date: frm.doc.posting_date }, callback: function(r, rt) { - console.log(r, rt); if(r.message) { if(frm.doc.payment_type == "Receive") { frm.set_value("paid_from", r.message.party_account); diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 50530f5dc1..f7aa341e12 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -593,7 +593,7 @@ def get_outstanding_invoices(party_type, party, account, condition=None): select ifnull(sum({payment_dr_or_cr}), 0) from `tabGL Entry` payment_gl_entry where payment_gl_entry.against_voucher_type = invoice_gl_entry.voucher_type - and payment_gl_entry.against_voucher = invoice_gl_entry.voucher_no + and payment_gl_entry.against_voucher = invoice_gl_entry.against_voucher and payment_gl_entry.party_type = invoice_gl_entry.party_type and payment_gl_entry.party = invoice_gl_entry.party and payment_gl_entry.account = invoice_gl_entry.account