From 4a1966c6807800556d78ddba5880e229c5e6ca05 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 (cherry picked from commit 20b87512d10530d6639d32b2c3845a87804f6ec8) --- 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 562ac5efb81..c647c5b2e4f 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 78796c4feb8..f9eddcf2889 100644 --- a/erpnext/public/js/financial_statements.js +++ b/erpnext/public/js/financial_statements.js @@ -45,7 +45,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;