You know why. We'll have to store currency information in the database though.

Comments

xano’s picture

The most important piece of Views integration will probably be the field handler to display amounts. It will need a currency, either from a predefined setting or a DB field, and it will require #1848030: Add locale-based currency formatting to do the actual rendering. We have to make sure the handler is easily reusable, because the different applications may store amounts differently.

xano’s picture

Assigned: Unassigned » xano
StatusFileSize
new9.58 KB
xano’s picture

Status: Active » Needs review
StatusFileSize
new14.56 KB

The patch adds two handlers:

  1. CurrencyAmountViewsHandlerField renders amounts using a currency, which can be specified in the handler definition, or through UI options, and which defaults to XXX. By default it assumes amounts are stored as floats, but any application can extend the handler and override the getAmount() method to make the handler work for any amount format.
  2. CurrencyViewsHandlerField displays any currency property based on an ISO 4217 currency code.

Status: Needs review » Needs work

The last submitted patch, currency_1531956_03.patch, failed testing.

xano’s picture

Status: Needs work » Needs review
StatusFileSize
new18.19 KB

Added a test for CurrencyViewsHandlerField and test_dependencies in the info file to make sure the testbot knows to checkout Views. The patch may still fail, because IIRC Project Dependency still caches dependency information, and therefore does not pick up dependencies added by the patches it tests.

All tests pass locally.

Status: Needs review » Needs work

The last submitted patch, currency_1531956_04.patch, failed testing.

amateescu’s picture

Status: Needs work » Fixed

Tests pass locally for me as well, so I committed the patch to 7.x-2.x :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

xano’s picture

Assigned: xano » Unassigned