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 d5483b5f85..904513c39f 100644 --- a/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py +++ b/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py @@ -200,9 +200,9 @@ def get_mode_of_payment_details(filters): invoice_list_names = ",".join('"' + invoice['name'] + '"' for invoice in invoice_list) if invoice_list: inv_mop_detail = frappe.db.sql(""" - select t.owner, + select t.owner, t.posting_date, - t.mode_of_payment, + t.mode_of_payment, sum(t.paid_amount) as paid_amount from ( select a.owner, a.posting_date, @@ -230,7 +230,7 @@ def get_mode_of_payment_details(filters): and b.reference_type = "Sales Invoice" and b.reference_name in ({invoice_list_names}) group by a.owner, a.posting_date, mode_of_payment - ) t + ) t group by t.owner, t.posting_date, t.mode_of_payment """.format(invoice_list_names=invoice_list_names), as_dict=1) @@ -252,4 +252,4 @@ def get_mode_of_payment_details(filters): for d in inv_mop_detail: mode_of_payment_details.setdefault(d["owner"]+cstr(d["posting_date"]), []).append((d.mode_of_payment,d.paid_amount)) - return mode_of_payment_details \ No newline at end of file + return mode_of_payment_details