Enabling Local Currency Display
← Setting Up Billing Automation
International business relations may require dealing with multiple currencies. Now if the invoice currency differs from their local currency, some countries demand issuing invoices that additionally display the invoice amounts in the local currency.
You can configure JustOn to display local currency amounts for invoices to be sent to buyers in these countries. This usually involves
- Creating local currency fields on the Invoice object
- Applying custom placeholders
- Displaying local currency table
- Adjusting the tax breakdown table
Creating Local Currency Fields
In order to hold the required local currency data, you must add new custom fields to the Invoice object.
- Navigate to the fields list of the Invoice object.
-
Create the following new fields as required.
Field Label API Name Data Type Description Local Currency Code LocalCurrencyCode Text (3)
Formula (Text)
PicklistThe ISO currency code.
Use the field type that best matches your business requirements.Local Currency Factor LocalCurrencyFactor Number (14,4) The factor to be multiplied with the invoice currency to calculate the local currency. Local Grand Total LocalGrandTotal Number (16,2) The grand total in the local currency. Local Total Net LocalTotalNet Number (16,2) The total net in the local currency. Local Total Tax LocalTotalTax Number (16,2) The total tax in the local currency. For help about creating fields, see Managing Object Fields.
The field Local Currency Code
must be set during the invoice creation. To this end, you can make use of the ON field mechanism - setting an ON_LocalCurrencyCode
field on the account or subscription.
The other four fields are set
- during the invoice creation, when the invoice has an invoice date,
- during the invoice finalization.
Info
If you want the fields to be copied when cloning or canceling invoices, add them to the custom setting Copy Additional Fields.
Applying Custom Placeholders
You can incorporate local currency data into your invoice text fields. To facilitate this, you can use the following custom placeholders:
Name | Source | Field | Render as |
---|---|---|---|
LocalCurrencyFactor | Invoice | LocalCurrencyFactor__c | NUMBER |
LocalGrandTotal | Invoice | LocalGrandTotal__c | LOCALAMOUNT |
LocalTotalNet | Invoice | LocalTotalNet__c | LOCALAMOUNT |
LocalTotalTax | Invoice | LocalTotalTax__c | LOCALAMOUNT |
In case you want to incorporate currency codes, you must create the following new custom placeholders:
Name | Source | Field | Render as |
---|---|---|---|
CurrencyISOCode | Invoice | CurrencyISOCode | TEXT |
LocalCurrencyCode | Invoice | LocalCurrencyCode__c | TEXT |
Displaying Local Currency Table
You can display the local currency in a separate table, for example, below the invoice line item table. To do so, you
- Add the HTML code for the local currency table into the
Text 2
field (see PDF Contents), and - Place the CSS code to style your table into the
Custom CSS
field.
Assume you want a borderless, right-aligned table that displays the net total, the tax and the grand total in the local currency next to the invoice currency, as well as a new line that tells the used currency factor:
Local Currency (EUR) | Invoice Currency (USD) | |
---|---|---|
Total Net | € 3448,00 | $ 4000,00 |
Tax (0%) | € 0,00 | $ 0,00 |
Grand Total | € 3448,00 | $ 4000,00 |
Local currency factor: 0,862 |
Enabling Local Currency Table
To display the local currency table as outlined in the example, you can use the following HTML code:
<table class="localCurrencyTable"><tr><th></th><th>Local Currency ([LocalCurrencyCode])</th><th>Billing Currency ([CurrencyISOCode])</th></tr><tr><td><b>Total Net</b></td><td>[LocalTotalNet]</td><td>[TotalNet]</td></tr><tr><td><b>Total Tax ([TaxRate])</b></td><td>[LocalTotalTax]</td><td>[TotalTax]</td></tr><tr><td><b>Grand Total</b></td><td>[LocalGrandTotal]</td><td>[GrandTotal]</td></tr><tr><td colspan="3">Local currency factor: [LocalCurrencyFactor]</td></tr></table>
- Open the template to be edited.
-
In the Texts section, click next to the
Text 2
field and add the HTML code for the table as required.Alternatively, you can click Edit in the detail view to edit the field.
-
Click Save.
Info
As explained in Editing Standard Text Blocks, the HTML code must be all in a single line to avoid line breaks being converted to <br/>
tags.
Styling Local Currency Table
Following the example, you want the local currency table to be printed as a borderless, right-aligned table, using a small font size. To this end, you can apply these CSS rules:
.localCurrencyTable {
width: 80%;
margin-left: 20%;
font-size: 8pt;
text-align: right;
th {padding-left: 10px;}
th :first {padding-left: none;}
}
- Open the template to be edited.
-
In the Layout & Design section, click next to the
Custom CSS
field and specify the CSS code as required.Alternatively, you can click Edit in the detail view to edit the field.
-
Click Save.
Adjusting Tax Breakdown Table
To display the local currency amounts, add the field LocalAmount
to the tax table columns.
- Open the template to be edited.
- Click Edit in the detail view.
-
Modify the value for
Tax Table Columns
as required.To add the local currency amount, specify
Name;AppliedTaxRule__c;Rate__c;Amount__c;LocalAmount
-
Click Save.
Info
Before using the tax breakdown table, you may have to add the corresponding fields to the template layout. For details, see Displaying Tax Breakdown Table.