@@ -, +, @@ --- installer/data/mysql/kohastructure.sql | 5 ++++- installer/data/mysql/updatedatabase.pl | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -2905,6 +2905,8 @@ CREATE TABLE `aqbooksellers` ( -- information about the vendors listed in acquis `listincgst` tinyint(4) default NULL, -- is tax included in list prices (1 for yes, 0 for no) `invoiceincgst` tinyint(4) default NULL, -- is tax included in invoice prices (1 for yes, 0 for no) `tax_rate` decimal(6,4) default NULL, -- the tax rate the library is charged + `shipping_tax_rate decimal(6,4) default null, -- the tax rate for shipping + `shippingincgst` int(1) default 1, -- is tax included in shipping (1 for yes, 0 for no) `discount` float(6,4) default NULL, -- discount offered on all items ordered from this vendor `fax` varchar(50) default NULL, -- vendor fax number deliverytime int(11) default NULL, -- vendor delivery time @@ -3140,7 +3142,8 @@ CREATE TABLE aqinvoices ( shipmentdate date default NULL, -- date of shipment billingdate date default NULL, -- date of billing closedate date default NULL, -- invoice close date, NULL means the invoice is open - shipmentcost decimal(28,6) default NULL, -- shipment cost + shipping decimal(28,6) default NULL, -- shipment cost + shipping_tax_rate decimal(6,4) default NULL, -- shipment tax rate shipmentcost_budgetid int(11) default NULL, -- foreign key to aqbudgets, link the shipment cost to a budget PRIMARY KEY (invoiceid), CONSTRAINT aqinvoices_fk_aqbooksellerid FOREIGN KEY (booksellerid) REFERENCES aqbooksellers (id) ON DELETE CASCADE ON UPDATE CASCADE, --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -9766,6 +9766,27 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = '3.19.00.XXX'; +if ( CheckVersion($DBversion) ) { + + ## Add the new columns + $dbh->do(q| + ALTER TABLE aqbooksellers + ADD COLUMN shipping_tax_rate decimal(6,4) default NULL AFTER tax_rate, + ADD COLUMN shippingincgst int(1) default 1 AFTER shipping_tax_rate + + |); + + $dbh->do(q| + ALTER TABLE aqinvoices + CHANGE COLUMN shipmentcost shipping decimal(28,6) DEFAULT NULL, + ADD COLUMN shipping_tax_rate decimal(6,4) default NULL AFTER shipping, + |); + + print "Upgrade to $DBversion done (Bug 11062 - Add columns aqbooksellers.shipping_tax_rate and aqinvoices.shipping*)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) --