action.skip

Configuring Liquid Templates

Configuring templates based on the Liquid template language according to your needs usually comprises the following tasks:

Note

Be aware that creating and modifying Liquid templates requires profound skills in web development techniques, in particular, Liquid template language and Cascading Style Sheets (CSS).

Creating and maintaining Liquid templates constitutes custom development. Related issues are therefore not covered by the general maintenance and support contract for JustOn.

Info

For topics beyond the scope of the usual template configuration, refer to our FAQ section PDF and Email.

For further help with template customization, contact JustOn Support.

Enabling Template Layout v2

JustOn recommends to enable the Template Layout v2 when working with templates that base on Liquid files.

  1. Navigate to the object management settings of the Template object.

    Click to open the Setup menu and select Setup, then open Objects and Fields > Object Manager > Template.

  2. Click Page Layouts.

  3. Click Page Layout Assignment, then Edit Assignment.
  4. Select the target user profile(s) in the table.
  5. From the Page Layout To Use picklist, select Template Layout v2 to be assigned.
  6. Click Save.

For details, see Assign Page Layouts from a Customize Page Layout or Record Type Page in the Salesforce Help.

Configuring Liquid Template Rendering

Preparing your templates to use the JustOn PDF service involves the following steps:

  1. Create a new template, clone an existing template, or open an existing template.
  2. In the Layout & Design section, double-click the PDF Renderer field and specify the value v2.
  3. Attach the required Liquid template files.

    In the Notes & Attachments area, click to open the action menu, select Upload Files, then proceed as prompted.

    This operation requires the custom Type field (ONB2__Type__c) to be available on the page layout of the Content Version object. For details about adding fields to page layouts, see Modifying Page Layouts or Search Layouts.

    To cover all use cases, the following Liquid templates are required:

    Liquid Template Title Used for
    Invoice Template invoices, credits, cancellations, pro forma, deposit
    Dunning Template all dunning levels
    Account Statement Template account statements

    Make sure to set the Type of the uploaded files to Liquid Template. The picklist value Liquid Template may not be available in your org. In this case, add it to the value picklist for the Type field of the Content Version object. For details, see Modifying Picklist Values.

    Example Liquid templates

    Invoice Template (English)
    Dunning Template (English)
    Account Statement Template (English)

    Swiss QR Code Invoice Template (English)
    Swiss QR Code Invoice Template (German)

  4. In the Layout & Design section, double-click the PDF Options field and specify options for the PDF output as required.

    The field value is in JSON notation and sets optional properties for the decimal, currency and percent Liquid filters.

    Property Description
    locale Sets the language code.
    currencyDisplay Defines the currency display format. Possible values include symbol, code, name.
    useDigitGrouping Toggles the digit group separator. Possible values include true or false.
    minimumFractionDigits Sets the minimum number (Integer) of decimal places.
    maximumFractionDigits Sets the maximum number (Integer) of decimal places.

    JustOn recommends to set at least the locale property. It defaults to en-EN if not set.

  5. Optionally, define a page header and footer.

    In the Header & Footer section, double-click the Page Header or Footer field and specify the information as required.

    Page header, footer and page counters must be addressed using specific CSS classes. You may use the following code as a starting point for your customization:

    • Page header

      <div class="page-header" style="width:90%; text-align:center; font-size:10pt;"></div>
      
    • Footer

      <div class="page-footer" style="width:90%; text-align:center; font-size:10pt;">
          Page <span class="pageNumber"></span> of <span class="totalPages"></span>
      </div>
      
  6. Click Save to apply your template customization.

Specifying Counter

Invoices, credits, cancellations and dunnings must have unique numbers to comply with legal regulations. In Draft status, these numbers are temporary and of no legal relevance. When setting them to Open, however, JustOn creates the unique and unalterable numbers for invoices, credits, cancellations and dunnings based on defined counters. For details, see Counters and Number Ranges.

Customizing templates therefore involves specifying the counter to be used. To do so:

  1. Open the template or template detail to be edited.
  2. In the Information section, double-click the Counter field and specify the counter as required.

    Alternatively, you can click Edit in the detail view to edit the field.

  3. Click Save.

Info

Counters defined on templates overwrite counters defined for business entities.

Specifying Default Payment Due

Depending on your business requirements, you can specify the number of days that is added to the invoice date by default in order to calculate the payment due date of the invoice. To do so, you configure the template field Default Payment Due.

  1. Open the template to be edited.
  2. In the Payment Information section, double-click the Default Payment Due field and specify the required number of days.
  3. Click Save.

Info

A default payment due set on the account takes precedence. If you have not set a default payment due on the account or the template, JustOn defaults to 0.

Configuring Payment Reference Text

Depending on your organization's requirements, you specify a string that is to be written as the payment reference for SEPA payments. To do so, you configure the template field Payment Reference.

  1. Open the template to be edited.
  2. In the Payment Information section, double-click the Payment Reference field and modify the information as required.

    Modify the default value [InvoiceNo] - [InvoiceDate] as necessary.

    You can use the placeholders that are available for the invoice context.

  3. Click Save.

Modifying Invoice Email

In addition to the fields that are printed to the PDF, the invoice template also includes texts for the email that JustOn can send to distribute the rendered PDF documents (see Distributing Invoices). These fields include:

Template Section Field Description
Email Text PDF Name Specifies the name for the generated PDF file. It can contain placeholders, the default is [InvoiceDate]_[InvoiceNo]_[AccountName].pdf. The allowed characters include the alphanumeric characters a-z A-Z 0-9 as well as the underscore _ and hyphen - characters.
Attach Files To Outgoing Email (checkbox) Controls whether attached files are included in any outgoing email.
Email File Types Defines which file types will be attached to emails (comma separated list of file extensions). For example, pdf,csv sends all PDF and CSV files; if empty (default), all files files are attached except for transaction table HTMLs.
Email Sender Defines an email sender address, must be available as an organization-wide email address.
Takes precedence over the email sender address set on the business entity.
Email Subject Defines the default email subject. Can include placeholders, like Invoice: [InvoiceNo] (default).
Email Body Defines the plain text (or HTML source code) body for the email. Can include placeholders, and line breaks are considered.
Make sure that the email text includes the placeholder [PaymentPageURL|no-persist] for the recipients to be able to access the payment page of JustOn Cash Management.
Email HTML Body Defines a rich HTML body text for the email. The editing area of this field includes an inline HTML editor.
Must not include HTML source code. If you want to use HTML source code for preparing the email body, you use the field Email Body.
Make sure that the email text includes the placeholder [PaymentPageURL|no-persist] for the recipients to be able to access the payment page of JustOn Cash Management.

Note

Be aware of the following specifics:

  • Email Body is ignored if there is content in Email HTML Body.
  • You must use either Email Body or Email HTML Body in both the template and its associated template details.
  • Email HTML Body must not include HTML source code. If you want to use HTML source code for preparing the email body, you use the field Email Body.

Info

If you send email with non-Latin data, like the Euro symbol, Hebrew, Chinese, Japanese, Russian, etc., set your email encoding to Unicode (UTF-8). For details, see Why do PDF files or emails contain garbage characters?

If you specify a company signature in the email body, consider disabling user signatures. For details, see Why do emails include two signatures?

To edit the email contents:

  1. Open the template or template detail to be edited.
  2. Click Edit.
  3. In the Email Text section, modify the fields as required.
  4. Click Save.

Info

Template text blocks can contain

  • plain text
  • placeholders
  • HTML code for tables, lists and links

If you use HTML code in template text blocks, make sure to write all code in a single line to avoid line breaks being converted to <br/> tags.

Displaying QR Codes

In order for invoice recipients to make use of QR codes to initialize payments, the printed invoices must include the QR codes. To this end, you must configure the relevant invoice template accordingly.

To prepare a template that uses the JustOn PDF service to include SCT QR codes:

  1. Prepare a template to use Liquid templates and the JustOn PDF service.

    For details, see Configuring Liquid Template Rendering.

  2. In the attached Liquid template file for invoices (most likely, Invoice template.liquid), add the tag for embedding the produced QR code image in an appropriate section.

    Use the following code:

    <img class="qrcode-payment" src="{{QrCode.DataURI}}">
    

    For details on working with Liquid files, see Working With Liquid Code.

  3. In the Add QR Code field of the template, select SCT QR Code.

  4. Optionally, specify options for the PDF output or define a page header and footer as required.
  5. Click Save.