HOWTO set currency ACTIVE or INACTIVE and to set default currency
Important tables in database AtomiaBilling for setting currency ACTIVE or INACTIVE:
-
currency
-
account_details
-
reseller_configuration
-
reseller_currencies
SET UP AVAILABLE CURRENCIES:
-
In table currency, field “active” needs to be set at “1” for currency to be available
-
1 represents active currency
-
0 represent inactive currency
-
Set up field “active” to 1 for all currencies that you wanna be available.
Changing default currencies for EXISTING RESELLERS and CLIENTS
-
Set up in table “currency” field “active” to 1 for currencies that you want to be available
-
In table resseler_currencies field fk_currency_id needs to be updated to desired currency
-
In table resseler_configuration field fk_default_currency_id needs to be updated to desired currency
-
In table account_details field fk_default_currency_id needs to be updated to desired currency
Relationships between tables:
-
resseler_currencies =>currency
-
fk_currency_id => id
-
resseler_configuration =>resseler_currencies
-
Resseler_configuration_id => fk_resseler_configuration_id
-
account_details =>resseler_configuration
-
Fk_resseler_configuration_id => resseler_configuration_id
-
account_details =>currency
- Fk_default_currency_id => id
EXAMPLE QUERY FOR SQL MANAGEMENT STUDIO:
WARNING: Make sure to use transactions when performing database commands.
-
Update desired currencies to 'active'
UPDATE AtomiaBilling..currency SET active = 1 where code in ('EUR', 'USD')
( For list of all available currencies and their current status: SELECT name, code, active FROM AtomiaBilling..currency )
-
Enable currency for each reseller where it is needed
INSERT INTO AtomiaBilling..reseller_currencies
SELECT r.id, c.id FROM AtomiaAccount..account a
INNER JOIN AtomiaBilling..account_details d ON d.account_id = a.id
INNER JOIN AtomiaBilling..reseller_configuration r on r.id = d.fk_reseller_configuration_id
INNER JOIN AtomiaBilling..currency c on 1=1
WHERE c.code IN ('EUR', 'USD')
AND a.name IN ('100000', '100497', '100617')
-
Define products' prices for each new currency
Do not forget to replace example values from the guide with actual currency codes and resellers' numbers.
For more information you can always contact Atomia’s friendly support team.