Atomia Billing System

Configuring currencies

132 views 0

How to configure the currencies to be used in your Atomia platform.

Overview

Atomia supports many currencies, and the ones that are active by default are:

  • USD
  • ARS
  • PLN
  • SEK

If you are going to use a currency that is not in this list, you need to mark it as Active in the database.

Setting up available currencies

  1. The following tables need to be edited in the AtomiaBilling database to set a currency as Active or Inactive:
    • currency
    • account_details
    • reseller_configuration
    • reseller_currencies
  2. In table currency, field active needs to be set at “1” for currency to be available
    • 1 represents active currency.
    • 0 represent inactive currency.
  3. Set up field active to 1 for all currencies that you want to be available.

Changing default currencies for existing resellers and clients

  1. Set the field active to 1 in table currency for all currencies you want to be available.
  2. In the table reseller_currencies the field fk_currency_id needs to be updated to the desired currency.
  3. In the table reseller_configuration the field fk_default_currency_id needs to be updated to the desired currency.
  4. In the table account_details the field fk_default_currency_id needs to be updated to the desired currency.

Relationships between tables

  1. reseller_currencies => currency
    • fk_currency_id => id
  2. reseller_configuration => reseller_currencies
    • Reseller_configuration_id => fk_reseller_configuration_id
  3. account_details => reseller_configuration
    • Fk_reseller_configuration_id => reseller_configuration_id
  4. account_details => currency
    • Fk_default_currency_id => id

settingcurrency

Image: Relationships between tables.

Example query for SQL management studio

Important!

Make sure to use transactions when performing database commands.

  1. Update desired currencies to active.
    1. UPDATE AtomiaBilling..currency SET active = 1 where code in (‘EUR’, ‘USD’)
    2. ( For list of all available currencies and their current status: SELECT name, code, active FROM AtomiaBilling..currency )
  2. Enable currency for each reseller where it is needed.
    1. INSERT INTO AtomiaBilling..reseller_currencies
    2. SELECT r.id, c.id FROM AtomiaAccount..account a
    3. INNER JOIN AtomiaBilling..account_details d ON d.account_id = a.id
    4. INNER JOIN AtomiaBilling..reseller_configuration r on r.id = d.fk_reseller_configuration_id
    5. INNER JOIN AtomiaBilling..currency c on 1=1
    6. WHERE c.code IN (‘EUR’, ‘USD’)
    7. AND a.name IN (‘100000’, ‘100497’, ‘100617’)
  3. Define products’ prices for each new currency.

Keep in mind

Remember to replace example values from the guide with actual currency codes and resellers’ numbers.

Was this helpful?