View | Details | Raw Unified | Return to bug 10412
Collapse All | Expand All

(-)a/installer/data/mysql/kohastructure.sql (+21 lines)
Lines 2961-2966 CREATE TABLE aqinvoices ( Link Here
2961
2961
2962
2962
2963
--
2963
--
2964
-- Table structure for table 'aqcreditnotes'
2965
--
2966
2967
DROP TABLE IF EXISTS aqcreditnotes;
2968
CREATE TABLE aqcreditnotes (
2969
  `creditnote_id` int(11) NOT NULL AUTO_INCREMENT,    -- ID of the creditnote, primary key
2970
  `booksellerid` int(11) NOT NULL,    -- foreign key to aqbooksellers
2971
  `invoiceid` int(11) NOT NULL,    -- foreign key to aqinvoices
2972
  `vendorrefid` varchar(20) NOT NULL, -- Vendorreferenceid
2973
  `budget_id` int(11) NOT NULL, -- foreign key to aqbudgets
2974
  `amountcredit` decimal(28,6) default NULL,  -- amountcredit cost
2975
  `creditdate` date default NULL,   -- date of amountcredit
2976
  `notes` mediumtext,  -- notes of amountcredit
2977
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched 
2978
  PRIMARY KEY (creditnote_id),
2979
  CONSTRAINT aqcreditnotes_fk_aqbooksellerid FOREIGN KEY (booksellerid) REFERENCES aqbooksellers (id) ON DELETE CASCADE ON UPDATE CASCADE,
2980
  CONSTRAINT aqcreditnotes_fk_invoiceid FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE CASCADE ON UPDATE CASCADE,
2981
  CONSTRAINT aqcreditnotes_fk_budget_id FOREIGN KEY (budget_id) REFERENCES aqbudgets (budget_id) ON DELETE CASCADE ON UPDATE CASCADE
2982
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2983
2984
--
2964
-- Table structure for table `fieldmapping`
2985
-- Table structure for table `fieldmapping`
2965
--
2986
--
2966
2987
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +20 lines)
Lines 6990-6995 if ( CheckVersion($DBversion) ) { Link Here
6990
    SetVersion($DBversion);
6990
    SetVersion($DBversion);
6991
}
6991
}
6992
6992
6993
$DBversion = "3.13.00.XXX";
6994
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6995
    $dbh->do("CREATE TABLE aqcreditnotes (
6996
                `creditnote_id` int(11) NOT NULL AUTO_INCREMENT, 
6997
                `booksellerid` int(11) NOT NULL,
6998
                `invoiceid` int(11) NOT NULL, 
6999
                `vendorrefid` varchar(80) NOT NULL,
7000
                `budget_id` int(11) NOT NULL,
7001
                `amountcredit` decimal(28,6) default NULL, 
7002
                `creditdate` date default NULL,
7003
                `notes` mediumtext, 
7004
                `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, 
7005
                 PRIMARY KEY (creditnote_id),
7006
                 CONSTRAINT aqcreditnotes_fk_aqbooksellerid FOREIGN KEY (booksellerid) REFERENCES aqbooksellers (id) ON DELETE CASCADE ON UPDATE CASCADE,
7007
                 CONSTRAINT aqcreditnotes_fk_invoiceid FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE CASCADE ON UPDATE CASCADE,
7008
                 CONSTRAINT aqcreditnotes_fk_budget_id FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE CASCADE ON UPDATE CASCADE
7009
              ) ENGINE=InnoDB DEFAULT CHARSET=utf8");
7010
    print "Upgrade to $DBversion done (Added new table aqcreditnotes)\n";
7011
    SetVersion($DBversion);
7012
}
6993
7013
6994
=head1 FUNCTIONS
7014
=head1 FUNCTIONS
6995
7015
6996
- 

Return to bug 10412