On the billing dashboard widgets, the platform can convert between currencies for the display of the latest bills.
Info |
---|
This page describes how to add currencies and set rates for the platform to convert between them to the last bills widget on the dashboard. To add currencies to the platform, create them in pricing view |
The user can select currencies from the pulldown menu at the top right of a widget.
...
To set a currency and the rates to convert to this currency :do these steps.
In the
/var/www/html/ui/config
folder, edit theclient-config-custom.json
fileCode Block Create the
client.dashboard.widgets.lastbills.currenciesconversions
UI property. For example, to add Australian dollars:Create a default currencyCode property first, for example "AUD". On the menu, the currencies will display in the same order as the properties
Add a symbol for the currency, for example "$"
Add the conversions. First add a default conversion using the month value of "default"
Then add any other conversions for a specific month, with a value from 1 (for January) to 12 (for December). You must also include the year value.
In the following example, for May 2020, the platform will multiply the value in Euros by 1.6 to give the value in Australian dollars.
You can copy this example that will add a conversion to Australian dollars from Euros. The platform will do this calculation:
inner value (EUR) * conversion rate = outer value (AUD).Code Block client.dashboard.widgets.lastbills.currenciesconversions: { "currencyCode": "AUD", "symbol": "$", "conversions": [ { "currencyCode": "EUR", "values": [ { "month": "default", "value": 1.6 }, { "month": 12, "year": 2019, "value": 1.4 } ] } ] },
On the currency selector, the currencies display in the same order as the
currencyCode
properties in the config fileEnter a
symbol
for the currency, such as$
Enter a value for the
default
conversion, with themonth
value ofdefault
Add other conversions for a specific
month
, with a value from1
(for January) to12
(for December) andyear
.If your property is the last one in the file, remove the comma (
,
) from the above example
For each currency, in go to the
../ui/lang
folder, edit thelang_xx_XX_custom.json
file, and add a currency label for thecurrencyCode
. For example, for Australian dollars in the language file for US English, which islang_en_US_custom.json
, add the following label.Code Block "dashboard.lastbills.label.currency.AUD":"Aust. Dollar",
Remember that the labels file files must always end with the "
__EOF
" label.Check all your JSON files as always because the UI will not load with an invalid configuration. Check there are no commas after the last entry in the file, and that there are no missing commas between entries.
Save your files in
UTF-8
formatTo activate your changes, reload the UI.
The platform will automatically load the new configuration, but users should delete the cache and reload the UI in their browsers.