Extend Money for more Currency and Localization support

Description

OpenLMIS v3 should improve on the Currency and Localization support in the Money class from v2. This is an important part of the v3 theme of making OpenLMIS more extensible with strong translation support.

Acceptance:

  • Refactoring/clean-up of the Money class to use Joda-Money.

  • A configuration setting to specify a Currency (as ISO 4217) at the implementation level. That way all the prices stored in that system would have a known currency. (We don't yet need to support multiple different currencies in one implementation.)

  • An endpoint will exist (in reference data) which returns the Currency setting as a ISO4217.

  • When formatting the money as a String, it should display the currency symbol on the left or right depending on the currency rule configured.

  • When amounts of money are returned via the API, the Money should be represented as a Number.

  • The configuration of currency would include specifying a Unicode symbol or a string to use to display next to any currency values. (EG, PricePerPack could be displayed as €12,00 or $USD12.00 by changing the configuration). The string could be useful in case Unicode does not have a single character for the currency name that some countries use. This should be handled by the standard Currency support.

  • The Currency in use would cause prices to be stored and displayed with different, appropriate numbers of decimal places of precision. Right now OpenLMIS hard-codes Money values to 2 decimal places.

Attachments

3
100% Done
Type
Key
Summary
Priority
Story Points
Assignee
Status

QAlity Plus - Test Management

Checklists

Activity

Show:
Sebastian Brudziński
April 28, 2017 at 2:05 PM

Can you let us know how one would change the currency at the implementation level? We are currently struggling with where to configure that.

Paweł Albecki
February 10, 2017 at 12:07 PM

ok, I understand, thanks.

Lucyna Laska
February 10, 2017 at 12:07 PM

I know, I just wanted to mention that I could not change the currency. I updated the summary.

Paweł Albecki
February 10, 2017 at 12:04 PM

We support, this ticket was all about support any currency but it can be changed only on implementation level so you don't have to test other currencies.

Lucyna Laska
February 10, 2017 at 12:01 PM
(edited)

Looks good.

Summary:

  • All prices stored in the system have a known currency

  • we support different currencies

  • symbol is displayed next to the currency value (for example: $21,169,005.53 or $5.23)

  • endpoint: GET /api/currencySettings is added

  • according to the currencySettings, symbol is displayed on the left side

  • stored and displayed prices to 2 decimal places

  • amount returned via API is represented as number

Done
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Original estimate

Time tracking

2w 1d 1h logged1h remaining

Components

Sprint

None

Fix versions

Priority

Time Assistant

Created November 8, 2016 at 9:08 PM
Updated April 4, 2018 at 6:02 PM
Resolved February 10, 2017 at 12:01 PM