Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

  1. In the /var/www/html/ui/config folder, edit the client-config-custom.json file 

  2. Code Block

    Create the client.dashboard.widgets.lastbills.currenciesconversionsUI property. For example, to add Australian dollars:

    1. Create a default currencyCode property first, for example AUD. On the menu, the currencies will display in the same order as the properties

    2. Add a symbol for the currency, such as $

    3. Add the conversions. First add a default conversion using the month value of default

    4. 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
            }
          ]
        }
      ]
    },
    1. On the currency selector, the currencies display in the same order as the currencyCode properties in the config file

    2. Enter a symbol for the currency, such as $

    3. Enter a value for the default conversion, with the month value of default

    4. Add other conversions for a specific month, with a value from 1 (for January) to 12 (for December) and year.

    5. If your property is the last one in the file, remove the comma (,) from the above example

  3. For each currency, in go to the ../ui/lang folder, edit the lang_xx_XX_custom.json file, and add a currency label for the currencyCode. For example, for Australian dollars in the language file for US English, which is lang_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.

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

  5. Save your files in UTF-8 format

  6. To activate your changes, reload the UI. 

  7. The platform will automatically load the new configuration, but users should delete the cache and reload the UI in their browsers.