Dynamic Content / Formulas
In some user-defined areas, dynamic content based on a simple formula language can be used in addition to static content
(fixed texts). These always begin with =. In terms of content, data from the ESR and the config (data from company,
location and terminal) can be accessed. This occurs when the field is specified within curly brackets (e.g. ={Cfg.Cmp.Label}).
Fixed texts in formulas must be placed under apostrophes (e.g. ='fixed text'). Different contents can be put together using +
(e.g. ='Customer: '+{ESR.Ctm.Nam}). A number of functions are also supported that make handling values and texts easier. In
addition to combining values, the arithmetic operations +, -, * and / can also be used to range values. Comparisons are
done via functions (see EQ, GT, EXISTS etc. below), not via operators.
Extended access to data from lists (e.g. from positions, head or foot) can be made using square brackets (e.g. ={ESR.Foot[1]})
where the counting starts at 0 for the first element. Instead of the index, a condition can also be inserted that allows access
to a list entry based on a check (e.g. {ESR.Foot['_'="barcode"].value})
Please note that JavaScript is being executed in the background to calculate the values. Certain operations such as using +
in combination with both text and numbers will behave according to the JavaScript standard.
The parameters that are passed into the functions can also be the results of other function calls. It is therefore possible to
interconnect calls. Example: =SLICE(REPLACE('abcde','a','1'),1,3)
Supported functions
SLICE
Usage / Syntax: SLICE(value, start, [end])
Description: Returns a defined part of a text or a list.
value= value / text / liststart= start index (starting at 0)end: (optional) end index (this index will not be included)
Example: =SLICE('abcde',1,3)
Result: 'bc'
REPLACE
Usage / Syntax: REPLACE(value, search, replace)
Description: Replaces parts of one value with another.
value= text which to search forsearch= specific value within text to be replacedreplace= replacement value for all occurrences of said value
Example: =REPLACE('abcde','a','1')
Result: '1bcde'
REPLACEALL
Usage / Syntax: REPLACEALL(value, search, replace)
Description: Replaces every occurrence of a value with another (unlike REPLACE, which only replaces the first occurrence per pass).
value= text which to search forsearch= specific value within text to be replacedreplace= replacement value for all occurrences of said value
Example: =REPLACEALL('1,2,3',',','.')
Result: '1.2.3'
REPLACEREGEX
Usage / Syntax: REPLACEREGEX(value, regex, replace)
Description: Replaces parts of a value found by one regex with another.
value= text which to search forregex= a regex string used to find the values which should be replacedreplace= replacement value for all matches of the regex
Example: =REPLACEREGEX('a1b2c3','\d','_')
Result: 'a_b_c_'
PARSEINT
Usage / Syntax: PARSEINT(value, [radix])
Description: Attempts to interpret a given value as an integer.
value= the value to be interpretedradix= (optional) number that can be used as a basis for the interpretation (e.g. 10 for decimal numbers (e.g. 123), 16 for hexadecimal numbers (e.g. 7B) or other number systems)
Example: =PARSEINT('7B',16)
Result: 123
PARSEFLOAT
Usage / Syntax: PARSEFLOAT(value)
Description: Attempts to interpret a given value as a float (decimal number).
value= the value to be interpreted
Example: =PARSEFLOAT('010.50')
Result: 10.5
TOFIXED
Usage / Syntax: TOFIXED(value, [digits])
Description: The decimal number contained in the value is rounded to the specified number of decimal places.
value= value to be rounded, 'digits' = (optional) number of decimal places to be determined
Example: =TOFIXED(10.508,2)
Result: 10.51
TOUPPERCASE
Usage / Syntax: TOUPPERCASE(value)
Description: Converts all letters in the specified value to uppercase.
Example: =TOUPPERCASE('aBc')
Result: ABC
TOLOWERCASE
Usage / Syntax: TOLOWERCASE(value)
Description: Converts all letters in the specified value to lowercase.
Example: =TOLOWERCASE('Abc')
Result: abc
LINEBREAK
Usage / Syntax: LINEBREAK(count)
Description: Adds a number of line breaks \r\n to the final value.
count= the number of line breaks to be added. At least 2 are required for blank lines.
Example: =LINEBREAK(2)
Result: \r\n\r\n
CURRENTDATE
Usage / Syntax: CURRENTDATE(format)
Description: Prints the current data (i.e. the date when the bill is displayed)
format= the format of the date, using standard JavaScript formatting parameters (e.g.ddfor the current day,MMfor the month,yyyyfor the year, etc.)
Example: =CURRENTDATE('dd.MM.yyyy')
Result: 14.04.2026
JOIN
Usage / Syntax: JOIN(list, key, separator)
Description: Iterates a list from the ESR and joins one field of every entry into a single text — without having to know the length of the list. Entries without the given field contribute an empty value; blank values are kept as they are (useful for vertical spacing on receipts).
list= a list from the ESR (e.g.{ESR.PosA})key= the name of the field to take from each entry (e.g.'Dsc')separator= the text placed between the values (e.g.LINEBREAK(1)for one value per line)
Example: =JOIN({ESR.PosA},'Dsc',LINEBREAK(1))
Result: every position description, one per line
JOIN produces one single text — individual lines cannot be styled differently. If per-line conditional formatting is needed, use the Line List section (see Simple Bill - Layout Sections) instead.
Comparison and logic functions
These functions return a truth value and are primarily used in conditional visibility ("Show only when") and conditional formatting (style rules) — see the sections below. They can be freely combined and nested.
EQ / NE
Usage / Syntax: EQ(left, right) / NE(left, right)
Description: Checks two values for equality (EQ) or inequality (NE). If both values can be interpreted as numbers, they are compared numerically (so '5.0' equals 5); otherwise they are compared as text.
Example: =EQ({ESR.DT},'INVOICE')
Result: true when the receipt is an invoice
LT / GT / LE / GE
Usage / Syntax: LT(left, right) / GT(left, right) / LE(left, right) / GE(left, right)
Description: Numeric comparison — less than, greater than, less or equal, greater or equal. Values that cannot be interpreted as numbers result in false.
Example: =GT({ESR.T},0)
Result: true when the receipt total is positive
EXISTS
Usage / Syntax: EXISTS('path')
Description: Checks whether a field exists on the receipt. The path is given as a text (in apostrophes, without curly brackets) and never causes an error when the field is absent — unlike referencing a missing field directly with {...}, which fails the whole formula.
'path'= the field to check (e.g.'ESR.Ctm','ESR.PosA[0]')
Example: =EXISTS('ESR.RFN')
Result: true when the receipt references an original receipt (e.g. a return)
AND / OR / NOT
Usage / Syntax: AND(a, b, ...) / OR(a, b, ...) / NOT(a)
Description: Combines truth values: AND is true when all arguments are true, OR when at least one is, NOT inverts its argument.
Example: =AND(EQ({ESR.DT},'INVOICE'),GT({ESR.T},0))
Result: true for invoices with a positive total
Conditional visibility ("Show only when")
Every layout section carries — in addition to the on/off switch — an optional "Show only when" formula. When set, the section is only rendered when the formula evaluates to a truthy result for the receipt being displayed. This allows a single layout to adapt to the content of each receipt:
| Goal | Formula |
|---|---|
| Show a section only on invoices | =EQ({ESR.DT},"INVOICE") |
| Show a section only for positive totals | =GT({ESR.T},0) |
| Show a section only when a field is present | =EXISTS("ESR.Ctm") |
| Show a section only for non-fiscal slips | =EQ({ESR.NF},"ncr_nf") |
| Combine conditions | =AND(EQ({ESR.DT},"INVOICE"),GT({ESR.T},0)) |
Evaluation rules:
- An empty formula means the section is always shown (subject to the on/off switch).
- The on/off switch always wins — a switched-off section stays hidden regardless of the formula.
- Any error — including referencing a field that is missing on the receipt (e.g.
{ESR.DT}whenDTis absent) — hides the section (fail-closed). UseEXISTS('...')when a field may legitimately be absent.
The layout editor validates the formula against the currently selected preview receipt and shows a hint when it cannot be evaluated. This hint is informational only — the layout can still be saved, since a formula may be valid for other receipts than the preview one.
Conditional formatting (style rules)
Sections can carry style rules that format content based on the receipt data — like CSS classes driven by conditions. Each rule consists of a condition formula ("Apply when") and one or more formatting options. All matching rules are combined; a rule with an empty condition always applies.
Available formatting options: bold, italic, underline, double-height, muted,
align-left, align-center, align-right, negative, highlight.
Rules are evaluated in two scopes:
- Per line (Positions and Line List sections of the Simple Bill): the rule additionally sees the current line as
Pos(aliasItem), so conditions like=EXISTS("Pos.SomeField")or=LT({Pos.Amt},0)format individual lines. The variable is always calledPos, regardless of which list the section iterates (see Line List). - Per section (all other Simple Bill sections): the rule sees the receipt (
ESR/Cfg) and formats the whole section — e.g.=LT({ESR.T},0)→negativecolors the total section for refunds.
Which of the two applies is determined by the section: sections that render a list (Positions, Line List) format each line,
all others format the section. A rule is therefore never applied twice — otherwise relative formatting like double-height
or muted would accumulate.
Evaluation rules:
- A rule whose formula fails (e.g. a referenced field is missing on this line) is simply skipped — conditional formatting never hides content; visibility is exclusively controlled by the switch and "Show only when".
- Rules with vendor- or POS-specific fields are pure configuration: for example, receipt lines delivered with
NCR_Bold/NCR_DoubleHeight/NCR_Alignfields can be reproduced with rules like=EXISTS("Pos.NCR_Bold")→bold,=EXISTS("Pos.NCR_DoubleHeight")→double-height,=EQ({Pos.NCR_Align},"Center")→align-center.