5000-ENG rather than one flat code.
New to journal entries?
New to journal entries?
A journal entry is how accounting records a transaction: each line assigns an amount to an account, like wages or taxes payable. A payroll produces one, and the Journal Entry report is that entry laid out line by line.
Why two sides: expense and liability?
Why two sides: expense and liability?
A payroll line records both an expense (the employer’s cost) and the liability it creates (what’s owed until it’s paid out). That’s why segments, templates, and the report columns all come in an expense and a liability form.
How this differs from an accounting code
A generated code is not an accounting code. Both can appear on the Journal Entry report, but they come from separate systems. Accounting codes- A distinct entity in Nmbr: a fixed expense or liability code.
- Often imported from an external accounting platform, and drive the automated export back to it (Xero, QuickBooks).
- Assigned to a line manually, or by accounting code rules based on attributes like the primary tag or line item type.
- Rules are driven by a single primary tag group.
- Computed when the Journal Entry report is built, from a segment template you define globally.
- Can combine any number of tag groups, accounting codes, and freeform text.
- Not a fixed, labelled value from a known set.
- Never part of the export to Xero or QuickBooks.
How a generated code is built
A generated code is built from a segment template on an accounting code rule: an ordered list of segments, some of which read values from tags.The segment template
A segment template is defined on a global accounting code rule (one with no tag or tag group scope). A rule holds one template per side, inexpense_segment_template and liability_segment_template. When the Journal Entry report is built, Nmbr renders the template’s segments in order and joins them into that side’s generated code.
Segments
Each segment resolves to a value from one of three sources:accounting_code: a fixed accounting code’scode. Setidto the accounting code’sid.tag_group: a code carried by one of the row’s tags. Settag_group_idto the tag group’sid.text: a literal string you supply.
tag_group segment reads its value from the tag itself. Each tag carries a per-side code, expense_segment and liability_segment, set when you create or update the tag (see Setting up tag groups and tags). On each report row, the segment takes the code from the row’s tag in that group.
Formatting
Theaccounting_code and tag_group segments also accept optional formatting:
prefix/suffix: literal strings wrapped around the resolved value.transform: an ordered list ofuppercase,lowercase,alphanumeric(strip non-alphanumeric characters).max_length: truncate the resolved value to this many characters.fallback: a value to use when the segment resolves empty. Without one, an empty segment is dropped, prefix and suffix included.
max_length, then wrap with prefix and suffix.
The result
When a rule’s template matches a line, the rendered string appears in Generated Expense Code or Generated Liability Code on the Journal Entry report. The columns are always present; on a given line only the relevant side is filled. Bank, payable, and total rows stay blank.Which template applies
Templates resolve on their own when the report is built, separately from how accounting codes are routed during payroll calculation. The precedence is the same: for each side of a line, Nmbr uses the template from the most specific matching global rule.business_preset_idtype+subtypetype- the catch-all: no
type,subtype, orbusiness_preset_id
Example
Give two tags an expense segment. The “Engineering” department tag:GEN when a row has none:
5000, the report’s Generated Expense Code reads:
5000-GEN-TOR.
Behaviour and limits
- Global rules only. Templates are defined on rules with no tag or tag group scope.
- Report only. Generated codes never affect the accounting code that syncs to the connected accounting platform. See Exporting journal entries.
Related
- Tagging and Journal Entry Tracking for tags, tag groups, and how they split allocations.
- Accounting for accounting codes, rules, and the Journal Entry report.

