fix: linters erros on report sales payments summary (#30345)

* fix: wrong values for report and get change amout based on payment TYPE.

* charcase for select field.

* fix: linter check erros

* fix: linters errors

Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
HarryPaulo 2022-03-22 03:09:15 -03:00 committed by GitHub
parent 01fd3adedf
commit 3eb5440aa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
return mode_of_payment_details