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:
-
Is there a way to “de-couple” the P&L from the global
erpnext.financial_statementsobject so it uses its own local.htmland.jslogic exclusively? -
Or, how do I hook into the
after_datatable_renderevent specifically for this report to inject custom CSS styles that survive the filter refresh?