From 3d73a6f7f266a4cb4260f397b22a64c3e164d58b Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Wed, 13 Jun 2018 16:33:06 +0530 Subject: [PATCH] Fetch details from Journal Entry in Accounts Payable report (#14495) * Fetch bill_no, bill_date from Journal Entry * Fix as per suggestion * Fetch details only if bill_no exists --- .../report/accounts_receivable/accounts_receivable.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index f722e7f743..0befa5d057 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -286,7 +286,10 @@ class ReceivablePayableReport(object): if party_type == "Supplier": for pi in frappe.db.sql("""select name, due_date, bill_no, bill_date - from `tabPurchase Invoice` where docstatus=1""", as_dict=1): + from `tabPurchase Invoice` where docstatus = 1 + union + select name, due_date, bill_no, bill_date from `tabJournal Entry` + where docstatus = 1 and bill_no is not NULL""", as_dict=1): voucher_details.setdefault(pi.name, pi) return voucher_details