Transaction references extended with parametrized patterns, added check_reference...
[fa-stable.git] / sql / alter2.4.sql
index 56aa0199921e65a71d08d8b0ec2c8f0d3723a4d3..2e765bfb9916b8129bd09b33ad8ce9a02b219abb 100644 (file)
@@ -240,3 +240,20 @@ UPDATE `0_salesman`
        SET `break_pt` = `break_pt`*100.0/`provision`
 WHERE `provision` != 0;
 
+# reference lines
+DROP TABLE IF EXISTS `0_reflines`;
+CREATE TABLE `0_reflines` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `trans_type` int(11) NOT NULL,
+  `prefix` char(5) NOT NULL DEFAULT '',
+  `pattern` varchar(35) NOT NULL DEFAULT '1',
+  `description` varchar(60) NOT NULL DEFAULT '',
+  `default` tinyint(1) NOT NULL DEFAULT '0',
+  `inactive` tinyint(1) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `prefix` (`trans_type`, `prefix`)
+) ENGINE=InnoDB;
+
+INSERT INTO `0_reflines` (`trans_type`, `pattern`, `default`) SELECT `type_id`, `next_reference`, 1 FROM `0_sys_types`;
+
+DROP TABLE `0_sys_types`;