Loading…
Loading…
Start from a sample, change anything, and paste the result into a Print Format’s HTML when it looks right.
The preview runs Jinja’s syntax in your browser: doc (with its rows), doc.get_formatted() for amounts and dates, and _(). Server-side helpers such as frappe.db only work inside ERPNext.
A typo does not fail
ERPNext prints an unknown name back as {{ name }} instead of an error, so read the preview carefully.
Raw numbers look raw
doc.grand_total prints 33642.0. Use doc.get_formatted("grand_total") for the currency and grouping.
Rows are documents too
Each row in doc.items has its own get_formatted(), and loop.index counts from 1.
The document as doc, its child tables such as doc.items, Jinja’s if, for and set, filters like round and default, and helpers such as doc.get_formatted() and _() for translation.
ERPNext prints an unknown name back as it was written, instead of failing. Check the field name for a typo.
That is the raw value. doc.get_formatted("grand_total") gives it with the currency symbol and digit grouping, as on the form.
It runs Jinja’s syntax in your browser and was checked against Jinja2 itself. Server-side helpers such as frappe.db are only available inside ERPNext.
Into a new Print Format for that DocType: tick Custom Format, keep Print Format Type as Jinja, and paste it into the HTML field.
We design invoices, quotations and delivery notes in ERPNext — your layout, GST details and logo — and test them on real documents. Talk to a consultant.
or write to info@acube.co
Kochi (Kadavanthra & Infopark) · Thiruvananthapuram · across India & overseas · In business since 2011