Override logic for Financial Statements (Script Reports) in v16 is being bypassed by global financia

In ERPNext v16, the Profit and Loss and Balance Sheet reports are effectively “proxies.” Even if I create a custom app and try to override the .html file, the report constantly reverts to the generic Frappe Datatable view the moment a filter is changed.

The profit_and_loss_statement.js inherits from erpnext.financial_statements. This global object controls the rendering. Because it’s a Script Report, the server-side execute function returns a data object that the standard client-side formatter then pushes into a generic grid.

I need to force the P&L report to use a specific CSS/JS formatter to achieve a “Professional/Letterhead” look (specifically adding “Rs” prefixes to currency and removing the generic grid borders) without modifying the core erpnext/accounts/report/financial_statements.html.

My Question for the Devs:

  1. Is there a way to “de-couple” the P&L from the global erpnext.financial_statements object so it uses its own local .html and .js logic exclusively?

  2. Or, how do I hook into the after_datatable_render event specifically for this report to inject custom CSS styles that survive the filter refresh?

Hi @saadathar

Have you tried duplicating the reports in the UI and then editing the code in the backend?