From 20b87512d10530d6639d32b2c3845a87804f6ec8 Mon Sep 17 00:00:00 2001 From: Lakshit Jain <108322669+ljain112@users.noreply.github.com> Date: Tue, 3 Jun 2025 11:22:02 +0530 Subject: [PATCH] fix: cash flow report fixes --- erpnext/accounts/report/cash_flow/cash_flow.py | 6 +++++- erpnext/accounts/report/financial_statements.html | 6 +++--- erpnext/public/js/financial_statements.js | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/report/cash_flow/cash_flow.py b/erpnext/accounts/report/cash_flow/cash_flow.py index bdc4083cedb..4cdeceac93b 100644 --- a/erpnext/accounts/report/cash_flow/cash_flow.py +++ b/erpnext/accounts/report/cash_flow/cash_flow.py @@ -75,7 +75,11 @@ def execute(filters=None): # add first net income in operations section if net_profit_loss: net_profit_loss.update( - {"indent": 1, "parent_section": cash_flow_sections[0]["section_header"]} + { + "indent": 1, + "parent_section": cash_flow_sections[0]["section_header"], + "section": net_profit_loss["account"], + } ) data.append(net_profit_loss) section_data.append(net_profit_loss) diff --git a/erpnext/accounts/report/financial_statements.html b/erpnext/accounts/report/financial_statements.html index dc1d0093bce..45d56a92037 100644 --- a/erpnext/accounts/report/financial_statements.html +++ b/erpnext/accounts/report/financial_statements.html @@ -47,12 +47,12 @@ {% for(let j=0, k=data.length; j - {%= row.account_name %} + {%= row.account_name || row.section %} {% for(let i=1, l=report_columns.length; i diff --git a/erpnext/public/js/financial_statements.js b/erpnext/public/js/financial_statements.js index d202858ac5e..159daa972d7 100644 --- a/erpnext/public/js/financial_statements.js +++ b/erpnext/public/js/financial_statements.js @@ -41,7 +41,7 @@ erpnext.financial_statements = { } } - if (data && column.fieldname == "account") { + if (data && column.fieldname == this.name_field) { // first column value = data.section_name || data.account_name || value;