HELP

DocumentsTemplates

Guide for creating HTML PDF templates in Settings -> Documents templates. Covers starters, live preview, mock PDF, invoice setting scope, defaults, status, import, the create-document PDF template picker, placeholders, loops, CSS, RTL, payment links, and safety rules.

Permissions

Action

Push Service

No push is sent because this function only reads data or returns helper information.

Automation

No automation is run for this function.

Special Instructions

Document Types

invoice

Tax invoice / standard invoice for a customer. Do not send payment_method.

Recommended Sections

  • Invoice number
  • Invoice date and due date
  • Business/company details
  • Customer details
  • Items
  • Subtotal, VAT/tax, discount, total
  • Payment link when unpaid
  • Invoice Israel data if needed

Useful Placeholders

{{document.last_documents_id}}
{{document.date_created}}
{{document.due_date}}
{{document.total}}
{{document.tax}}
{{document.discount}}
{{document.final_amount}}
{{document.invoice_israel_code}}
{{payment_link}}

Required

  • customer_id or email/mobile/phone
  • document_type=invoice (or omit; default)
  • final_amount
  • items[] or products[]
  • invoice_setting_id if no default company exists

Optional

  • related_document_id to create invoice from receipt/proposal/order
  • tax/include_tax/discount fields
  • save_as_draft=1
  • send_email/send_whatsapp
  • date_created/due_date/last_pay_date
  • corporation may be required by company settings or Invoice Israel
  • pdf_template_id

Loop: items[]

  • Required per useful line: item_name, item_qty, item_price, item_total
  • Recommended defaults when not linking a catalog product: iteeeem_id=0, item_discount_type=percentage, item_discount=0
  • Optional per line: iteeeem_id product id, item_discount_type, item_discount, item_notes, item_storageid (warehouse id from Storage.List), item_SKU, item_type
  • For appointment packages: item_type=appointment_group, iteeeem_id=group id, item_qty=number of appointments
  • For appointment services: item_type=appointment_type, iteeeem_id=appointment type id, item_qty=number of appointments

proforma_invoice

Proforma invoice / preliminary invoice before final tax invoice. Do not send payment_method.

Recommended Sections

  • Proforma label
  • Document number/date
  • Business details
  • Customer details
  • Items
  • Totals
  • Proforma notes

Useful Placeholders

{{document.last_documents_id}}
{{document.date_created}}
{{document.final_amount}}
{{company.notes_for_proforma_invoices}}

Required

  • customer_id or email/mobile/phone
  • document_type=proforma_invoice
  • final_amount
  • items[] or products[]

Optional

  • tax/include_tax/discount fields
  • save_as_draft=1
  • send_email/send_whatsapp
  • date_created/due_date/last_pay_date
  • note/note_header

Loop: items[]

  • Required per useful line: item_name, item_qty, item_price, item_total
  • Optional product/storage/custom fields are the same as invoice.

credit_invoice

Credit invoice that credits/cancels an invoice or receipt-tax-invoice amount. Do not send payment_method.

Recommended Sections

  • Credit invoice number
  • Related customer
  • Credited items
  • Negative/credit totals
  • Notes

Useful Placeholders

{{document.last_documents_id}}
{{document.date_created}}
{{customer.name}}
{{document.final_amount}}

Required

  • customer_id
  • document_type=credit_invoice
  • final_amount
  • items[] normally
  • related_document_id is normally required so the credited document is linked

Optional

  • tax/include_tax
  • note
  • date_created
  • save_as_draft=1
  • corporation may be required by Invoice Israel

Loop: items[]

  • Required per useful line: item_name, item_qty, item_price, item_total
  • Use values that match the amount being credited.

receipt

Receipt for money received. Payment is required.

Recommended Sections

  • Receipt number and date
  • Business details
  • Customer details
  • Payment/receipt details
  • Total
  • Notes

Useful Placeholders

{{document.last_documents_id}}
{{document.date_created}}
{{customer.name}}
{{document.final_amount}}
{{company.receipt_letter}}

Required

  • customer_id (or email/mobile/phone to create/reuse customer)
  • document_type=receipt
  • final_amount
  • call_multi_receipt_fun=1
  • Either payment_method (+ method fields) OR multiple_receipt_detail[]
  • Sum of all pay_amount values must equal final_amount

Optional

  • document_to_pay or related_document_id to mark invoices/orders paid
  • payment_date
  • number_of_payments
  • c_type_pay
  • send_email/send_whatsapp
  • create_receipt_seprate for installments
  • items[] if receipt should show lines
  • invoice_setting_id

Loop: items[]

  • Items can be empty for a simple receipt, or include item_name/item_qty/item_price/item_total when receipt should show lines.

Loop: multiple_receipt_detail[]

  • Every block requires: payment_method, pay_amount
  • Optional on every block: note (or inner_block_note), payment_date, payment_date_document
  • cash: no extra fields
  • cc: new card needs card_no, card_name, month_year, cvc; OR send subscription_id/card_id for saved card; optional c_type_pay, number_of_payments, unlimited, order_take_installment_type
  • check: one or more check rows with check_number + check_sumamount (required per kept row); optional check_date, check_bank_details, check_acc_number, check_branch_no, check_tz, check_address, check_email, check_team_member, monthly_payment_for_check
  • transference: optional check_trans_vista, check_acc_number_trans, check_branch_no_trans, check_bank_name/check_bank, deposite_to_bank, check_date_trans
  • masav: acc_no, branch_no, bank, acc_name, tz; optional masav_id, no_of_payment, unlimited, bi_monthly, cust_id_hide
  • others: other_payment_option required
  • bit: bit_payment_id required
  • payby_credit: payby_credit_invoice_number required
  • paybridge_tranzila: optional number_of_payments_paybridge, c_type_pay_paybridge
  • stripe_iframe / strip_payment: no extra card fields on this layer (processor handles charge)
  • nedarim_payment: optional c_type_pay_nedarim, number_of_payments_nedarim, payment_date_nedarim, unlimited_nedarim, last4degits/card_no
  • See Payment Methods section for full field lists and sample blocks

receipt_partly_paid

Partial receipt against one or more related documents. Payment is required.

Required

  • customer_id
  • document_type=receipt_partly_paid
  • related_document_id
  • final_amount
  • call_multi_receipt_fun=1
  • payment_method or multiple_receipt_detail[]
  • pay total cannot exceed remaining amount on related document

Optional

  • document_to_pay
  • payment_date
  • number_of_payments
  • send_email/send_whatsapp

Loop: multiple_receipt_detail[]

  • Same payment_method rules as receipt. See Payment Methods section.

receipt_tax_invoice

Receipt tax invoice: invoice lines + payment in one document.

Recommended Sections

  • Tax invoice number
  • Receipt number/date
  • Business details
  • Customer details
  • Items
  • Payment details
  • Tax, discount, total

Useful Placeholders

{{document.last_documents_id}}
{{document.date_created}}
{{document.total}}
{{document.tax}}
{{document.final_amount}}
{{company.invoice_receipt_letter}}

Required

  • customer_id
  • document_type=receipt_tax_invoice
  • final_amount
  • items[] for invoice lines
  • call_multi_receipt_fun=1
  • payment_method or multiple_receipt_detail[]
  • sum of pay_amount = final_amount

Optional

  • related_document_id/document_to_pay
  • tax/include_tax
  • payment_date
  • send_email/send_whatsapp
  • corporation may be required by company settings or Invoice Israel

Loop: items[]

  • Required per useful line: item_name, item_qty, item_price, item_total
  • Optional product/storage/custom fields are the same as invoice.

Loop: multiple_receipt_detail[]

  • Same payment_method rules as receipt. See Payment Methods section.

gi_ir

Goods receipt / invoice receipt style payment document. Payment is required.

Recommended Sections

  • Document number/date
  • Business details
  • Customer details
  • Payment details
  • Totals
  • Notes

Useful Placeholders

{{document.last_documents_id}}
{{document.date_created}}
{{customer.name}}
{{document.final_amount}}

Required

  • customer_id
  • document_type=gi_ir
  • final_amount
  • call_multi_receipt_fun=1
  • payment_method or multiple_receipt_detail[]

Optional

  • related_document_id/document_to_pay
  • payment_date
  • items[]
  • send_email/send_whatsapp

Loop: multiple_receipt_detail[]

  • Same payment_method rules as receipt. See Payment Methods section.

organization_receipt

Donation/organization receipt. Payment is required.

Recommended Sections

  • Donation/organization receipt number
  • Donor/customer details
  • Amount
  • Organization details
  • Donation receipt notes

Useful Placeholders

{{document.last_documents_id}}
{{customer.name}}
{{document.final_amount}}
{{company.notes_for_donation_receipt}}

Required

  • customer_id
  • document_type=organization_receipt
  • final_amount
  • call_multi_receipt_fun=1
  • payment_method or multiple_receipt_detail[]

Optional

  • cus_products_id for organization product/donation link
  • payment_date
  • send_email/send_whatsapp
  • note

Loop: multiple_receipt_detail[]

  • Same payment_method rules as receipt. For cc on organization_receipt the block may force cc_paytype=add_new_card. See Payment Methods section.

purchase_orders

Purchase/order document. Do not send payment_method.

Recommended Sections

  • Supplier/customer details
  • Order number and date
  • Items ordered
  • Quantity and price
  • Delivery notes
  • Payment link if relevant
  • Footer with page number

Useful Placeholders

{{document.last_documents_id}}
{{document.date_created}}
{{customer.name}}
{{company.company_name}}
{{company.purchase_order_letter}}
{{{company.purchase_order_letter_html}}}

Required

  • customer_id or email/mobile/phone
  • document_type=purchase_orders
  • final_amount
  • items[] or products[]

Optional

  • related_document_id to create from proposal/invoice
  • auto_send_purchase_order_to_sign=1
  • order_all_fields
  • save_as_draft=1
  • send_email/send_whatsapp
  • date_created/due_date/last_pay_date

Loop: items[]

  • Required per useful line: item_name, item_qty, item_price, item_total
  • Optional product/storage fields can affect stock/order tracking.
  • appointment_group and appointment_type item_type values can create customer appointment packages.

order_proposals

Proposal/quote document before the customer approves an order. Do not send payment_method.

Recommended Sections

  • Header with company logo/name
  • Proposal number and date
  • Customer details
  • Company details
  • Product/service list
  • Product options/specifications
  • Notes and terms
  • Total
  • Approval/payment link
  • Biz1 credit footer

Useful Placeholders

{{document_type}}
{{logo}}
{{document.last_documents_id}}
{{document.date_created}}
{{customer.name}}
{{customer.email}}
{{customer.mobile}}
{{company.company_name}}
{{payment_link}}
{{payment_link_label}}

Required

  • customer_id or email/mobile/phone
  • document_type=order_proposals
  • final_amount
  • items[] or products[]

Optional

  • proposal_title
  • approve_sign_img
  • order_all_fields
  • save_as_draft=1
  • send_email/send_whatsapp
  • note/note_header

Loop: items[]

  • Required per useful line: item_name, item_qty, item_price, item_total
  • Optional product/storage/custom fields are the same as invoice/order documents.

Example HTML

<div class="document proposal">
  {{footer}}
  <h1>Proposal {{document.last_documents_id}}</h1>
  <p>Date: {{document.date_created}}</p>
  <h2>{{customer.name}}</h2>
  <p>{{customer.email}} {{customer.mobile}}</p>
  <table>
    {{#items}}
    <tr><td>{{item.name}}</td><td>{{item.qty}}</td><td>{{format_money(item.price, document.coin)}}</td><td>{{format_money(item.qty * item.price, document.coin)}}</td></tr>
    {{/items}}
  </table>
  {{#if payment_link}}<a href="{{payment_link}}">{{payment_link_label}}</a>{{/if}}
</div>

delivery_invoice

Delivery document or return delivery document. Do not send payment_method.

Recommended Sections

  • Delivery document number
  • Customer/shipping details
  • Items delivered
  • Delivery notes
  • Optional totals

Useful Placeholders

{{document.last_documents_id}}
{{document.date_created}}
{{customer.address}}
{{company.notes_for_delivery}}

Required

  • customer_id
  • document_type=delivery_invoice
  • final_amount
  • items[] normally
  • type_of_delivery=delivery or return when stock movement matters

Optional

  • related_document_id to link to purchase order/order
  • date_created
  • save_as_draft=1
  • note
  • send_email/send_whatsapp

Loop: items[]

  • Required per useful line: item_name, item_qty, item_price, item_total
  • Optional item_storageid (from Storage.List) and iteeeem_id are important for stock movement.
  • Use type_of_delivery=return to reverse/return delivered stock where supported.

detail_orders

Detailed order document with item specifications, product/category options, notes, and payment link when unpaid and enabled.

Recommended Sections

  • Order number
  • Customer details
  • Detailed item list
  • Category/product options
  • Notes
  • Payment link when unpaid and enabled

Useful Placeholders

{{item.options_text}}
{{company.details_order_letter}}
{{{company.details_order_letter_html}}}
{{payment_link}}
{{payment_link_label}}

Required

  • Document number/date placeholders
  • Company details
  • Customer name
  • Biz1 credit footer
  • Items loop when the template shows products/services

Optional

  • Payment link block
  • Category/product option fields
  • Detailed order letter/body notes
  • Header/footer with page numbers

Loop: items[]

  • Use {{#items}}...{{/items}} for every detailed line.
  • Use {{item.options_text}} to show saved product/category option values.

PDF Templates

What PDF Templates Do

PDF templates let users design document PDFs with HTML/CSS and placeholders. If no custom template is selected or defaulted, the standard Biz1 PDF design is used.

  • Supported document types: order_proposals, purchase_orders, invoice, receipt, receipt_tax_invoice, credit_invoice, delivery_invoice, proforma_invoice, detail_orders, gi_ir, organization_receipt.
  • Manage templates in Settings -> Documents templates: list, create, edit, test, live preview, mock PDF, starters, import HTML, set defaults, and archive.
  • Templates are scoped by invoice setting (company), language, and document type, and can be set as defaults for one or more document types.
  • When creating a document, users can pick a PDF template, or leave System default so the active default (or the standard PDF) is used.
  • Rendering supports modern browser CSS and RTL/LTR output.

Settings Page Overview

Open Settings -> Documents templates. The page has a template list on top and an add/edit form with a live A4 preview.

  • Template list: filter by document type, then View, Edit, Test, set Default, or Remove (archive) a saved template.
  • Invoice setting column shows the company name/tax id and the company id as a separate #id badge. All invoice settings means the template can apply across companies.
  • Basics: name, primary type (preview), template language, invoice setting, and status (Draft / Active / Archived).
  • Defaults: Set as default plus checkboxes for one or more document types where this active template should auto-select.
  • Start from a ready design: one-click starter HTML/CSS per document type (full sample with company, items, notes, payment link, logo, and Biz1 credit).
  • Import file: upload an HTML file and optional related images/CSS; the system checks safety and required placeholders, then rewrites relative image paths.
  • Advanced HTML / CSS: edit the template code directly after using a starter or import.
  • Live preview: paper-like A4 iframe with mock data. Refresh it with Test with mock data or by loading a starter.
  • Download mock PDF: generates a real PDF with Playwright using the current HTML/CSS and mock data.
  • Help on the page is short; this DocumentsTemplates page is the full guide.

How To Create A Template

  • Open Settings -> Documents templates inside the system.
  • Click New template, or Edit an existing row from the template list.
  • Fill Basics: name, primary type (used for preview/test/starters), template language, invoice setting (All or one company), and status.
  • Optionally check Set as default and choose Default for document types (one or more types). Only Active templates can be default.
  • Fast path: click a starter under Start from a ready design to load a full valid sample for that document type, then edit what you need.
  • Or import your own HTML (and related images/CSS), or paste/edit HTML and CSS in Advanced HTML / CSS.
  • Use the placeholders, loops, filters, and conditions from this guide inside the HTML.
  • Click Test with mock data to refresh the live A4 preview, and Download mock PDF to check the real PDF output.
  • Save template. Set status to Active when it should be available for documents.
  • When users create that document type, the active default is preselected, or they can choose the template from the PDF template dropdown.

Starter Designs

Starters are ready HTML/CSS samples for each supported document type. They already include required placeholders.

  • Each starter card loads a full sample: company, customer, items, totals, notes, payment link when relevant, logo, and Biz1 credit.
  • Loading a starter sets Primary type (preview) to that document type and refreshes the live preview.
  • If you are editing an existing template, the screen asks before replacing the current HTML/CSS. Name, company, and default checkboxes stay the same.
  • After loading a starter, edit text, layout, and CSS as needed, then Test and Save.

Live Preview And Mock PDF

  • Live preview shows a paper-like A4 layout with mock data for the selected primary type and template language.
  • Test with mock data validates safety/required parts, renders HTML, and updates the preview.
  • Download mock PDF builds a real PDF from the same mock render so you can check pagination, header/footer, and print layout before going live.
  • Preview language follows Template language (for example English LTR vs Hebrew RTL), not only the UI language.
  • Always test and download a mock PDF before setting a template as Active default for real documents.

Invoice Setting And Company Scope

  • Invoice setting = the company/business profile used on documents (invoice settings record).
  • All invoice settings (value 0): the template can be used for any company in the account, subject to language and type matching.
  • A specific company (shown as name - tax id - #id): the template is limited to that invoice setting.
  • When creating a document, the PDF template dropdown only lists active templates that match the selected company (or All) plus type/language rules.
  • Defaults are also resolved per invoice setting, document type, and language.

Primary Type And Default Types

  • Primary type (preview) controls live preview mock data, Test / Download mock PDF sample content, and which starter design language/layout to load.
  • Default for document types is separate: check every document type where this Active template should auto-select when creating documents.
  • One template can be default for several document types (for example Tax invoice and Proforma), while primary type stays the type you design/preview against.
  • Setting a default can replace another template that was already default for those types; the screen asks for confirmation.
  • Only Active templates can be set as default.

Template Status

  • Draft: work in progress. Not offered in the create-document PDF template list and cannot be the default.
  • Active: available for create/update document picker and eligible to be default.
  • Archived: removed from normal use. Existing documents keep any PDF already generated. Use Remove on the list to archive.
  • If every template is Draft or Archived, create documents show only System default and use the standard Biz1 PDF.

Import HTML File

  • Use Import file when you already have an HTML design outside Biz1.
  • Choose Load HTML file, optionally select Images/CSS used by this file, then Load, check, and save file.
  • The upload is checked with the same safety and required-placeholder rules as Save template.
  • Relative image paths in the HTML/CSS are uploaded to the files server and rewritten when matching files are selected.
  • After import, review Advanced HTML / CSS, run Test with mock data, and Download mock PDF.

Template Language Defaults

  • Each template has a language: he, en, ar, or th.
  • When a document PDF is created without an explicit template choice, Biz1 first looks for an active default template in the document language.
  • If no template exists for that language, Biz1 tries the company/system default language template.
  • If no matching custom template exists, the existing standard PDF design is used (System default).
  • Choosing a specific template in the create modal (or sending pdf_template_id) uses that template when it belongs to the account and invoice setting.

How Users Use Templates

  • Create or edit a document from the normal document screen (customer / documents).
  • Choose the document type, company (invoice setting), customer, items, totals, payments, notes, and sending options as usual.
  • Use the PDF template dropdown: System default keeps the standard Biz1 PDF (or the active default custom template when one resolves automatically).
  • Or pick a named active custom template from the list. Options reload when company or document language changes.
  • Generate the PDF and check spacing, page breaks, RTL direction, totals, payment links, and repeated header/footer.
  • If the template cannot render and strict template mode is enabled, the system shows an error instead of falling back to the standard PDF design.

System Default And Standard PDF

Custom templates do not replace the old PDF unless you activate and select or default them.

  • System default in the create modal means: use the resolved active default custom template if one matches, otherwise use the standard Biz1 PDF design.
  • No Active custom template, or no matching company/type/language default: the standard PDF is used.
  • Archived or Draft templates never drive new PDFs.
  • Existing documents keep the PDF file that was already generated; changing templates later does not rewrite old files unless you regenerate the PDF.
  • Custom HTML PDFs use the browser/Playwright renderer. Some legacy extras (for example certificate signing and receipt payment tables) are still stronger on the standard PDF path.

Required Template Parts

  • Company name: {{company.company_name}}, {{company.name}}, or {{owner.company_name}}
  • Company ID: {{company.company_tax_id}}, {{company.company_id}}, or {{owner.company_tax_number}}
  • Company address: {{company.company_address}}, {{company.address}}, or {{owner.address}}
  • Company phone: {{company.company_phone}}, {{company.phone}}, {{owner.phone}}, or {{owner.mobile}}
  • Customer name: {{customer.name}}
  • Document date: {{document.date_created}} or {{document.date}}
  • Document ID: {{document.last_documents_id}} or {{document.id}}
  • Document type label: {{document_type}}, {{document.type_label}}, or {{document.document_type}}
  • Biz1 logo: {{crm_logo}}
  • Biz1 credit text: {{crm_credit}}
<a href="https://biz1.co.il"><img src="{{crm_logo}}" width="48" /><span>{{crm_credit}}</span></a>

Document Placeholders

{{document.id}}
{{document.last_documents_id}}
{{document.date_created}}
{{document.date}}
{{document.due_date}}
{{document.type}}
{{document_type}}
{{document.type_label}}
{{document.lang}}
{{document.direction}}
{{document.coin}}
{{document.total}}
{{document.tax}}
{{document.discount}}
{{document.final_amount}}
{{document.note}}
{{document.note_html}}
{{document.payment_link}}
{{document.invoice_israel_code}}

Customer Placeholders

{{customer.name}}
{{customer.email}}
{{customer.mobile}}
{{customer.phone}}
{{customer.address}}
{{customer.company}}
{{customer.corporation}}
{{customer.cf_name}}

Company And Owner Placeholders

{{company.company_name}}
{{company.company_tax_id}}
{{company.company_address}}
{{company.company_phone}}
{{company.email}}
{{logo}}
{{company.logo}}
{{company.company_letter}}
{{company.order_letter}}
{{company.receipt_letter}}
{{company.invoice_receipt_letter}}
{{company.purchase_order_letter}}
{{company.details_order_letter}}
{{owner.name}}
{{owner.email}}
{{owner.phone}}
{{owner.mobile}}
{{owner.website}}
{{owner.logo}}
{{owner.invoice_logo}}
{{owner.address}}
{{owner.company_name}}
{{owner.company_tax_number}}

Company Logo Placeholder

  • {{logo}} renders the logo from the selected invoice settings record.
  • {{company.logo}} is normalized to the same safe URL as {{logo}}.
  • If the selected invoice settings record has no logo, the system uses the standard invoice logo placeholder image.
  • {{crm_logo}} is different: it is the Biz1 credit logo and should stay in the Biz1 credit/footer block.
<img src="{{logo}}" alt="Company logo" style="max-width:150px;max-height:80px" />
<a href="https://biz1.co.il"><img src="{{crm_logo}}" width="48" /><span>{{crm_credit}}</span></a>

Payment Link

  • Use payment placeholders when a payment or approval link exists.
  • For order_proposals, the link appears when the proposal is not approved/signed yet.
  • For invoice, detail_orders, and purchase_orders, the link appears when unpaid and payment button settings allow it.
  • When there is no valid link, the placeholder is empty.
{{payment_link}}
{{document.payment_link}}
{{payment_title}}
{{payment_text}}
{{payment_link_label}}

{{#if payment_link}}
<section class="payment-cta">
  <strong>{{payment_title}}</strong>
  <span>{{payment_text}}</span>
  <a href="{{payment_link}}">{{payment_link_label}}</a>
</section>
{{/if}}

Repeated Header Footer And Pages

  • Use {{header}} and {{footer}} for default repeated areas.
  • Use {{#header}}...{{/header}} and {{#footer}}...{{/footer}} for custom repeated header/footer blocks.
  • Use page tokens only inside header/footer.
  • When header/footer is used, PDF margins are increased to make room.
{{#header}}
<div>{{company.company_name}} - {{document.last_documents_id}} <span style="float:right">{{page}} / {{pages}}</span></div>
{{/header}}

{{#footer}}
<div><a href="https://biz1.co.il">{{crm_credit}}</a> <span style="float:right">{{page}} / {{pages}}</span></div>
{{/footer}}

{{page}}
{{pages}}
{{total_pages}}

RTL And Language

  • Hebrew and other RTL documents render with dir=rtl and lang=he.
  • English and Thai render LTR.
  • Language-aware placeholders: {{crm_credit}}, {{payment_title}}, {{payment_text}}, {{payment_link_label}}.
.document-pdf-template-root[dir=rtl] { direction: rtl; text-align: right; }
.document-pdf-template-root[dir=ltr] { direction: ltr; text-align: left; }

Safe Rich Text Notes

  • Normal placeholders escape HTML, for example {{document.note}}.
  • Prepared safe rich text uses triple braces.
{{{document.note_html}}}
{{{company.header_notes_order_proposal_html}}}
{{{company.order_letter_html}}}
{{{company.purchase_order_letter_html}}}
{{{company.details_order_letter_html}}}

Header And Body Note Fields

{{company.header_notes_invoice}}
{{company.header_notes_order_proposal}}
{{company.header_notes_order_proposal_html}}
{{company.header_notes_receipt}}
{{company.header_notes_receipt_tax_invoice}}
{{company.header_notes_purchase_order}}
{{company.header_notes_details_order}}
{{company.header_notes_delivery}}
{{company.header_notes_proforma_invoice}}
{{company.header_notes_donation_receipt}}
{{company.company_letter}}
{{company.order_letter}}
{{company.order_letter_html}}
{{company.receipt_letter}}
{{company.invoice_receipt_letter}}
{{company.purchase_order_letter}}
{{company.purchase_order_letter_html}}
{{company.details_order_letter}}
{{company.details_order_letter_html}}
{{company.notes_for_delivery}}
{{company.notes_for_proforma_invoices}}
{{company.notes_for_donation_receipt}}

Items Loop

{{#items}}
<tr>
  <td>{{item.name}}</td>
  <td>{{item.qty}}</td>
  <td>{{format_money(item.price, document.coin)}}</td>
  <td>{{format_money(item.qty * item.price, document.coin)}}</td>
</tr>
{{/items}}

{{item.name}}
{{item.qty}}
{{item.price}}
{{item.discount}}
{{item.description}}
{{item.notes}}
{{item.sku}}
{{item.discount_type}}
{{item.vat_include}}
{{item.line_total}}
{{item.options_text}}

Product Category And Option Fields

  • {{item.options_text}} contains saved category option/custom-field values for the line, formatted as text.
{{product.id}}
{{product.color}}
{{product.image}}
{{product.image_url}}
{{category.id}}
{{category.name}}
{{category.category}}
{{category.image}}
{{category.image_url}}

Filters And Conditions

  • Use items_by_category to loop only items from one category.
  • Use where filters for simple item conditions.
  • Supported operators: ==, !=, >, >=, <, <=.
  • If blocks are single-level. Do not nest if blocks.
{{#items_by_category 123}}
<tr><td>{{item.name}}</td><td>{{category.id}}</td></tr>
{{/items_by_category}}

{{#items where category.id == 456}}
<tr><td>{{item.name}}</td><td>{{format_money(item.line_total, document.coin)}}</td></tr>
{{/items}}

{{#if item.discount > 0}}
  <td>{{item.discount}}</td>
{{else}}
  <td>-</td>
{{/if}}

Allowed Comparison Operators

Use these operators inside item filters and simple if conditions.

==
!=
>
>=
<
<=

Math And Money Formatting

  • Write math inside one placeholder. Do not write separate placeholders around operators.
{{item.qty * item.price}}
{{(item.qty * item.price) - item.discount}}
{{format_money(item.line_total, document.coin)}}
{{format_money(document.final_amount, document.coin)}}

Supported Math Symbols

Use formulas inside one placeholder. Do not split a formula across multiple placeholders.

+
-
*
/
%
(
)

Custom Fields

{{customer.cf_name}}
{{product.cf_color}}
{{category.cf_floor_type}}
{{customer_cf("cf-name")}}
{{product_cf("color")}}
{{category_cf("floor-type")}}

Images

  • Images are restricted to trusted Biz1 file hosts and uploaded Biz1 paths.
<img src="{{crm_logo}}" width="48" />
<img src="{{product.image}}" width="80" />
<img src="{{category.image}}" width="80" />

CSS Support

  • Templates render with browser CSS, so grid, @page, and print-friendly CSS are supported.
  • Avoid external CSS imports, JavaScript, remote fonts that may not load quickly, very large images, and fixed elements that overlap content.
@page { size: A4; margin: 10mm; }
.grid { display: grid; grid-template-columns: 1fr 120px; }
.line-card { break-inside: avoid; page-break-inside: avoid; }

Blocked For Safety

  • <script> tags are blocked.
  • <iframe>, <object>, <embed>, and <form> are blocked.
  • onclick, onload, and other JavaScript event attributes are blocked.
  • javascript: URLs are blocked.
  • PHP tags are blocked.
  • Unknown external image hosts are blocked.

Safety Restrictions

  • Templates cannot run PHP or JavaScript.
  • Do not use script, iframe, object, embed, or form tags.
  • Do not use onclick, onload, or other JavaScript event attributes.
  • Do not use javascript: URLs.
  • Use only trusted Biz1 file/upload paths for images.

Invoice Israel And Signatures

  • Invoice Israel fields are available as document/company placeholders.
  • There is currently no template placeholder for digital signatures or approval signature images.
  • Custom HTML PDFs do not currently pass through the legacy certificate-signing step.
{{document.invoice_israel_code}}
{{company.invoice_israel}}
{{company.force_tz}}
{{company.israel_default_data}}

Minimal Valid Template

Start from this HTML when creating a new template, then add design and document-specific sections.

<div class="document">
  {{footer}}
  <img src="{{logo}}" alt="Company logo" style="max-width:150px;max-height:80px" />
  <h1>{{document_type}} {{document.last_documents_id}}</h1>
  <p>Date: {{document.date_created}}</p>
  <h2>{{company.company_name}}</h2>
  <p>Company ID: {{company.company_tax_id}}</p>
  <p>{{company.company_address}}</p>
  <p>{{company.company_phone}}</p>
  <h2>Customer</h2>
  <p>{{customer.name}}</p>
  <table>
    <thead><tr><th>Item</th><th>Qty</th><th>Price</th><th>Total</th></tr></thead>
    <tbody>
      {{#items}}
      <tr><td>{{item.name}}</td><td>{{item.qty}}</td><td>{{format_money(item.price, document.coin)}}</td><td>{{format_money(item.qty * item.price, document.coin)}}</td></tr>
      {{/items}}
    </tbody>
  </table>
  <h3>Total: {{format_money(document.final_amount, document.coin)}}</h3>
  {{#if payment_link}}<p><a href="{{payment_link}}">{{payment_link_label}}</a></p>{{/if}}
  <a href="https://biz1.co.il"><img src="{{crm_logo}}" width="48" /><span>{{crm_credit}}</span></a>
</div>

Multipage Product Template Example

  • Use this pattern for proposals/orders with many product cards.
  • Put page numbers inside header/footer only.
  • Use break-inside: avoid on product cards so rows split less often across pages.
<div class="document">
  {{#header}}
  <div style="font-family:Arial;font-size:9px;width:100%">{{company.company_name}} - {{document.last_documents_id}} <span style="float:right">{{page}} / {{pages}}</span></div>
  {{/header}}
  {{#footer}}
  <div style="font-family:Arial;font-size:8px;width:100%"><a href="https://biz1.co.il">{{crm_credit}}</a> <span style="float:right">{{page}} / {{pages}}</span></div>
  {{/footer}}
  <img src="{{logo}}" alt="Company logo" style="max-width:150px;max-height:80px" />
  <h1>{{document_type}} {{document.last_documents_id}}</h1>
  <p>{{customer.name}}</p>
  {{#items}}
  <section class="line-card">
    <h2>{{item.name}}</h2>
    <p>SKU: {{item.sku}}</p>
    <p>{{item.description}}</p>
    <p>Options: {{item.options_text}}</p>
    <p>Qty: {{item.qty}}</p>
    <p>Price: {{format_money(item.price, document.coin)}}</p>
    <p>Total: {{format_money(item.qty * item.price, document.coin)}}</p>
  </section>
  {{/items}}
  <h2>Total: {{format_money(document.final_amount, document.coin)}}</h2>
</div>

<style>
.document { font-family: Arial, sans-serif; color: #17212f; }
.line-card { break-inside: avoid; page-break-inside: avoid; border: 1px solid #d8e4eb; border-radius: 8px; margin-bottom: 10px; padding: 12px; }
</style>

Troubleshooting

  • Template not used: check ownership, document_type, active status, default configuration, or pdf_template_id.
  • Missing fields error: include every required placeholder, especially {{crm_logo}} and {{crm_credit}}.
  • Payment link empty: the document must be eligible for payment/approval and the payment button must be enabled.
  • Header/footer not repeating: use header/footer tokens and keep page tokens only inside those blocks.
  • Hebrew not RTL: send document_lang=he and use CSS for .document-pdf-template-root[dir=rtl].

Common Problems

  • Template does not save: check that all required placeholders exist.
  • Create modal only shows System default: make sure the template Status is Active and matches the selected company / language / type rules.
  • Custom design not used on new documents: set Status to Active, set as default for that document type (or pick it in PDF template), and confirm invoice setting scope.
  • Payment link does not show: check that the proposal is not approved/signed, the invoice/order is unpaid, payment button is enabled, and the template uses {{#if payment_link}}...{{/if}}.
  • Page numbers do not show: put {{page}} inside {{#header}} or {{#footer}} and close the block correctly.
  • Hebrew is not aligned right: add CSS for .document-pdf-template-root[dir=rtl].
  • Product rows split badly: add break-inside: avoid and page-break-inside: avoid.
  • HTML appears as text in notes: use triple braces for prepared note fields, for example {{{document.note_html}}}.
  • Live preview empty: click Test with mock data or load a starter first.
  • Starter replaced my HTML: confirm only when you want a new sample; name/company/defaults are kept, HTML/CSS are replaced.
  • Mock PDF fails: fix validation errors from Test with mock data first, then try Download mock PDF again.

Best Practices

  • Start from a starter design or the minimal valid template.
  • Set Primary type to the document type you are designing, then choose Default for document types separately.
  • Add one section at a time.
  • Use Test with mock data and Download mock PDF after every major change.
  • Keep Status as Draft until the design looks correct, then switch to Active and set defaults.
  • Use header/footer for page numbers and Biz1 credit.
  • Keep A4 width in mind.
  • Use break-inside: avoid for product cards.
  • Keep images small.
  • Use formulas inside one placeholder.
  • Do not use JavaScript, PHP, iframes, objects, embeds, or forms.
  • For receipts and signed tax PDFs that need full legacy behavior, keep System default until those features are covered in your custom template.