Configuration and Settings
The default currency settings could be configured based the following:
-
Company-Hdr
-
Company settings in organization applet
-
-
Branch-Hdr
-
Default branch in applet settings
-
Default branch in personal settings within an applet
-
Branch settings in organization applet
-
-
FI-Item-Hdr
-
Entity-Hdr
-
Website-Hdr
-
Ledger-Hdr
So, the question is, which currency should take precedence, when we are creating a financial document (be it Sales Invoice, Purchase Order, or any other financial transaction)? Should we follow the "FI-Item-Hdr" currency, or should we follow the customer’s default currency?
The short answer
When in doubt, follow the currency setting for the branch in the organization applet ! |
The next natural questions that pops up would be, why? why would the branch currency setting take precedence?
We cannot use the "Company-Hdr" currency setting to overwrite the branch setting, because it is possible for a company to have multiple branches, with some branches operating at certain location that defaults to a different currency.
We are not using the FI-Item-Hdr’s currency because when a financial document is issued, strictly speaking, we will only allow users to choose a list of fi-items where the currency of the fi-items are the same as the currency has been initialized (wen a branch is chosen). This initialization happens before a product is chosen, selecting the branch is one of the first thing that happens on a screen for the users of the applets.
We are also not using the currency set in the "Entity’s Hdr" because the currency configuration for the Entity Hdr is just the "preferred currency" for a specific customer or suppliers. In real life situation, it is possible for these entities to transaction in multiple currencies, not just the "preferred currency" configured in the entity-hdr.
Selling the same products in multiple currencies
In Akaun Platform, we have the following:
* FI-Item (stored in bl_fi_mst_item_hdr/line/ext) |
When we are storing the currency information into the following tables, we need to follow the following conventions:
Assuming we issue two sales, one in local currency (MYR) and the other one in foreign currency (USD). And we have configured the company default currency to be in MYR.
Column name | Data Type | Description | Local Currency Invoice (MYR) | Foreign Currency Invoice (USD) |
---|---|---|---|---|
foreign_ccy |
boolean |
This is to identify whether the record is in foreign currency amount. If this is true, refer to base_doc_guid to identify record in base currency |
false |
true |
base_doc_guid |
UUID |
If this is a foreign currency document, this will be a foreign key pointing to bl_fi_generic_doc_hdr.guid of the Generic Doc Hdr in base currency |
Null |
guid ⇒ foreign key pointing to base document |
base_doc_ccy |
varchar(3) |
This is the based currency, following the company settings ⇒ default currency |
MYR |
MYR |
base_doc_xrate |
numeric(70,22) |
This value is calculated based on base_doc_amount / foreign_doc_amount |
1 (strictly speaking, this can be null, because the document is already in local currency) |
4.4 (assuming USD-MYR exchange rate is 4.4) |
doc_ccy |
varchar(3) |
This is the document currency |
MYR |
USD |
Column name | Data Type | Description | Local Currency Invoice (MYR) | Foreign Currency Invoice (USD) |
---|---|---|---|---|
foreign_ccy |
boolean |
This is to identify whether the record is in foreign currency amount. If this is true, refer to base_doc_guid to identify record in base currency |
false |
true |
base_doc_line_guid |
UUID |
If this is a foreign currency document, this will be a foreign key pointing to bl_fi_generic_doc_line.guid of the Generic Doc Line in base currency |
Null |
guid ⇒ foreign key pointing to base document |
base_doc_line_ccy |
varchar(3) |
This is the based currency, following the company settings ⇒ default currency |
MYR |
MYR |
base_doc_line_xrate |
numeric(70,22) |
This value is calculated based on base_doc_amount / foreign_doc_amount |
1 (strictly speaking, this can be null, because the document is already in local currency) |
4.4 (assuming USD-MYR exchange rate is 4.4) |
doc_ccy |
varchar(3) |
This is the document currency |
MYR |
USD |