From f11d0d5cec4a4147ae6cb02dbf2aac644966706f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 11 Aug 2026 16:42:43 +0000 Subject: [PATCH] =?UTF-8?q?fix(consolidated=20cash=20flow):=20correct=20to?= =?UTF-8?q?tals=20and=20labels=20in=20section=20foo=E2=80=A6=20(backport?= =?UTF-8?q?=20#57336)=20(#58056)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vishnu Priya Baskaran <145791817+ervishnucs@users.noreply.github.com> --- erpnext/accounts/report/cash_flow/cash_flow.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/report/cash_flow/cash_flow.py b/erpnext/accounts/report/cash_flow/cash_flow.py index f90345abab0..35e5549d139 100644 --- a/erpnext/accounts/report/cash_flow/cash_flow.py +++ b/erpnext/accounts/report/cash_flow/cash_flow.py @@ -269,9 +269,13 @@ def add_total_row_account( consolidated=False, add_blank_row=True, ): + name_key = "account" if consolidated else "section" + parent_key = "parent_account" if consolidated else "parent_section" + label_str = "'" + str(label) + "'" + total_row = { - "section_name": "'" + _("{0}").format(label) + "'", - "section": "'" + _("{0}").format(label) + "'", + f"{name_key}_name": label_str, + name_key: label_str, "currency": currency, } @@ -282,15 +286,15 @@ def add_total_row_account( period_list = get_filtered_list_for_consolidated_report(filters, period_list) for row in data: - if row.get("parent_section"): + if row.get(parent_key): for period in period_list: key = period if consolidated else period["key"] total_row.setdefault(key, 0.0) total_row[key] += row.get(key, 0.0) - summary_data[label] += row.get(key) + summary_data[label] += row.get(key) or 0.0 total_row.setdefault("total", 0.0) - total_row["total"] += row["total"] + total_row["total"] += row.get("total", 0.0) out.append(total_row) @@ -431,7 +435,6 @@ def get_opening_range_using_fiscal_year(company, period_list): def get_report_summary(summary_data, currency): report_summary = [] - for label, value in summary_data.items(): report_summary.append({"value": value, "label": label, "datatype": "Currency", "currency": currency})