Added fixed asset related db changes in upgrade class.
[fa-stable.git] / sql / alter2.4rc1.sql
1 ALTER TABLE `0_locations` ADD COLUMN `fixed_asset` tinyint(1) NOT NULL DEFAULT '0' after `contact`;
2
3 DROP TABLE IF EXISTS `0_stock_fa_class`;
4 CREATE TABLE `0_stock_fa_class` (
5   `fa_class_id` varchar(20) NOT NULL DEFAULT '',
6   `parent_id` varchar(20) NOT NULL DEFAULT '',
7   `description` varchar(200) NOT NULL DEFAULT '',
8   `long_description` tinytext NOT NULL,
9   `depreciation_method` char(1) NOT NULL DEFAULT 'D',
10   `depreciation_rate` double NOT NULL DEFAULT '0',
11   `depreciation_period` tinyint(1) NOT NULL DEFAULT '0',
12   `inactive` tinyint(1) NOT NULL DEFAULT '0',
13   PRIMARY KEY (`fa_class_id`)
14 ) ENGINE=InnoDB;
15
16 ALTER TABLE `0_stock_master` ADD COLUMN `depreciation_method` char(1) NOT NULL DEFAULT 'D' AFTER `editable`;
17 ALTER TABLE `0_stock_master` ADD COLUMN `depreciation_rate` double NOT NULL DEFAULT '0' AFTER `depreciation_method`;
18 ALTER TABLE `0_stock_master` ADD COLUMN `depreciation_start` date NOT NULL DEFAULT '0000-00-00' AFTER `depreciation_rate`;
19 ALTER TABLE `0_stock_master` ADD COLUMN `depreciation_date` date NOT NULL DEFAULT '0000-00-00' AFTER `depreciation_start`;
20 ALTER TABLE `0_stock_master` ADD COLUMN `fa_class_id` varchar(20) NOT NULL DEFAULT '' AFTER `depreciation_date`;
21
22 INSERT INTO `0_sys_prefs` VALUES ('default_loss_on_asset_disposal_act', 'glsetup.items', 'varchar', '15', '5660');
23 INSERT INTO `0_sys_prefs` VALUES ('depreciation_period', 'glsetup.company', 'tinyint', '1', '1');
24