fix: cash flow report fixes

(cherry picked from commit 20b87512d1)
This commit is contained in:
Lakshit Jain
2025-06-03 11:22:02 +05:30
committed by Mergify
parent cd7462dd87
commit 4a1966c680
3 changed files with 9 additions and 5 deletions

View File

@@ -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)

View File

@@ -47,12 +47,12 @@
{% for(let j=0, k=data.length; j<k; j++) { %}
{%
var row = data[j];
var row_class = data[j].parent_account ? "" : "financial-statements-important";
row_class += data[j].account_name ? "" : " financial-statements-blank-row";
var row_class = data[j].parent_account || data[j].parent_section ? "" : "financial-statements-important";
row_class += data[j].account_name || data[j].section ? "" : " financial-statements-blank-row";
%}
<tr class="{%= row_class %}">
<td>
<span style="padding-left: {%= cint(data[j].indent) * 2 %}em">{%= row.account_name %}</span>
<span style="padding-left: {%= cint(data[j].indent) * 2 %}em">{%= row.account_name || row.section %}</span>
</td>
{% for(let i=1, l=report_columns.length; i<l; i++) { %}
<td class="text-right">

View File

@@ -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;