Correction for Travis
This commit is contained in:
parent
8d71015bf8
commit
e87eb07e16
@ -156,7 +156,6 @@ def get_sales_invoice_data(filters):
|
|||||||
|
|
||||||
|
|
||||||
def get_mode_of_payments(filters):
|
def get_mode_of_payments(filters):
|
||||||
frappe.log_error(filters, 'filters')
|
|
||||||
mode_of_payments = {}
|
mode_of_payments = {}
|
||||||
invoice_list = get_invoices(filters)
|
invoice_list = get_invoices(filters)
|
||||||
invoice_list_names = ",".join(['"' + invoice['name'] + '"' for invoice in invoice_list])
|
invoice_list_names = ",".join(['"' + invoice['name'] + '"' for invoice in invoice_list])
|
||||||
@ -164,6 +163,7 @@ def get_mode_of_payments(filters):
|
|||||||
inv_mop = frappe.db.sql("""select a.owner,a.posting_date, ifnull(b.mode_of_payment, '') as mode_of_payment
|
inv_mop = frappe.db.sql("""select a.owner,a.posting_date, ifnull(b.mode_of_payment, '') as mode_of_payment
|
||||||
from `tabSales Invoice` a, `tabSales Invoice Payment` b
|
from `tabSales Invoice` a, `tabSales Invoice Payment` b
|
||||||
where a.name = b.parent
|
where a.name = b.parent
|
||||||
|
and a.docstatus = 1
|
||||||
and a.name in ({invoice_list_names})
|
and a.name in ({invoice_list_names})
|
||||||
union
|
union
|
||||||
select a.owner,a.posting_date, ifnull(b.mode_of_payment, '') as mode_of_payment
|
select a.owner,a.posting_date, ifnull(b.mode_of_payment, '') as mode_of_payment
|
||||||
@ -197,13 +197,13 @@ def get_invoices(filters):
|
|||||||
def get_mode_of_payment_details(filters):
|
def get_mode_of_payment_details(filters):
|
||||||
mode_of_payment_details = {}
|
mode_of_payment_details = {}
|
||||||
invoice_list = get_invoices(filters)
|
invoice_list = get_invoices(filters)
|
||||||
frappe.log_error(invoice_list, 'invoice_list')
|
|
||||||
invoice_list_names = ",".join(['"' + invoice['name'] + '"' for invoice in invoice_list])
|
invoice_list_names = ",".join(['"' + invoice['name'] + '"' for invoice in invoice_list])
|
||||||
if invoice_list:
|
if invoice_list:
|
||||||
inv_mop_detail = frappe.db.sql("""select a.owner, a.posting_date,
|
inv_mop_detail = frappe.db.sql("""select a.owner, a.posting_date,
|
||||||
ifnull(b.mode_of_payment, '') as mode_of_payment, sum(b.base_amount) as paid_amount
|
ifnull(b.mode_of_payment, '') as mode_of_payment, sum(b.base_amount) as paid_amount
|
||||||
from `tabSales Invoice` a, `tabSales Invoice Payment` b
|
from `tabSales Invoice` a, `tabSales Invoice Payment` b
|
||||||
where a.name = b.parent
|
where a.name = b.parent
|
||||||
|
and a.docstatus = 1
|
||||||
and a.name in ({invoice_list_names})
|
and a.name in ({invoice_list_names})
|
||||||
group by a.owner, a.posting_date, mode_of_payment
|
group by a.owner, a.posting_date, mode_of_payment
|
||||||
union
|
union
|
||||||
|
@ -16,10 +16,13 @@ class TestSalesPaymentSummary(unittest.TestCase):
|
|||||||
create_records()
|
create_records()
|
||||||
pes = frappe.get_all("Payment Entry")
|
pes = frappe.get_all("Payment Entry")
|
||||||
jes = frappe.get_all("Journal Entry")
|
jes = frappe.get_all("Journal Entry")
|
||||||
|
sis = frappe.get_all("Sales Invoice")
|
||||||
for pe in pes:
|
for pe in pes:
|
||||||
frappe.db.set_value("Payment Entry", pe.name, "docstatus", 2)
|
frappe.db.set_value("Payment Entry", pe.name, "docstatus", 2)
|
||||||
for je in jes:
|
for je in jes:
|
||||||
frappe.db.set_value("Journal Entry", je.name, "docstatus", 2)
|
frappe.db.set_value("Journal Entry", je.name, "docstatus", 2)
|
||||||
|
for si in sis:
|
||||||
|
frappe.db.set_value("Sales Invoice", si.name, "docstatus", 2)
|
||||||
|
|
||||||
def test_get_mode_of_payments(self):
|
def test_get_mode_of_payments(self):
|
||||||
filters = get_filters()
|
filters = get_filters()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user