action.skip

Default Template

Templates define the content and layout model for generating the PDF copy of invoices, dunning reminders or account statements. JustOn provides a default template – named Default – (as well as the associated template details), which serves two main purposes:

  • You use it as a model or reference when defining your own templates according to your use cases and corporate identity,
  • JustOn uses it as a fallback in case the system cannot retrieve any of your configured templates.

Be aware that the default template is not the one you want to be used by default. To predefine a specific template for your standard use cases, you usually set it via the ON field ON_Template on your source records for the invoice generation.

What is a template?

The template is the model based on which the PDF copy of an invoice, dunning reminder or account statement is rendered. It defines its contents and layout. Produced PDF documents are intended to be distributed via email or postal service to customers, and can be exported and archived.

template
Combining data with a template to produce an output

In addition to the fields that are printed to the PDF, the templates also include texts for the email that JustOn sends to distribute the rendered PDF documents.

This article outlines the structure and building blocks of the default template to illustrate their concepts and behavior. Use this description as a reference when configuring your own templates and template details.

Related information:

Basic Setup
Advanced Options
Configuring Template Details

Template Structure and Building Blocks

The template is composed of a number of pre-defined containers that represent specific areas of the page – the header, footer, the invoice line item table, etc. Each container comprises text blocks that define the actual content displayed in the final document. For example, the header container contains text blocks for including addresses for sender and recipient, a company logo, and other invoice details.

Text blocks can include placeholders. These are symbols for fields of Salesforce or JustOn objects (like address fields or payment data), which are to be replaced with actual values upon PDF rendering.

PDF Contents

The following graphic illustrates the commonly used template building blocks and their (default) position. Using custom CSS (see CSS Rules), you can adjust the positioning, layout, etc. according to your needs.

invoicepdf

Position Template Field Description
1 Notes & Attachments The image file attachment set as the company logo to be rendered within the header
Page Header Is displayed at the top of each page (except for the first one) and can be used to display a page counter.
2 Header Defines the header area printed on top of the first page of an invoice. Commonly used for including a company logo, contact information and other invoice details, like a customer account number.
3 Sender Address Defines an area for printing the sender's address, usually positioned above the recipient's address.
4 Recipient Address Defines the area for printing the recipient's address. Using placeholders, you specify the address information to be printed.
Billing Address Defines an area for printing the billing address, which is printed if it differs from the recipient's address.
5 Display Type Specifies the type of the invoice to be printed to the PDF, like Invoice, Credit Memo, Reminder.
6
7
Info Left
Info Right
Define areas for printing a page counter (hidden on the first page of the PDF document), the invoice number and the invoice date above the actual invoice text.
8 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.
9 Table Columns Defines the columns for the invoice line item table. The definition must be a list of invoice line item field names separated by semicolons. A column can display the concatenated values of multiple item fields. To concatenate fields, use the plus sign.
The default definition, which is used when the field is left blank, is:
PosNo;Title+Description;Quantity+Unit;UnitPriceNet;Discount;PosTotalNet;
Subtotal (net) Label Defines the display of the subtotal (net) information, which is rendered as part of the invoice calculation below invoice line item table. Can contain placeholders, like Subtotal [ProductGroup].
If empty, defaults to the custom label SubTotalNet.
Subtotal (gross) Label Defines the display of the subtotal (gross) information, which is rendered as part of the invoice calculation below invoice line item table. Can contain placeholders, like Subtotal [ProductGroup] (gross).
If empty, defaults to the custom label SubTotalGross.
Subtotal Without Discount (net) Label When showing the order discount, defines the display of the subtotal (net) information without discount, which is rendered as part of the invoice calculation below invoice line item table. Can contain placeholders, like Subtotal [ProductGroup] (net).
If empty, defaults to the custom label SubTotalNetNoDiscount.
Subtotal Discounted (net) Label When showing the order discount, defines the display of the discounted subtotal (net) information, which is rendered as part of the invoice calculation below invoice line item table. Can contain placeholders, like Subtotal discounted [ProductGroup] (net).
If empty, defaults to the custom label SubTotalNetDiscounted.
Order Discount Label When showing the order discount, defines the display of the order discount information, which is rendered as part of the invoice calculation below invoice line item table. Can contain placeholders, like Discount [ProductGroup] ([OrderDiscount]).
If empty, defaults to the custom label SubTotalAEDiscount.
10 Tax Label Defines the display of the tax rate information, which is rendered as part of the invoice calculation below invoice line item table. The placeholder [TaxRate] is replaced by the actual value, like 7%.
11 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.
Reverse Charge Text Text displayed as reverse charge notice
12 Footer Defines an area for a running footer printed on the bottom of each page of the invoice. May contain information such as the sender's address details, bank account details, and other contact information, like phone numbers, email addresses, links to web sites, etc.

The template detail/template edit view may show the fields in a different display order, grouped by sections. If required, you can adjust the page display according to your needs (see Managing Page Layouts).

Info

The template includes fields that are involved in a number of specific use cases, which are explained in their corresponding documentation.

Email Contents

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 Emailing Invoice PDF Documents). 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?

CSS Rules

The layout, styling, positioning of the template building blocks is controlled using CSS rules. JustOn defines a default set of CSS rules, which are part of the Visualforce page DefaultInvoiceStructure. To view it, change to Setup and navigate to Custom Code > Visualforce Pages > DefaultInvoiceStructure > Preview > CSS.

According to your organization's requirements, you must adjust the default CSS using custom CSS rules. Doing so, you can modify

  • the page size of the resulting PDF document
  • margins for containers and text blocks
  • the look and feel of the invoice line item table, like border properties
  • font attributes of text elements like text size, color, etc.
div containers of commonly used building blocks

The following table lists the div containers that include the commonly used building blocks as listed in PDF Contents.

div Container PDF Contents
page-header page header
page-footer footer
c1 header incl. logo
c2 billing address
c3 recipient address
sender address
c4 display type
c5 info left
info right
c6 text 1
c7 invoice line item table
c8 text 2
text 3
c9 transaction records
c10 outstanding invoices table
c11 tax table

For information about identifying the actual CSS class to modify, refer to Accessing Template Debug Mode.