Globalization Support
-
All numeric fields will be displayed and validated using locale, currency code and precision settings.
-
Rules for which locale, currency code and precision established and explained below
Globalization Rules
There are two locations where globalization settings for the locale, currency code and precision (fractional digits) are defined:
-
- The config/custom.config.ini file.
- The Settings, Inv Prefs options that are stored in the si_preferences database table.
Where an invoice association can be established, the Inv Prefs settings for the invoice type (ex: INVOICE vs QUOTE vs ESTIMATE, etc.), those preferences are used. All numeric values that cannot be associated with an invoice will use the values from the config/custom.config.ini file.
Examples of value that use config/custom.config.ini settings are:
- Expenses that are not assigned to an Invoice
- Inventory
- Payment warehouse records*
- Products
- Reports
- Tax Rates
Examples of values that use the Inv Prefs setting are:
- Expenses associated with an invoice
- Invoices
- Payments
- Payment warehouse records*
- Recurrence (aka cron) records
*Payment warehouse records are a special case. The globalization values are assigned as follows:
-
-
- Record is associated with the payment. The globalization values are based on the invoice associated with the payment.
- Not associated with a payment but associated customer has a default invoice assigned to it. Globalization values are relative to the default invoice.
- Not associated with a payment and customer does not have a default invoice. Globalization values come from the configuration file.
-
Comments for Inv Prefs (si_preference) globalization settings:
The Currency code and Locale fields are used. The Currency sign field is being phased out. It is still used by reports, pdf’s and printed invoice templates. This logic will be replaced in a future update, by logic that obtains the Currency sign (aka Currency Symbol) from the PHP NumberFormatter class instantiated for the Locale field. The value obtained using the getSymbol() method with the NumberFormatter::CURRENCY_SYMBOL constant.
The Precision for Inv Prefs related records is obtained from the PHP NumberFormatter class instantiated for the Locale field. The value obtained using the getAttribute() method with the NumberFormatter::MAX_FRACTION_DIGITS constant.