Configure billing dashboard currency conversions

On the billing dashboard widgets, the platform can convert between currencies for the display of the latest bills.

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:

  1. In the /var/www/html/ui/config folder, edit the client-config-custom.json file 
  2. Create the client.dashboard.widgets.lastbills.currenciesconversions UI 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, for example "$"
    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.

    {
      "currencyCode": "AUD",
      "symbol": "$",
      "conversions": [
        {
          "currencyCode": "EUR",
          "values": [
            {
              "month": "default",
              "value": 1.6
            },
            {
              "month": 12,
              "year": 2019,
              "value": 1.4
            }
          ]
        }
      ]
    }
  3. For each currency, in 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.

    "dashboard.lastbills.label.currency.AUD":"Aust. Dollar",

    Remember that the labels file 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.

Copyright © 2006-2022, Abiquo Holdings SL. All rights reserved