OSCommerce Product Manager

OSCommerce Product Manager for Windows
Tasklist

FS#86 - Improve and extend currency handling.

Attached to Project: OSCommerce Product Manager
Opened by Mario A. Valdez-Ramirez (mvaldez) - Wednesday, 25 August 2004, 12:01 GMT-6
Last edited by Mario A. Valdez-Ramirez (mvaldez) - Saturday, 10 September 2005, 16:25 GMT-6
Task Type New feature
Category Backend / Core
Status Closed
Assigned To Mario A. Valdez-Ramirez (mvaldez)
Operating System All
Severity Medium
Priority Normal
Reported Version any
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Currently, 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, 16:25 GMT-6
Reason for closing:  
Comment by Mario A. Valdez-Ramirez (mvaldez) - Friday, 21 January 2005, 05:24 GMT-6


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.


Comment by Mario A. Valdez-Ramirez (mvaldez) - Monday, 23 May 2005, 03:30 GMT-6

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?

Comment by Mario A. Valdez-Ramirez (mvaldez) - Friday, 22 July 2005, 02:19 GMT-6


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).
Comment by Mario A. Valdez-Ramirez (mvaldez) - Wednesday, 07 September 2005, 22:33 GMT-6

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.
Comment by Mario A. Valdez-Ramirez (mvaldez) - Wednesday, 07 September 2005, 22:40 GMT-6
A bottleneck in the server would be awful (as there is no direct status reporting). Also, if the server-side script stall too much, the client may not be able to communicate again to the server until that process is finished or the web server connection dies.

Better would be to get the web data from the client, send it to the server and then return the parsed data.
Comment by Mario A. Valdez-Ramirez (mvaldez) - Wednesday, 07 September 2005, 23:05 GMT-6

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.
Comment by Mario A. Valdez-Ramirez (mvaldez) - Wednesday, 07 September 2005, 23:28 GMT-6

Any RegEx library for Delphi?
Comment by Mario A. Valdez-Ramirez (mvaldez) - Saturday, 10 September 2005, 01:49 GMT-6
Adding, deleting and editing has been implemented.

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.
Comment by Mario A. Valdez-Ramirez (mvaldez) - Saturday, 10 September 2005, 01:51 GMT-6
On a second thought, I think using the server-side code would be easier. Let's try it first.
Comment by Mario A. Valdez-Ramirez (mvaldez) - Saturday, 10 September 2005, 01:59 GMT-6 Comment by Mario A. Valdez-Ramirez (mvaldez) - Saturday, 10 September 2005, 16:24 GMT-6


Implemented updating too. Doing the downloading and parsing, server-side.

Closing as implemented.
Comment by Mario A. Valdez-Ramirez (mvaldez) - Saturday, 10 September 2005, 16:25 GMT-6


Forgot to document: setting the default currency is not supported yet.

Loading...