interchange / interchange6-schema

DBIC schema for Interchange 6
8 stars 7 forks source link

Support for currency #182

Open racke opened 9 years ago

racke commented 9 years ago

I would like to add currency column to prices, orders, payment orders etc. For example it allows us to offer products in other currencies, payments with different currency etc.

SysPete commented 8 years ago

Perhaps a Currency class should be added which tracks 'active' currencies? We would also need to track exchange rates in another table and have this populated from an external service so we know which rate is/was valid at a particular date/time.

Looking towards multi-shop we would need a link table between the Shop/Site class and Currency class sinec not all shops will support the same currencies. CurrencyExchange class should probably track rates for all shops with some currency markup percentage stored either per-shop in Shop or per-currency in ShopCurrency link table.

racke commented 8 years ago

Yes that sounds good.

SysPete commented 8 years ago

This is currently being worked on in branch topic/multistore_gh27

SysPete commented 8 years ago

Currency work moved to master branch since multistore has been put on back burner.

We have two new classes:

The only class using Currency so far is Cart but it also needs to be added to the various Order* classes.

Current plan is to use CLDR::Currency for currency locales and to build something similar to Math::Currency for currency maths and exchange conversions.

SysPete commented 8 years ago

The current view is that there will be only one currency for the shop that is used for all product pricing and active 'foreign' currencies will be available for display and payment. Order* classes should record standard shop currency as well as foreign currency amounts.

Exchange rates can be filled in manually by shop owner or a converter class can be set in which case that will be used to fetch and store exchange rates. A working example of a converter class will be included in the schema.