From a6b41e855b84ed9971096090a2c38783526ac087 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 1 Jan 2018 16:16:50 +0530 Subject: [PATCH] [fix] check if null for mode of payments (#12264) --- .../report/sales_payment_summary/sales_payment_summary.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py b/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py index 3fcc1d31702..93c03087d7c 100644 --- a/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py +++ b/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py @@ -66,12 +66,12 @@ def get_mode_of_payments(filters): invoice_list = get_invoices(filters) invoice_list_names = ",".join(['"' + invoice['name'] + '"' for invoice in invoice_list]) if invoice_list: - inv_mop = frappe.db.sql("""select a.owner,a.posting_date,b.mode_of_payment + inv_mop = frappe.db.sql("""select a.owner,a.posting_date, ifnull(b.mode_of_payment, '') from `tabSales Invoice` a, `tabSales Invoice Payment` b where a.name = b.parent and a.name in ({invoice_list_names}) union - select a.owner,a.posting_date,b.mode_of_payment + select a.owner,a.posting_date, ifnull(b.mode_of_payment, '') from `tabSales Invoice` a, `tabPayment Entry` b,`tabPayment Entry Reference` c where a.name = c.reference_name and b.name = c.parent