OSCommerce Product Manager for Windows
FS#86 - Improve and extend currency handling.
Attached to Project:
OSCommerce Product Manager
Opened by Mario A. Valdez-Ramirez (mvaldez) - Wednesday, 25 August 2004, 17:01 GMT
Last edited by Mario A. Valdez-Ramirez (mvaldez) - Saturday, 10 September 2005, 21:25 GMT
Opened by Mario A. Valdez-Ramirez (mvaldez) - Wednesday, 25 August 2004, 17:01 GMT
Last edited by Mario A. Valdez-Ramirez (mvaldez) - Saturday, 10 September 2005, 21:25 GMT
|
DetailsCurrently, products can only be edited using the default currency. It would be nice to be able to select on what currency to enter data and then the application do all the conversions before storing in the database.
Also, it would be nice to have the currency administration options in the application (add, delete, edit, select default, set exchange rate, etc). |
This task depends upon
Closed by Mario A. Valdez-Ramirez (mvaldez)
Saturday, 10 September 2005, 21:25 GMT
Reason for closing:
Saturday, 10 September 2005, 21:25 GMT
Reason for closing:
Exchange rate should be automatically downloaded from a central web location.
We could use data from the Federal Reserve Bank of NY (http://www.ny.frb.org/markets/fxrates/noon.cfm), exported daily as XML,
or the International Monetary Fund (http://www.imf.org/external/np/fin/rates/rms_rep.cfm), available as CSV files on a daily basis.
For updating the currency exchange rate, we can do what OSCommerce do: use Oanda or XE service.
For Oanda, we request a page like this:
http://www.oanda.com/convert/fxdaily?value=1&exch=MXN&dest=Get+Table&sel_list=USD&format=CSV&redirected=1
MXN is an example of the source currency and USD is the target currency (how many MXN are in one USD?)
The result is embedded in an HTML page. Something like:
US Dollar,USD,10.964,0.091249
We would only need to find the string with three commas and two real/float numbers. Pretty brute, eh?
Automatic updating of exchange rates is a very useful and needed feature. We should raise the priority of this. (Or create a new feature request with higher priority).
PHP is better suited to parse text data than Delphi, maybe the parsing and extracting of the exchange rates from the source web pages can be done server-side and then passed to the client for confirmation.
Better would be to get the web data from the client, send it to the server and then return the parsed data.
We could use PHP4Delphi (http://sourceforge.net/projects/psvlib) to parse execute PHP scripts inside Delphi.
Or maybe not, it would cause a license clash. The PHP4Delphi license is MPL, however links to PHP libraries, which use the PHP license. Both are incompatible with the GPL.
Any RegEx library for Delphi?
Pending to write the automatic-updating code.
I think we should do all the processing locally: download the page, parse it, then previewing the changes.
For multiple currencies, the URL would be something like:
http://www.oanda.com/convert/fxdaily?value=1&exch=USD&dest=Get+Table&sel_list=EUR_ILS_MXN_SIT_VEB&format=CSV&redirected=1
Implemented updating too. Doing the downloading and parsing, server-side.
Closing as implemented.
Forgot to document: setting the default currency is not supported yet.