Bug 4160: Currency conversion doesn't handle rates other than 100
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Mon, 31 Jan 2011 20:45:40 +0000 (15:45 -0500)
committerChris Cormack <chrisc@catalyst.net.nz>
Tue, 1 Feb 2011 06:36:56 +0000 (19:36 +1300)
Changes data type for currency.rate to accomodate bigger currency conversion rates.

FLOAT( 15, 5 )

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl
kohaversion.pl

index 5e0c6b6..e7ad97f 100644 (file)
@@ -563,7 +563,7 @@ CREATE TABLE `currency` (
   `currency` varchar(10) NOT NULL default '',
   `symbol` varchar(5) default NULL,
   `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
-  `rate` float(7,5) default NULL,
+  `rate` float(15,5) default NULL,
   `active` tinyint(1) default NULL,
   PRIMARY KEY  (`currency`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
index 640868a..3f68b9f 100755 (executable)
@@ -3980,6 +3980,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion($DBversion);
 };
 
+$DBversion = '3.03.00.00X';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("ALTER TABLE  `currency` CHANGE `rate` `rate` FLOAT( 15, 5 ) NULL DEFAULT NULL;");
+    print "Upgrade to $DBversion done (Enable currency rates >= 100)\n";
+    SetVersion ($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 DropAllForeignKeys($table)
index eedf68c..3ece202 100644 (file)
@@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts :
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.03.00.016';
+    our $VERSION = '3.0X.XX.XXX';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install