From ad32324c4c8d86d03b21b6b265ab40f3db421b7f Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Thu, 4 Apr 2019 19:50:23 +0530 Subject: [PATCH 1/2] fix: get bill_no --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 91004104af..e0ec76fa06 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -783,6 +783,7 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre if reference_doctype in ("Sales Invoice", "Purchase Invoice"): outstanding_amount = ref_doc.get("outstanding_amount") + bill_no = ref_doc.get("bill_no") elif reference_doctype == "Expense Claim": outstanding_amount = flt(ref_doc.get("total_sanctioned_amount")) \ - flt(ref_doc.get("total_amount+reimbursed")) - flt(ref_doc.get("total_advance_amount")) @@ -799,7 +800,8 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre "due_date": ref_doc.get("due_date"), "total_amount": total_amount, "outstanding_amount": outstanding_amount, - "exchange_rate": exchange_rate + "exchange_rate": exchange_rate, + "bill_no": bill_no }) From 6443d7dd109e1e2d38f43eaa4d50855226168003 Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Thu, 4 Apr 2019 19:54:23 +0530 Subject: [PATCH 2/2] refactor: declare bill_on at function start --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index e0ec76fa06..443c8fb980 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -749,7 +749,7 @@ def get_outstanding_on_journal_entry(name): @frappe.whitelist() def get_reference_details(reference_doctype, reference_name, party_account_currency): - total_amount = outstanding_amount = exchange_rate = None + total_amount = outstanding_amount = exchange_rate = bill_no = None ref_doc = frappe.get_doc(reference_doctype, reference_name) company_currency = ref_doc.get("company_currency") or erpnext.get_company_currency(ref_doc.company)