How to move the discount message?
JustOn supports cash discounts, a discount type that temporarily reduces the grand total of the invoice. For details, see Cash Discount.
Classic templates
This answer applies to classic templates. On a standard template, the Liquid file places the discount message; the Discount Message field only supplies its text.
By default, JustOn prints the discount message (an information you can define to notify your customers about a cash discount) below the Text 3 block. Your business may, however, require to display this message within one of the other text blocks of the invoice PDF. To this end, you can configure a dedicated discount message placeholder.
Setting up the discount message placeholder involves these tasks:
- Creating a helper field on the Invoice object
- Creating the discount message placeholder and two helper placeholders
- Hiding the standard discount message
Once set up accordingly, you can use the [DiscountMessage] placeholder in any invoice text field. It displays the defined discount message if the discount rate field is not empty or the DiscountMessage__c field is set.
Creating Helper Field
Create a field for a helper placeholder on the Invoice object.
| API Name | Type | Formula |
|---|---|---|
| DraftDiscountMessage | Formula (Text) | IF(ISBLANK(ONB2__DiscountRate__c),'','[TemplateDiscountMessage]') |
For help about creating fields, see Managing Object Fields.
Creating Placeholders
Create the discount message placeholder and two helper placeholders.
| Placeholder Field | Discount Message Placeholder | Draft Discount Message Placeholder | Template Discount Message Placeholder |
|---|---|---|---|
| Name | DiscountMessage | DraftDiscountMessage | TemplateDiscountMessage |
| Fallback if fields empty | DiscountMessage__c | ||
| Fallback rule | DraftDiscountMessage | ||
| Render as | TEXT | TEXT | TEXT |
| Field | DiscountMessage__c | DraftDiscountMessage__c | DiscountMessage__c |
| Source | Invoice | Invoice | Template__c |
For help about creating placeholders, see Custom Placeholders.
Hiding Standard Discount Message
Add a CSS rule to your template in order to hide the standard discount message block.
.c8 .block_5 {
display: none;
}
For help about specifying CSS rules, see Modifying Classic Template CSS.