Skip to content

Template v1 Basic Setup

Configuring templates v1 according to your needs usually comprises the following tasks:

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.

Creating New Template

Info

JustOn recommends to create one or more custom templates and to leave the default template untouched.

To cover multiple targets, like different locales or specific customer groups, you need to create new templates. To do so:

  1. Open the Templates tab.
  2. Click New.
  3. Specify at least the template name and the template language.

    You can edit the other information later as required.

  4. Click Save.

    This generates the new template, copying the contents of the default template.

Info

Alternatively, you can also clone an existing template.

Populating Common Template Fields

Usually, your organization has defined a layout model for printed documents. When customizing a template, you must provide information to fields (text blocks) that are empty by default in order to comply with your organization's design specifications. Common header and footer fields to be populated with your custom information include

  • Header
  • Sender Address
  • Footer

For an overview of other fields that are to be filled, their placement etc., see Template Structure and Building Blocks.

To edit header and footer:

  1. Open the template to be edited.
  2. In the Header & Footer section, double-click the Header, Sender Address or Footer field and specify the information as required.

    Alternatively, you can click Edit in the detail view and edit all fields at once.

  3. Click Save.

Info

Template text blocks can contain

  • plain text
  • placeholders
  • HTML code for tables, lists, links, etc.

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.

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 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.

Editing Standard Text Blocks

In the main content area, the template includes three generic text blocks that you can use for any running text to be rendered in the final document.

  • Text 1: Text to be rendered above the invoice line item table, can be used, for example, to edit a letter-like text introducing the invoice that follows.
  • Text 2: Text to be rendered below the invoice line item table, can be used, for example, to add payment terms.
  • Text 3: Additional text to be rendered below the Text 2 block.

To edit the generic text blocks:

  1. Open the template to be edited.
  2. In the Texts section, double-click the Text 1, Text 2 or Text 3 field and specify the information as required.

    Alternatively, you can click Edit in the detail view and edit all fields at once.

  3. Click Save.

Info

Template text blocks can contain

  • plain text
  • placeholders
  • HTML code for tables, lists, links, etc.

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.

Adjusting Invoice Line Item Table

The Table Columns field determines the contents of the line item table on the printed invoice. This field contains a list of invoice line item fields, separated by semicolon, which determines the visible table columns and their sequence.

If the Table Columns field is left blank, JustOn defaults to the following setting:

PosNo;Title__c+Description__c;UnitPriceCalc__c;Quantity__c+Unit__c;TaxRate__c;PosTotalNet__c

This produces the following invoice line item information:

  • Position number
  • Item title and description
  • Calculated item price (the unit price multiplied with the commission, if defined)
  • Item quantity
  • Tax rate
  • Item net total

Depending on your organization's requirements, you must remove columns you do not need or add new columns.

  1. Open the template to be edited.
  2. In the Information section, double-click the Table Columns field and specify the information as required.

    You can use any invoice line item field. Note that the specified order defines the column sequence.

    To not break the table layout, you must include at least four columns.

  3. Click Save.

To remove, for example, the item description, quantity unit and tax rate and to show the billing factor and an applicable item discount, type the following line in the Table Columns field:

PosNo;Title__c;UnitPriceNet__c;Quantity__c;BillingFactor__c;Discount__c;PosTotalNet__c

Info

The discount/discount amount columns are conditional. That is, JustOn hides these columns if there is no discount defined.

If you still need the discount column - and display 0 if there is no discount - on the printed invoice:

  1. Create a custom field on the invoice line item that retrieves the original discount value.
  2. Include this field in the table configuration.

Adjusting Invoice Formatting

The invoice template defines display formats for date and time display as well as currency and number display.

Field Description
Use Unicode Font (checkbox) Specifies whether to use the font Arial Unicode for the text rendering, which allows for printing virtually any character of any language.
Using the Unicode font impedes bold and italic text formatting.
Date Format Specifies the format for all date fields of the invoice.
For details about supported date and time formats, refer to the Simple Date Format syntax in the Java Documentation.
Month Format Specifies the format for the [LastMonth], [CurrentMonth] and [NextMonth] placeholders.
Time Format Specifies the format for displaying time values.
For details about supported date and time formats, refer to the Simple Date Format syntax in the Java Documentation.
Leading Currency (checkbox) Controls whether the currency sign (like $ or €) is displayed before (checked) or after (unchecked) the value.
Decimal Separator Specifies the decimal separator for all number fields like currency values or percentage values.
Grouping Separator Specifies the grouping separator for all number fields like currency values.

Note

Selecting or changing the template language does not modify the (region-specific) formatting settings.

Depending on your organization's localization requirements, you must adjust the display of date, time, currency or number values. To do so:

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

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 emails contain garbage characters?.

Usually, your organization has defined a layout model for printed documents. As this model most certainly includes a company logo, you have to add an image file and configure its display when customizing your template.

Info

When attaching an image file as your organization's logo, consider that the recommended file format is PNG and that the file size should not exceed 30 kB in order to keep the resulting PDF file size manageable.

Adding Image File

You can add image files to your template. As of JustOn 2.58, images are loaded from Salesforce Files.

Note

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.

  1. Open the template to be edited.
  2. In the Notes & Attachments area, click to open the action menu, then select Upload Files.
  3. Select the intended file using your browser's file selection dialog.

    This uploads the selected file.

  4. Click Done.

    This displays the uploaded file in the Notes & Attachments area.

  5. Open the Details page of the uploaded file.

    From the Preview, click to open the action menu, then select View File Details.

    From the Notes & Attachments list, click next to the file record, then select View File Details.

  6. Open the Details sub-tab.

  7. Double-click the Type field, then select Template Logo.

    The picklist value Template Logo 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.

  8. Click Save.

    Invoice PDF files generated from the current template will now include the selected image file as the logo.

Handling Multiple Images

You can add multiple image files as attachments to your template. There are two ways to specify the image attachment to be used as the company logo:

  • JustOn uses the first image file found as the logo. Available image files must be of the type Template Logo.
  • Use the placeholder [img|byid:<CONTENTDOCUMENTID>] in the header text (see Populating Required Template Fields). Replace <CONTENTDOCUMENTID> with the Salesforce record ID of the image file. Find the file record ID in the URL of the file's Details page.

    Using this placeholder allows for including other image file attachments in other text fields, if necessary.

Configuring Image Display

Generally, the layout, styling, positioning of the template building blocks is controlled using CSS, see Template CSS.

By default, the company logo is rendered unscaled on top of the page and aligned with the left margin. Depending on your organization's requirements, you must adjust the image display, like changing the display size or aligning the image with the right margin.

To adjust the image display, you have to provide custom CSS rules. To do so:

  1. Open the template to be edited.
  2. In the Layout & Design section, double-click the Custom CSS field and specify the CSS code as required.

    Following the mentioned examples, you can use this CSS to resize the image:

    • Using a percentage value:
      .logo {width: 60%}
      
    • Using an absolute value:
      .logo {width: 3cm}
      

    To align the image, you can use this CSS:

    • Aligning the logo with the right margin:
      .c1 .block_0 {
          width: 100%;
          text-align: right;
      }
      
    • Centering the logo:
      .c1 .block_0 {
          width: 100%;
          text-align: center;
      }
      
  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.
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. Note that this address must be available as an organization-wide email address.
Email Subject Defines the default email subject. Can include placeholders, like Invoice: [InvoiceNo] (default).
Email Body Defines the plain text body for the email. Can include placeholders, and line breaks are considered.
Make sure that the email text includes the placeholder [InvoiceLink] (up to JustOn 2.48) or [PaymentLink] (as of JustOn 2.49) for the recipients to be able to access the invoice page or, respectively, the payment page of the JustOn Self-Service Extension.
Email HTML Body Defines a rich HTML body text for the email. The editing area of this field includes an inline HTML editor.
Make sure that the email text includes the placeholder [InvoiceLink] (up to JustOn 2.48) or [PaymentLink] (as of JustOn 2.49) for the recipients to be able to access the invoice page or, respectively, the payment page of the JustOn Self-Service Extension.

Note

Email Body is ignored if there is content in Email HTML 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?.

To edit the email contents:

  1. Open the template 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, links, etc.

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.