Document templates, published versions and letterheads
A document template is an HTML letter with merge fields written for one record type; publishing it freezes a numbered version that generation uses while the draft stays editable, and a letterhead (the template's own, else the project's, else the organization's default) supplies the logo, header, footer and page layout around it.
Document templates, published versions and letterheads
A document template is the master copy of a letter, term sheet, agreement or cost sheet: HTML you design in the app, with merge fields where the record's values go. It is written for one record type (a demand, a termsheet, a booking, an estimate…) and belongs to a kind that sets its number prefix. Publishing it takes a snapshot, a numbered version, and only that version is ever used to generate documents, so the draft can be edited without changing what the office is sending out. A letterhead is the branding wrapped around every page.
How it works in NirmaanOne
Template, kind and record type
Templates live under Settings, Documents, Templates (any permission on Document Templates to see the tab; the View permission to open the list). New template (the Create permission) asks for a Code (A-Z, digits and underscores; unique in the organization, retired templates included), a Name, a Kind (Demand Letter, Termsheet, Offer Letter, Agreement, Allotment Letter, Receipt, Cost Sheet or Other; "Sets the number prefix (DL, TS, AGR, AL, RC, DOC)") and a Record type ("What the template merges: a demand, a termsheet, a booking…"). The dialog nudges you towards the usual pairing, for example a Cost Sheet on an Estimate. The record type decides which merge fields exist and which records the template can be generated from; it cannot be changed once documents have been generated from the template.
The designer is a full page: Details (name, kind, Number prefix, Letterhead, Document title with merge fields that becomes the file name, description, page settings), the Body editor, Header and footer overrides, the Merge fields sidebar and a Preview against a real record (see Merge fields and filters). Every organization starts with six starter templates as drafts: "Demand letter (standard)", "Allotment letter (standard)", "Offer letter (standard)", "Term sheet (standard)", "Receipt (standard)" and "Cost estimate sheet (standard)"; a deleted starter comes back the next time lookups are seeded.
Draft, versions and publishing
The template row is the draft. Save draft (the Edit permission) stores it, checks the merge syntax and cleans the HTML, but changes nothing that is generated. Publish (the Publish permission) copies the draft's body, header, footer, title, page settings and letterhead into an immutable version numbered one more than the last, makes it the current version and sets the template Published; the body must not be empty ("Add content before publishing."). A Draft template cannot be used anywhere ("Drafts cannot be used yet. Publish the template to offer it on <record type> records and in workflows.").
After that:
- editing and saving the draft again shows Draft changes in the list and "Draft differs from the published version" in the designer, while generation keeps using the current version;
- Publish changes snapshots the draft as the next version ("Documents generated from now on use it; earlier documents keep the version they were made with."), with optional notes;
- Versions (<n>) lists every version with its date, how many documents it produced and its notes; Restore into draft copies an old version back into the draft without publishing it;
- every generated document records the version it came from and shows "<template name> v<n>".
Retire (the Publish permission) takes a Published template out of every picker and marks it inactive; workflow rules that generate it then fail with "Template <CODE> is not published"; existing documents are untouched. Reopen (the same permission) brings it back as Published (or Draft if it never had a version). Delete is refused once documents were generated from the template, or a message template attaches it, or a workflow rule generates or attaches it ("Documents were generated from this template; retire it instead" and the like). Duplicate copies the current draft, letterhead and page settings into a new Draft template with its own code.
Letterheads
Settings, Documents, Letterheads holds the organization's branding: Name, an optional
Project ("A project letterhead is used for that project's records."), a Logo (PNG, JPEG, SVG,
WebP or GIF up to 2 MB, placed with {{ logo }} in the header), Header and Footer editors
where {{ organization.name }} and {{ project.name }} also work, the page box (Page size,
Orientation, Page numbers, the four margins), Default letterhead ("Used by templates
that do not pin one (organization-wide letterheads only).") and Active. Ticking Default
letterhead on an organization-wide letterhead clears it on the others. A letterhead cannot be
deleted while a template's draft pins it.
When a document is generated (or previewed) the letterhead is chosen in this order:
- the letterhead pinned on the template version (the designer's Letterhead field);
- else an active letterhead of the record's project (the one marked default first, then by name);
- else an active organization-wide letterhead (the default first, then by name);
- else none: the document renders without branding.
The template's own Header and Footer overrides, when filled, replace the letterhead's. Page settings layer the same way: the built-in defaults (A4 portrait, margins 20 / 18 / 20 / 18 mm, Noto Sans 10.5 pt, page numbers on), overlaid by the letterhead's settings, overlaid by the template's. "Page x of y" prints bottom right unless the footer already carries a page number. The logo is read from the letterhead each time a document is shown or re-rendered, so replacing it changes the look of older documents too.
Why
Letters go out under the developer's name and are kept for years, so the office needs one place to control the wording, a guarantee that a change does not silently alter letters already sent, and a trail from any printed page back to the exact wording it came from. Versions give that; letterheads keep branding out of every template so a rebrand or a new project is a single change.
Example
Sea Breeze Developers LLP sets up its documents in October 2026.
- Letterheads. The admin creates "Head office" (organization-wide, Default letterhead on) with the LLP's logo and registered address in the header, and "Sea Breeze Residency" with Project set to that project and the site office address. Both are A4 portrait.
- Templates. The sales manager opens the starter "Demand letter (standard)" (kind Demand Letter, record type Demand, prefix DL), tightens the wording, previews it against demand DM-2026-27-00012, presses Save draft and then Publish with the note "First wording". The template is Published, version 1. Its Letterhead is blank, so a demand on Sea Breeze Residency prints on the project letterhead and a demand on any other project on "Head office".
- Between 1 and 30 November the office generates DL-2026-27-00101 to DL-2026-27-00118, all "Demand letter (standard) v1".
- On 1 December the CA asks for a paragraph on TDS. The manager adds it with Show when on the demand's TDS amount (see Merge fields and filters) and saves: the list shows Draft changes, and the letter generated that afternoon, DL-2026-27-00119, is still v1. On 3 December Publish changes with the note "TDS paragraph" creates version 2; DL-2026-27-00120 onwards are v2, while the November letters keep v1 and still open exactly as sent.
- In January the paragraph turns out to be wrong for member demands. Versions (2), Restore into draft on version 1, a small edit, Publish changes: version 3. Version 2 stays in the list with its 23 documents.
- A Duplicate named "Demand letter (Marathi)" with code DEMAND_LETTER_MR starts as a draft with the same content; given its own Number prefix DLM it would number its letters DLM-2026-27-00001.
Where you see it
- Documents: the area and its tabs.
- Document templates: the list, New template, Duplicate, Delete, the Draft changes badge.
- Document template: Save draft, Publish / Publish changes, Versions, Restore into draft, Retire, Reopen, Letterhead, page settings and the header / footer overrides.
- Letterheads: New letterhead, Upload logo, Default letterhead, Active.
- Generated documents: each document's template and version.
- Message template and Workflow rule: where templates are attached or generated automatically.
- Audit log: changes to templates and letterheads.
Related
Related
- DocumentsScreen
The Documents area of Settings, where you manage document templates and letterheads and see every document generated or uploaded in your organization.
- Document templatesScreen
The list of your organization's document templates (demand letters, offer letters, termsheets, agreements, allotment letters, receipts, cost sheets), with filters and the actions to create, duplicate, open or delete one.
- Document templateScreen
The template designer: write a template's wording with merge fields, set its letterhead, title and page layout, preview it against a real record, and publish, retire or restore its versions.
- LetterheadsScreen
Set up the branding wrapped around generated documents: logo, header and footer, page size, orientation, margins and page numbers, for the whole organization or for one project.
- Generated documentsScreen
The organization-wide log of every document generated from a template or uploaded against a record, where you preview, download, email, void or delete them.
- Message templateScreen
One message template's page: change its wording, attachments and settings, and preview it filled in for a real record.
- RuleScreen
One automation rule's page: read or change its basics, trigger, conditions and actions, test it against a record, clone or delete it, and switch a system rule on or off.
- Audit logScreen
The organization-wide change log: every create, change and delete, every sign-in (including refused ones), sign-out and downloaded file, with who did it, when, from where and what changed.
- Merge fields and filtersConcept
Merge fields are the double-brace placeholders in document and message templates ({{ entity.demand_no }}, {{ contact.name }}) that are replaced with the record's values when a document or message is rendered; filters such as inr, words and date format the value, and Repeat row / Show when add tables and conditional blocks.
- Generated documents: offer letters, cost sheets, void and supersededConcept
A generated document is a numbered, filed rendering of a published template against one record, kept with its merged text, template version and file; offer letters are generated when an offer is issued and supersede the earlier ones, cost sheets print an estimate for the buyer, and a void or superseded document keeps its number and shows a watermark saying what replaced it.
- Numbers and series: documents, bookings, demands, payments and vouchersConcept
How NirmaanOne numbers what it creates: generated documents, bookings, demands, demand runs, payments, payout runs and revenue runs take a prefix, the Indian financial year and a five-digit serial (BK-2026-27-00007), while vouchers are numbered on posting from their voucher type's prefix, padded counter and suffix.
- Roles and permissionsConcept
What a permission is (a module plus an action), how roles bundle permissions, the twelve default roles and what each is meant for, the one-role-per-user rule, and when a change reaches a signed-in user.