From 26a55fc1bc1732c5b118ef75a85ef5c001f65588 Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Fri, 27 Feb 2026 12:24:47 +0530 Subject: [PATCH] feat(consolidated-trial-balance): introduced `show_net_values` filter (cherry picked from commit 560c2511ccb378f8377f7d445d5b9dc0c01aba29) # Conflicts: # erpnext/accounts/report/consolidated_trial_balance/consolidated_trial_balance.js --- .../consolidated_trial_balance.js | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 erpnext/accounts/report/consolidated_trial_balance/consolidated_trial_balance.js diff --git a/erpnext/accounts/report/consolidated_trial_balance/consolidated_trial_balance.js b/erpnext/accounts/report/consolidated_trial_balance/consolidated_trial_balance.js new file mode 100644 index 00000000000..df023f91c02 --- /dev/null +++ b/erpnext/accounts/report/consolidated_trial_balance/consolidated_trial_balance.js @@ -0,0 +1,107 @@ +// Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +frappe.query_reports["Consolidated Trial Balance"] = { + filters: [ + { + fieldname: "company", + label: __("Company"), + fieldtype: "MultiSelectList", + options: "Company", + get_data: function (txt) { + return frappe.db.get_link_options("Company", txt); + }, + reqd: 1, + }, + { + fieldname: "fiscal_year", + label: __("Fiscal Year"), + fieldtype: "Link", + options: "Fiscal Year", + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()), + reqd: 1, + on_change: function (query_report) { + var fiscal_year = query_report.get_values().fiscal_year; + if (!fiscal_year) { + return; + } + frappe.model.with_doc("Fiscal Year", fiscal_year, function (r) { + var fy = frappe.model.get_doc("Fiscal Year", fiscal_year); + frappe.query_report.set_filter_value({ + from_date: fy.year_start_date, + to_date: fy.year_end_date, + }); + }); + }, + }, + { + fieldname: "from_date", + label: __("From Date"), + fieldtype: "Date", + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1], + }, + { + fieldname: "to_date", + label: __("To Date"), + fieldtype: "Date", + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], + }, + { + fieldname: "finance_book", + label: __("Finance Book"), + fieldtype: "Link", + options: "Finance Book", + }, + { + fieldname: "presentation_currency", + label: __("Currency"), + fieldtype: "Select", + options: erpnext.get_presentation_currency_list(), + }, + { + fieldname: "with_period_closing_entry_for_opening", + label: __("With Period Closing Entry For Opening Balances"), + fieldtype: "Check", + default: 1, + }, + { + fieldname: "with_period_closing_entry_for_current_period", + label: __("Period Closing Entry For Current Period"), + fieldtype: "Check", + default: 1, + }, + { + fieldname: "show_zero_values", + label: __("Show zero values"), + fieldtype: "Check", + }, + { + fieldname: "show_unclosed_fy_pl_balances", + label: __("Show unclosed fiscal year's P&L balances"), + fieldtype: "Check", + }, + { + fieldname: "include_default_book_entries", + label: __("Include Default FB Entries"), + fieldtype: "Check", + default: 1, + }, + { + fieldname: "show_net_values", + label: __("Show net values in opening and closing columns"), + fieldtype: "Check", + default: 1, + }, + { + fieldname: "show_group_accounts", + label: __("Show Group Accounts"), + fieldtype: "Check", + default: 1, + }, + ], + formatter: erpnext.financial_statements.formatter, + tree: true, + name_field: "account", + parent_field: "parent_account", + initial_depth: 3, +};