Skip to content

Default 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. The produced PDF document is intended to be distributed via email or postal service to customers, and it can be exported and archived. JustOn provides default templates, based on which you can define your own templates.

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

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.

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

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

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