feat: account name and number columns on financial statement reports on export

This commit is contained in:
diptanilsaha
2025-07-16 13:22:31 +05:30
parent 393c1d4bee
commit 6b98323806
3 changed files with 25 additions and 0 deletions

View File

@@ -30,3 +30,5 @@ frappe.query_reports["Balance Sheet"]["filters"].push({
fieldtype: "Check",
default: 1,
});
frappe.query_reports["Balance Sheet"]["export_hidden_cols"] = true;

View File

@@ -295,6 +295,8 @@ def prepare_data(accounts, balance_must_be, period_list, company_currency, accum
"account_name": (
f"{_(d.account_number)} - {_(d.account_name)}" if d.account_number else _(d.account_name)
),
"acc_name": d.account_name,
"acc_number": d.account_number,
}
)
for period in period_list:
@@ -650,6 +652,25 @@ def get_columns(periodicity, period_list, accumulated_values=1, company=None, ca
"width": 300,
}
]
if not cash_flow:
columns.extend(
[
{
"fieldname": "acc_name",
"label": _("Account Name"),
"fieldtype": "Data",
"width": 250,
"hidden": 1,
},
{
"fieldname": "acc_number",
"label": _("Account Number"),
"fieldtype": "Data",
"width": 120,
"hidden": 1,
},
]
)
if company:
columns.append(
{

View File

@@ -31,3 +31,5 @@ frappe.query_reports["Profit and Loss Statement"]["filters"].push({
fieldtype: "Check",
default: 1,
});
frappe.query_reports["Profit and Loss Statement"]["export_hidden_cols"] = true;