Currency is not getting captured properly

praveshgupta_pg
Tera Contributor

Hi Team,

I have added a new currency under "Currencies" in System Localization as below:

find_real_file.png

The field and choices relevant to cost on Asset is working fine. I am trying to export the data with cost value included and is working fine in Excel sheet, however under PDF export $ is getting captured instead of â‚¹.

Please advise on this part.

 

Regards,

Pravesh Gupta

3 REPLIES 3

scott barnard1
Kilo Sage

 

Hi

What is the value of your locale property?

sys_properties.list and a name of glide.system.locale

Check out the currency instances table - fx_currency_instance to make sure that there is conversion taking place. 

 

In general, currency values crossing the boundaries of the platform are represented in the user’s session currency and formatted in the user’s locale.

Import

Currency values are imported as strings just like other fields. The default transform mapping to a currency field uses setDisplayValue(). The expected format for this function is:
  • A number formatted in the user’s locale: this is taken as a value in the user's session currency, for example, 1,234.56.
  • The number prefixed by the three-letter currency code separated by a semicolon, for example, EUR;1.234,56.

This behavior can be customized in transform map scripts.

Export

Currency values are exported in the user’s session currency formatted in the user’s locale except when exporting as XML. When exporting currency in XML, the value is in the reference currency value with no formatting.

 

Check out the currency instances table - fx_currency_instance

filter by table and use Asset (alm_asset)

You should see a record with your pairs. 

Each record would carry entries for the reference currency and currency of input

Check a record and see if the Reference currency, I'm expecting it to be USD, is correctly calculated.

 

The you are onto session currency and locale

 

The system uses two kinds of currency, session and reference.

The session currency is defined for the user by the user’s locale or single-currency mode. The reference currency is determined by the system locale. The reference currency is a standard used across the entire instance. Each time a value is entered in a currency or price field, the system stores three pieces of information:
  • The value as entered, in the user's locale.
  • The currency code, in the user's locale.
  • The value converted to the reference currency using the current exchange rate.
Note: In multiple-currency mode, the currency code saved in currency field may not be the same as the session currency code. For example, the session currency could be the Euro and the number entered could be the Japanese Yen.

Session currency

When users view a currency value, they can see the value as entered or in the session-currency format. The format contains:
  • The currency symbol
  • The value converted to the session currency and shown in a localized number format.
The user’s locale determines the session currency format.
The number format can differ in features such as the decimal separator based on the locale; for example, the US formatting is 1,234,567.89 while German formatting is 1.234.567,89. The session currency is determined by the following, in order of consideration:
  • Single-currency mode setup using glide.i18n.single_currency and glide.i18n.single_currency.code.
  • The default currency for the user’s locale.

Reference currency

In order to perform calculations on heterogeneous currency values, the platform stores currency values converted to a system currency, referred to as the reference currency. Every currency field in the system contains a reference currency value. The reference currency is determined by the following, in order of consideration:
  • The system locale set using the property glide.system.locale
  • The Java default locale, typically en.US

The filtering and aggregation features use the reference currency value to perform calculations on default currency fields. This can yield inaccurate results because of conversion rate changes.

Issues with currency fields

Users are often confused by the results of filtering, sorting, and displaying currency fields because the system works with at least two currencies for each value: the session currency and the reference currency.

Note: Aggregations and filtering of currency fields use the reference currency, and the user sees the session currency. Because of changing conversion rates, the filtered reference currency values might not result in the same order as the session currency values would suggest. The same issue happens with aggregations.
The user might see the following issues:
  • Lists filtered on currency fields might not be in the expected order because the reference currency values are used for filtering but session currency values are displayed.
  • Aggregation of currency fields might not produce the expected results because reference currency values are aggregated and then converted to the session currency.
  • Currency values might not be formatted as expected because currency values are formatted based on the user's locale and not on the currency code

The confusion is caused by the difference between session and reference currencies, changing conversion rates, and different session currencies used by different users.

 

and locale 

 

here are two locale settings, system and user. The system locale determines the reference currency, and the user locale determines the session currency.

System locale

The system locale is set using the glide.system.locale property. The value is in the format Language.Country, where the language is an ISO 639 language code and the country is an ISO 3166 language code. Internally, this value is used as specified by Java. The system locale setting should be in the Java supported locales list. The system locale should be set once on a fresh zboot because reference currency values in currency fields are assumed to be in the currency implied by the system locale. To set this property, see Currency system properties.

Note: Do not change the system locale after currency values have been entered into the instance. When you change the system locale, the reference currency values are not adjusted. There is no rate conversion. This persistence results in invalid aggregations and filtering.

User locale

The user locale is determined by the following, in order of consideration.
  • User record in which both country and language are specified.
  • System locale set using the glide.system.locale property.
  • Browser locale.

Amounts in currency fields are composed of a currency code and amount. Amounts are always shown in the session currency and are formatted in the Java-specified format for the user locale.

Hi Scott,

 

Below are the relevant value details:

 

find_real_file.png

find_real_file.png

 

Regards,

Pravesh Gupta

They look normal, so nothing strange there.

Is it different people doing the exports? Just wondering what the context of the export is.

My fear here is that you have an issue between location, currency and your browsers view of your "locale". Basically in the client view it's trying to find your locale and setting a session currency based on it but it's failing first time but working with a precedence override. When you are no longer in that browser context and you ask it to export a call is made to the back end to do the export and it's looking at your base user data and saying, don't know, can't find so send the system default reference currency that is USD.

 

So need to check what your user record language is, also the country code and any location as locations have a language associated with it.

 

 

 

 

 

If all of those line up I would be tempted to raise a hi ticket