Item Tax Types: fixed inactive item tax types display switching.
[fa-stable.git] / sql / alter2.4.sql
index e2bf6278ca48e068b41b182828db9c393f0bee2c..727e91c3a39e83c979ff677fb058f5382d156edc 100644 (file)
@@ -36,7 +36,7 @@ ALTER TABLE `0_tax_groups` DROP COLUMN `tax_shipping`;
 
 ALTER TABLE `0_sales_order_details` ADD KEY `stkcode` (`stk_code`);
 ALTER TABLE `0_purch_order_details` ADD KEY `itemcode` (`item_code`);
-ALTER TABLE `0_sys_prefs` CHANGE `value` `value` TEXT NOT NULL;
+ALTER TABLE `0_sys_prefs` CHANGE `value` `value` TEXT NOT NULL DEFAULT '';
 ALTER TABLE `0_cust_branch` ADD COLUMN `bank_account` varchar(60) DEFAULT NULL AFTER `notes`;
 
 ALTER TABLE `0_debtor_trans` ADD COLUMN `tax_included` tinyint(1) unsigned NOT NULL default '0' AFTER `payment_terms`;
@@ -115,7 +115,6 @@ ALTER TABLE `0_groups` ENGINE=InnoDB;
 ALTER TABLE `0_item_codes` ENGINE=InnoDB;
 ALTER TABLE `0_item_units` ENGINE=InnoDB;
 ALTER TABLE `0_locations` ENGINE=InnoDB;
-ALTER TABLE `0_movement_types` ENGINE=InnoDB;
 ALTER TABLE `0_payment_terms` ENGINE=InnoDB;
 ALTER TABLE `0_prices` ENGINE=InnoDB;
 ALTER TABLE `0_printers` ENGINE=InnoDB;
@@ -208,3 +207,35 @@ UPDATE `0_trans_tax_details` reg
        SET reg.reg_type=0
        WHERE reg.trans_type IN(10, 11);
 
+INSERT IGNORE INTO `0_sys_prefs` VALUES
+       ('grn_clearing_act', 'glsetup.purchase', 'varchar', 15, 0),
+       ('default_receival_required', 'glsetup.purchase', 'smallint', 6, '10'),
+       ('default_quote_valid_days', 'glsetup.sales', 'smallint', 6, 30),
+       ('no_zero_lines_amount', 'glsetup.sales', 'tinyint', 1, '1'),
+       ('show_po_item_codes', 'glsetup.purchase', 'tinyint', 1, '0'),
+       ('accounts_alpha', 'glsetup.general', 'tinyint', 1, '0'),
+       ('loc_notification', 'glsetup.inventory', 'tinyint', 1, '0'),
+       ('print_invoice_no', 'glsetup.sales', 'tinyint', 1, '0'),
+       ('allow_negative_prices', 'glsetup.inventory', 'tinyint', 1, '1'),
+       ('print_item_images_on_quote', 'glsetup.inventory', 'tinyint', 1, '0'),
+       ('bcc_email', 'setup.company', 'varchar', 100, ''),
+       ('alternative_tax_include_on_docs', 'setup.company', 'tinyint', 1, '0'),
+       ('suppress_tax_rates', 'setup.company', 'tinyint', 1, '0');
+
+# stock_moves.visible field is obsolete
+# removing obsolete moves for writeoffs
+DELETE moves
+       FROM `0_stock_moves` moves 
+       INNER JOIN (SELECT * FROM `0_stock_moves` WHERE `type`=11 AND `qty`<0) writeoffs ON writeoffs.`trans_no`=moves.`trans_no` AND writeoffs.`type`=11
+       WHERE moves.`type`=11;
+
+ALTER TABLE `0_stock_moves` DROP COLUMN `visible`;
+# stock_moves.discount_percent field are obsolete
+
+UPDATE `0_stock_moves` SET
+       price = price*(1-discount_percent);
+ALTER TABLE `0_stock_moves` DROP COLUMN `discount_percent`;
+
+ALTER TABLE `0_stock_moves` DROP COLUMN `person_id`;
+
+DROP TABLE IF EXISTS `0_movement_types`;