Design financial statements with a report template ​

A Financial Report Template is a reusable layout for a financial statement. It defines which lines appear, which accounts feed each line, how subtotals are calculated, and how lines are formatted. You can keep one concise Profit and Loss layout for the board and an IFRS-style Cash Flow layout for lenders, without changing your Chart of Accounts.

A template controls presentation only. It does not make your books compliant with IFRS, US GAAP, or local rules. Recognition, valuation, and disclosure still need professional review.

Prerequisites ​

  • You know the lines, groupings, signs, and formulas the statement needs.
  • If you want to select accounts by category, each account in the Chart of Accounts has an Account Category. Categories let one template work across companies with different account names.

Standard templates ​

ERPNext includes these templates:

TemplateReport Type
Standard Balance Sheet (IFRS)Balance Sheet
Horizontal Balance Sheet (Columnar)Balance Sheet
Standard Profit and Loss (IFRS)Profit and Loss Statement
Horizontal Profit and Loss (Columnar)Profit and Loss Statement
Standard Cash Flow Statement (IFRS)Cash Flow
Financial Ratios AnalysisCustom Financial Statement

Duplicate a standard template before you change it, so the original stays available as a baseline.

Financial Report Template list with the standard templates

Create a template ​

  1. Open the Financial Report Template list and create a template, or duplicate a standard one.
  2. Enter a Template Name, for example "Board P&L".
  3. Select the Report Type: Profit and Loss Statement, Balance Sheet, Cash Flow, or Custom Financial Statement. The template is then available in the Report Template filter of that report.
  4. In Report Line Items, add one row for each line, in the order it appears in the report. Set the fields described in Row fields.
  5. Save the template. ERPNext checks the rows and shows any errors (see Troubleshooting).
  6. Select View Report to run the report with this template, and compare the result with the standard statement for the same company, period, finance book, and dimensions.

To stop a template from being offered in reports, select Disabled.

Report Line Items of the Standard Cash Flow Statement (IFRS) template

Data sources ​

The Data Source of a row decides where its value comes from:

Data SourceUse it forFormula field
Account DataBalances of accounts that match a filter, for example all revenue accountsAccount Filter, and a Balance Type
Calculated AmountArithmetic on other rows, for example gross profitCalculation Formula
Custom APIA value from a Python method in a custom app, when the other sources cannot express itAPI Method Path (see Custom API rows)
Blank LineA heading (with a Display Name) or an empty spacing lineNone
Column BreakA side-by-side layout, such as a horizontal Balance SheetNone
Section BreakA break between major sections, such as trading account and profit and lossNone

Account Data rows ​

Set the Balance Type:

  • Opening Balance: the balance at the start of the period.
  • Closing Balance: the balance at the end of the period.
  • Period Movement (Debits - Credits): the net change during the period.

Then build the account filter in the filter editor. Select Advanced Filtering to type the filter instead. A filter is a condition [field, operator, value] on the Account, or a group of conditions joined with and or or:

json
["account_type", "=", "Cash"]
["root_type", "in", ["Asset", "Liability"]]
{"or": [["account_category", "like", "Revenue"], ["account_category", "like", "Income"]]}

The operators are =, !=, in, not in, like, not like, and is. For templates that serve many companies, filter on account_type, root_type, or account_category rather than account names.

Calculated Amount rows ​

A formula uses the Line Reference codes of other rows and the functions abs, round, min, max, sum, sqrt, pow, ceil, and floor. For example, with rows REVENUE and COGS:

text
REVENUE - COGS
(GROSS_PROFIT / REVENUE) * 100 if REVENUE != 0 else 0

ERPNext calculates formula rows after account and Custom API rows, in the order their references require, so a formula can refer to a row that appears later in the table. A formula that divides by zero returns 0 and writes an entry in the Error Log.

Row fields ​

FieldMeaning
Line ReferenceA unique code for formulas. It must start with a letter and contain only letters, numbers, and underscores. Python keywords and function names such as sum are not allowed.
Display NameThe text of the line in the report.
Indent Level0 for a main heading, 1 for a sub-category, 2 for individual accounts, and so on.
Data SourceWhere the value comes from (see Data sources).
Balance TypeFor Account Data rows: opening, closing, or period movement.
Value TypeShows the value as Currency, Float, Int, or Percent.
Color, Bold Text, Italic TextFormatting, for example bold totals.
Hidden Line (Internal Use Only)Calculates the line for formulas but does not show it.
Hide If ZeroHides the line when its amount is zero.
Reverse SignShows the value with the opposite sign, for example expenses as positive amounts.
Include in ChartsShows the line in the report chart.

Check account coverage ​

Select View Account Coverage in a saved template. With no rows selected, the dialog shows the accounts that no Account Data row includes, for the company you select. Select rows first to see the accounts that those rows include. Use this to find missing or duplicated accounts.

Run a report with a template ​

In the Balance Sheet, Profit and Loss Statement, or Cash Flow report, select the template in Report Template. Use Account Detail Level to switch between Summary (template lines only) and Account Breakdown (the accounts under each line). The report still reads the same ledger entries, and you can still drill into amounts.

The Custom Financial Statement report runs any enabled template, whatever its report type. Use it for templates such as Financial Ratios Analysis that are not a standard statement.

Cash Flow report rendered with the Standard Cash Flow Statement (IFRS) template

Troubleshooting ​

MessageFix
"Invalid line reference format"Start the code with a letter and use only letters, numbers, and underscores.
"Duplicate line reference"Give each row a unique Line Reference.
"Balance Type is required for Account Data"Select a Balance Type on the row.
"Circular dependency detected"Two or more formulas refer to each other. Break the loop.
"Formula has unbalanced parentheses"Check the brackets in the formula.
"Formula references itself"Remove the row's own code from its formula.
"Field '...' is not a valid Account field"Use a field that exists on the Account, such as account_type or account_category.

An account is missing from the report ​

Check its Account Category and the row's account filter. Run View Account Coverage. Also check whether Hide If Zero hides the line.

The total differs from the standard statement ​

Use the same company, dates, finance book, dimensions, and currency in both. Then look for accounts that are missing or included in two rows.