I want to remove the company filter in Trial Balance so that all of the companies Trial balance will be shown for consolidation
How do i remove filters in the trial_balance.py in reports
If i have successfully remove the filters will it output all all companies trial balance’s or will it fail
What is the best way to do this ,Should i modify trial_balance,js or trial_balance,py
I tried removing filters.company in the trial_balance.py but it returns an error should i just remove this line or replace it
1 Like
Company filter in mandatory in trial balance.
In script report you can remove filter from js file.
You can create separate report for Consolidated Trial Balance.
Check this
if not filters.fiscal_year:
frappe.throw(_("Fiscal Year {0} is required").format(filters.fiscal_year))
fiscal_year = frappe.get_cached_value(
"Fiscal Year", filters.fiscal_year, ["year_start_date", "year_end_date"], as_dict=True
)
if not fiscal_year:
frappe.throw(_("Fiscal Year {0} does not exist").format(filters.fiscal_year))
else:
filters.year_start_date = getdate(fiscal_year.year_start_date)
filters.year_end_date = getdate(fiscal_year.year_end_date)
if not filters.from_date:
filters.from_date = filters.year_start_date
if not filters.to_date:
filters.to_date = filters.year_end_date
filters.from_date = getdate(filters.from_date)
filters.to_date = getdate(filters.to_date)
I have successfully created a consolidated report in Accounting Main Reports by modifying the financial_statements.py I guess my problem is solved.
1 Like
@Lightning Can you please share the report, i need the same.
Im not sure if this will work for you or this is the consolidation that you are looking for ,but here it is sorry for the late reply stilll busy doing the cashflow and other reports
Consolidated Reports For
a.Accounts Payable
b.Accounts Recievable
c.Balance Sheet
d.General Ledger
e.Trial_balance
STEP 1: Insert a new field in the tables
“tabGL Entry”
“tabAccount”
Name: consolidation
Type: Varchar
Length: 255
Decimals: 0
Default: yes
Character set: utf8
Collation: utf8_general_ci
STEP 2: Create a New Script Report in ERPnext
[Consolidated Trial Balance]
Name:Consolidated Trial Balance
Ref DocType: GL Entry
Is Standard: Yes
Report Type: Script Report
Module: Accounts
Apply User Permissions: check
[Consolidated Balance Sheet]
Name:Consolidated Balance Sheet
Ref DocType: GL Entry
Is Standard: Yes
Report Type: Script Report
Module: Accounts
Apply User Permissions: check
[Consolidated Accounts Receivable]
Name:Consolidated Accounts Receivable
Ref DocType: Sales Invoice
Is Standard: Yes
Report Type: Script Report
Module: Accounts
Apply User Permissions: check
[Consolidated Accounts Payable]
Name:Consolidated Accounts Receivable
Ref DocType: Purchase Invoice
Is Standard: Yes
Report Type: Script Report
Module: Accounts
Apply User Permissions: check
[Consolidated General Ledger]
Name:Consolidated General Ledger
Ref DocType: GL Entry
Is Standard: Yes
Report Type: Script Report
Module: Accounts
Apply User Permissions: check
STEP 3: Copy the files ( Removed ) to frappe-bench/apps/erpnext/erpnext/accounts/report
STEP 4: Add the consolidated reports using frappe-bench/apps/erpnext/erpnext/config/accounts.py
@Lightning Can you please share your github link? i need the same reports.