fix: Cashlfow mapper not showing data

This commit is contained in:
Deepesh Garg
2021-05-18 08:38:49 +05:30
parent cb2f2d9e73
commit ad1f1e000b

View File

@@ -165,7 +165,7 @@ def add_data_for_operating_activities(
if profit_data: if profit_data:
profit_data.update({ profit_data.update({
"indent": 1, "indent": 1,
"parent_account": get_mapper_for(light_mappers, position=0)['section_header'] "parent_account": get_mapper_for(light_mappers, position=1)['section_header']
}) })
data.append(profit_data) data.append(profit_data)
section_data.append(profit_data) section_data.append(profit_data)
@@ -312,10 +312,10 @@ def add_data_for_other_activities(
def compute_data(filters, company_currency, profit_data, period_list, light_mappers, full_mapper): def compute_data(filters, company_currency, profit_data, period_list, light_mappers, full_mapper):
data = [] data = []
operating_activities_mapper = get_mapper_for(light_mappers, position=0) operating_activities_mapper = get_mapper_for(light_mappers, position=1)
other_mappers = [ other_mappers = [
get_mapper_for(light_mappers, position=1), get_mapper_for(light_mappers, position=2),
get_mapper_for(light_mappers, position=2) get_mapper_for(light_mappers, position=3)
] ]
if operating_activities_mapper: if operating_activities_mapper:
@@ -396,7 +396,7 @@ def _get_account_type_based_data(filters, account_names, period_list, accumulate
gl_sum = frappe.db.sql_list(""" gl_sum = frappe.db.sql_list("""
select sum(credit) - sum(debit) select sum(credit) - sum(debit)
from `tabGL Entry` from `tabGL Entry`
where company=%s and posting_date >= %s and posting_date <= %s where company=%s and posting_date >= %s and posting_date <= %s
and voucher_type != 'Period Closing Voucher' and voucher_type != 'Period Closing Voucher'
and account in ( SELECT name FROM tabAccount WHERE name IN (%s) and account in ( SELECT name FROM tabAccount WHERE name IN (%s)
OR parent_account IN (%s)) OR parent_account IN (%s))
@@ -405,7 +405,7 @@ def _get_account_type_based_data(filters, account_names, period_list, accumulate
gl_sum = frappe.db.sql_list(""" gl_sum = frappe.db.sql_list("""
select sum(credit) - sum(debit) select sum(credit) - sum(debit)
from `tabGL Entry` from `tabGL Entry`
where company=%s and posting_date >= %s and posting_date <= %s where company=%s and posting_date >= %s and posting_date <= %s
and voucher_type != 'Period Closing Voucher' and voucher_type != 'Period Closing Voucher'
and account in ( SELECT name FROM tabAccount WHERE name IN (%s) and account in ( SELECT name FROM tabAccount WHERE name IN (%s)
OR parent_account IN (%s)) OR parent_account IN (%s))