X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sql%2Fen_US-new.sql;h=d62c3203ee6f81407e3cec65ad1f0cb0c599d005;hb=9dab04be9d81766f1878d3688ee73d0bcf29f5d2;hp=793fc514e4951e428bb214846b3c76e6d9862725;hpb=7230a75abb443a5b259bbab663af2f1466ec6e97;p=fa-stable.git diff --git a/sql/en_US-new.sql b/sql/en_US-new.sql index 793fc514..d62c3203 100644 --- a/sql/en_US-new.sql +++ b/sql/en_US-new.sql @@ -77,6 +77,7 @@ CREATE TABLE `0_bank_accounts` ( `bank_name` varchar(60) NOT NULL default '', `bank_address` tinytext, `bank_curr_code` char(3) NOT NULL default '', + `dflt_curr_act` TINYINT(1) NOT NULL default '0', `id` smallint(6) NOT NULL auto_increment, `last_reconciled_date` timestamp NOT NULL default '0000-00-00 00:00:00', `ending_reconcile_balance` double NOT NULL default '0', @@ -89,8 +90,8 @@ CREATE TABLE `0_bank_accounts` ( ### Data of table `0_bank_accounts` ### -INSERT INTO `0_bank_accounts` VALUES ('1060', '0', 'Current account', 'N/A', 'N/A', '', 'USD', '1', '0000-00-00 00:00:00', '0', '0'); -INSERT INTO `0_bank_accounts` VALUES ('1065', '3', 'Petty Cash account', 'N/A', 'N/A', '', 'USD', '2', '0000-00-00 00:00:00', '0', '0'); +INSERT INTO `0_bank_accounts` VALUES ('1060', '0', 'Current account', 'N/A', 'N/A', '', 'USD', '1', '1', '0000-00-00 00:00:00', '0', '0'); +INSERT INTO `0_bank_accounts` VALUES ('1065', '3', 'Petty Cash account', 'N/A', 'N/A', '', 'USD', '0', '2', '0000-00-00 00:00:00', '0', '0'); ### Structure of table `0_bank_trans` ### @@ -477,6 +478,7 @@ CREATE TABLE `0_cust_branch` ( `area` int(11) default NULL, `salesman` int(11) NOT NULL default '0', `phone` varchar(30) NOT NULL default '', + `phone2` varchar(30) NOT NULL default '', `fax` varchar(30) NOT NULL default '', `contact_name` varchar(60) NOT NULL default '', `email` varchar(100) NOT NULL default '', @@ -490,6 +492,7 @@ CREATE TABLE `0_cust_branch` ( `disable_trans` tinyint(4) NOT NULL default '0', `br_post_address` tinytext NOT NULL, `group_no` int(11) NOT NULL default '0', + `notes` tinytext NOT NULL, `inactive` tinyint(1) NOT NULL default '0', PRIMARY KEY (`branch_code`,`debtor_no`), KEY `branch_code` (`branch_code`), @@ -566,7 +569,7 @@ DROP TABLE IF EXISTS `0_debtors_master`; CREATE TABLE `0_debtors_master` ( `debtor_no` int(11) NOT NULL auto_increment, - `name` varchar(80) NOT NULL default '', + `name` varchar(100) NOT NULL default '', `debtor_ref` varchar(30) NOT NULL, `address` tinytext, `email` varchar(100) NOT NULL default '', @@ -580,6 +583,7 @@ CREATE TABLE `0_debtors_master` ( `discount` double NOT NULL default '0', `pymt_discount` double NOT NULL default '0', `credit_limit` float NOT NULL default '1000', + `notes` tinytext NOT NULL, `inactive` tinyint(1) NOT NULL default '0', PRIMARY KEY (`debtor_no`), UNIQUE KEY `name` (`name`) @@ -833,6 +837,7 @@ CREATE TABLE `0_locations` ( `location_name` varchar(60) NOT NULL default '', `delivery_address` tinytext NOT NULL, `phone` varchar(30) NOT NULL default '', + `phone2` varchar(30) NOT NULL default '', `fax` varchar(30) NOT NULL default '', `email` varchar(100) NOT NULL default '', `contact` varchar(30) NOT NULL default '', @@ -843,7 +848,7 @@ CREATE TABLE `0_locations` ( ### Data of table `0_locations` ### -INSERT INTO `0_locations` VALUES ('DEF', 'Default', 'N/A', '', '', '', '', '0'); +INSERT INTO `0_locations` VALUES ('DEF', 'Default', 'N/A', '', '', '', '', '', '0'); ### Structure of table `0_movement_types` ### @@ -1117,6 +1122,7 @@ DROP TABLE IF EXISTS `0_sales_order_details`; CREATE TABLE `0_sales_order_details` ( `id` int(11) NOT NULL auto_increment, `order_no` int(11) NOT NULL default '0', + `trans_type` smallint(6) NOT NULL default '30', `stk_code` varchar(20) NOT NULL default '', `description` tinytext, `qty_sent` double NOT NULL default '0', @@ -1136,11 +1142,13 @@ CREATE TABLE `0_sales_order_details` ( DROP TABLE IF EXISTS `0_sales_orders`; CREATE TABLE `0_sales_orders` ( - `order_no` int(11) NOT NULL auto_increment, + `order_no` int(11) NOT NULL, + `trans_type` smallint(6) NOT NULL default '30', `version` tinyint(1) unsigned NOT NULL default '0', `type` tinyint(1) NOT NULL default '0', `debtor_no` int(11) NOT NULL default '0', `branch_code` int(11) NOT NULL default '0', + `reference` varchar(100) NOT NULL default '', `customer_ref` tinytext NOT NULL, `comments` tinytext, `ord_date` date NOT NULL default '0000-00-00', @@ -1153,8 +1161,8 @@ CREATE TABLE `0_sales_orders` ( `freight_cost` double NOT NULL default '0', `from_stk_loc` varchar(5) NOT NULL default '', `delivery_date` date NOT NULL default '0000-00-00', - PRIMARY KEY (`order_no`) -) TYPE=InnoDB AUTO_INCREMENT=1 ; + PRIMARY KEY (`trans_type`, `order_no`) +) TYPE=InnoDB; ### Data of table `0_sales_orders` ### @@ -1227,6 +1235,34 @@ CREATE TABLE `0_salesman` ( INSERT INTO `0_salesman` VALUES ('1', 'Sales Person', '', '', '', '5', '1000', '4', '0'); +### Structure of table `0_security_roles` ### + +DROP TABLE IF EXISTS `0_security_roles`; +CREATE TABLE IF NOT EXISTS `0_security_roles` ( + `id` int(11) NOT NULL auto_increment, + `role` varchar(30) NOT NULL, + `description` varchar(50) default NULL, + `sections` text, + `areas` text, + `inactive` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY `role` (`role`) +) TYPE=MyISAM AUTO_INCREMENT=11 ; + +-- +-- Data of table `0_security_roles` +-- + +INSERT INTO `0_security_roles` VALUES (1, 'Inquiries', 'Inquiries', '768;2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15872;16128', '257;258;259;260;513;514;515;516;517;518;519;520;521;522;523;524;525;773;774;2822;3073;3075;3076;3077;3329;3330;3331;3332;3333;3334;3335;5377;5633;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8450;8451;10497;10753;11009;11010;11012;13313;13315;15617;15618;15619;15620;15621;15622;15623;15624;15625;15626;15873;15882;16129;16130;16131;16132', 0); +INSERT INTO `0_security_roles` VALUES (2, 'System Administrator', 'System Administrator', '256;512;768;2816;3072;3328;5376;5632;5888;7936;8192;8448;10496;10752;11008;13056;13312;15616;15872;16128', '257;258;259;260;513;514;515;516;517;518;519;520;521;522;523;524;525;769;770;771;772;773;774;2817;2818;2819;2820;2821;2822;2823;3073;3074;3082;3075;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5634;5635;5636;5637;5641;5638;5639;5640;5889;5891;7937;7938;7939;7940;8193;8194;8195;8196;8197;8449;8450;8451;10497;10753;10754;10755;10756;10757;11009;11010;11012;13057;13313;13314;13315;15617;15618;15619;15620;15621;15622;15623;15624;15625;15626;15627;15873;15874;15875;15876;15877;15878;15879;15880;15883;15881;15882;16129;16130;16131;16132', 0); +INSERT INTO `0_security_roles` VALUES (3, 'Salesman', 'Salesman', '768;3072;5632;8192;15872', '773;774;3073;3075;3081;5633;8194;15873', 0); +INSERT INTO `0_security_roles` VALUES (4, 'Stock Manager', 'Stock Manager', '2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15872;16128', '2818;2822;3073;3076;3077;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5633;5640;5889;5890;5891;8193;8194;8450;8451;10753;11009;11010;11012;13313;13315;15882;16129;16130;16131;16132', 0); +INSERT INTO `0_security_roles` VALUES (5, 'Production Manager', 'Production Manager', '512;2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '521;523;524;2818;2819;2820;2821;2822;2823;3073;3074;3076;3077;3078;3079;3080;3081;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5633;5640;5640;5889;5890;5891;8193;8194;8196;8197;8450;8451;10753;10755;11009;11010;11012;13313;13315;15617;15619;15620;15621;15624;15624;15876;15877;15880;15882;16129;16130;16131;16132', 0); +INSERT INTO `0_security_roles` VALUES (6, 'Purchase Officer', 'Purchase Officer', '512;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '521;523;524;2818;2819;2820;2821;2822;2823;3073;3074;3076;3077;3078;3079;3080;3081;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5377;5633;5635;5640;5640;5889;5890;5891;8193;8194;8196;8197;8449;8450;8451;10753;10755;11009;11010;11012;13313;13315;15617;15619;15620;15621;15624;15624;15876;15877;15880;15882;16129;16130;16131;16132', 0); +INSERT INTO `0_security_roles` VALUES (7, 'AR Officer', 'AR Officer', '512;768;2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '521;523;524;771;773;774;2818;2819;2820;2821;2822;2823;3073;3073;3074;3075;3076;3077;3078;3079;3080;3081;3081;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5633;5633;5634;5637;5638;5639;5640;5640;5889;5890;5891;8193;8194;8194;8196;8197;8450;8451;10753;10755;11009;11010;11012;13313;13315;15617;15619;15620;15621;15624;15624;15873;15876;15877;15878;15880;15882;16129;16130;16131;16132', 0); +INSERT INTO `0_security_roles` VALUES (8, 'AP Officer', 'AP Officer', '512;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '257;258;259;260;521;523;524;769;770;771;772;773;774;2818;2819;2820;2821;2822;2823;3073;3074;3082;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5635;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8196;8197;8449;8450;8451;10497;10753;10755;11009;11010;11012;13057;13313;13315;15617;15619;15620;15621;15624;15876;15877;15880;15882;16129;16130;16131;16132', 0); +INSERT INTO `0_security_roles` VALUES (9, 'Accountant', 'New Accountant', '512;768;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '257;258;259;260;521;523;524;771;772;773;774;2818;2819;2820;2821;2822;2823;3073;3074;3075;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5634;5635;5637;5638;5639;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8196;8197;8449;8450;8451;10497;10753;10755;11009;11010;11012;13313;13315;15617;15618;15619;15620;15621;15624;15873;15876;15877;15878;15880;15882;16129;16130;16131;16132', 0); +INSERT INTO `0_security_roles` VALUES (10, 'Sub Admin', 'Sub Admin', '512;768;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '257;258;259;260;521;523;524;771;772;773;774;2818;2819;2820;2821;2822;2823;3073;3074;3082;3075;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5634;5635;5637;5638;5639;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8196;8197;8449;8450;8451;10497;10753;10755;11009;11010;11012;13057;13313;13315;15617;15619;15620;15621;15624;15873;15874;15876;15877;15878;15879;15880;15882;16129;16130;16131;16132', 0); ### Structure of table `0_shippers` ### @@ -1236,6 +1272,7 @@ CREATE TABLE `0_shippers` ( `shipper_id` int(11) NOT NULL auto_increment, `shipper_name` varchar(60) NOT NULL default '', `phone` varchar(30) NOT NULL default '', + `phone2` varchar(30) NOT NULL default '', `contact` tinytext NOT NULL, `address` tinytext NOT NULL, `inactive` tinyint(1) NOT NULL default '0', @@ -1246,7 +1283,7 @@ CREATE TABLE `0_shippers` ( ### Data of table `0_shippers` ### -INSERT INTO `0_shippers` VALUES ('1', 'Default', '', '', '', '0'); +INSERT INTO `0_shippers` VALUES ('1', 'Default', '', '', '', '', '0'); ### Structure of table `0_sql_trail` ### @@ -1443,6 +1480,7 @@ CREATE TABLE `0_suppliers` ( `address` tinytext NOT NULL, `supp_address` tinytext NOT NULL, `phone` varchar(30) NOT NULL default '', + `phone2` varchar(30) NOT NULL default '', `fax` varchar(30) NOT NULL default '', `gst_no` varchar(25) NOT NULL default '', `contact` varchar(60) NOT NULL default '', @@ -1475,7 +1513,6 @@ DROP TABLE IF EXISTS `0_sys_types`; CREATE TABLE `0_sys_types` ( `type_id` smallint(6) NOT NULL default '0', - `type_name` varchar(60) NOT NULL default '', `type_no` int(11) NOT NULL default '1', `next_reference` varchar(100) NOT NULL default '', PRIMARY KEY (`type_id`) @@ -1484,27 +1521,28 @@ CREATE TABLE `0_sys_types` ( ### Data of table `0_sys_types` ### -INSERT INTO `0_sys_types` VALUES ('0', 'Journal - GL', '17', '1'); -INSERT INTO `0_sys_types` VALUES ('1', 'Payment - GL', '7', '1'); -INSERT INTO `0_sys_types` VALUES ('2', 'Receipt - GL', '4', '1'); -INSERT INTO `0_sys_types` VALUES ('4', 'Funds Transfer', '3', '1'); -INSERT INTO `0_sys_types` VALUES ('10', 'Sales Invoice', '16', '1'); -INSERT INTO `0_sys_types` VALUES ('11', 'Credit Note', '2', '1'); -INSERT INTO `0_sys_types` VALUES ('12', 'Receipt', '6', '1'); -INSERT INTO `0_sys_types` VALUES ('13', 'Delivery', '1', '1'); -INSERT INTO `0_sys_types` VALUES ('16', 'Location Transfer', '2', '1'); -INSERT INTO `0_sys_types` VALUES ('17', 'Inventory Adjustment', '2', '1'); -INSERT INTO `0_sys_types` VALUES ('18', 'Purchase Order', '1', '1'); -INSERT INTO `0_sys_types` VALUES ('20', 'Supplier Invoice', '6', '1'); -INSERT INTO `0_sys_types` VALUES ('21', 'Supplier Credit Note', '1', '1'); -INSERT INTO `0_sys_types` VALUES ('22', 'Supplier Payment', '3', '1'); -INSERT INTO `0_sys_types` VALUES ('25', 'Purchase Order Delivery', '1', '1'); -INSERT INTO `0_sys_types` VALUES ('26', 'Work Order', '1', '1'); -INSERT INTO `0_sys_types` VALUES ('28', 'Work Order Issue', '1', '1'); -INSERT INTO `0_sys_types` VALUES ('29', 'Work Order Production', '1', '1'); -INSERT INTO `0_sys_types` VALUES ('30', 'Sales Order', '1', '1'); -INSERT INTO `0_sys_types` VALUES ('35', 'Cost Update', '1', '1'); -INSERT INTO `0_sys_types` VALUES ('40', 'Dimension', '1', '1'); +INSERT INTO `0_sys_types` VALUES ('0', '17', '1'); +INSERT INTO `0_sys_types` VALUES ('1', '7', '1'); +INSERT INTO `0_sys_types` VALUES ('2', '4', '1'); +INSERT INTO `0_sys_types` VALUES ('4', '3', '1'); +INSERT INTO `0_sys_types` VALUES ('10', '16', '1'); +INSERT INTO `0_sys_types` VALUES ('11', '2', '1'); +INSERT INTO `0_sys_types` VALUES ('12', '6', '1'); +INSERT INTO `0_sys_types` VALUES ('13', '1', '1'); +INSERT INTO `0_sys_types` VALUES ('16', '2', '1'); +INSERT INTO `0_sys_types` VALUES ('17', '2', '1'); +INSERT INTO `0_sys_types` VALUES ('18', '1', '1'); +INSERT INTO `0_sys_types` VALUES ('20', '6', '1'); +INSERT INTO `0_sys_types` VALUES ('21', '1', '1'); +INSERT INTO `0_sys_types` VALUES ('22', '3', '1'); +INSERT INTO `0_sys_types` VALUES ('25', '1', '1'); +INSERT INTO `0_sys_types` VALUES ('26', '1', '1'); +INSERT INTO `0_sys_types` VALUES ('28', '1', '1'); +INSERT INTO `0_sys_types` VALUES ('29', '1', '1'); +INSERT INTO `0_sys_types` VALUES ('30', '0', '1'); +INSERT INTO `0_sys_types` VALUES ('32', '0', '1'); +INSERT INTO `0_sys_types` VALUES ('35', '1', '1'); +INSERT INTO `0_sys_types` VALUES ('40', '1', '1'); ### Structure of table `0_tax_group_items` ### @@ -1598,7 +1636,7 @@ CREATE TABLE `0_users` ( `user_id` varchar(60) NOT NULL default '', `password` varchar(100) NOT NULL default '', `real_name` varchar(100) NOT NULL default '', - `full_access` int(11) NOT NULL default '1', + `role_id` int(11) NOT NULL default '1', `phone` varchar(30) NOT NULL default '', `email` varchar(100) default NULL, `language` varchar(20) default NULL, @@ -1768,3 +1806,48 @@ CREATE TABLE `0_workorders` ( ### Data of table `0_workorders` ### + + +### Structure of table `0_tags` ### + +DROP TABLE IF EXISTS `0_tags`; + +CREATE TABLE `0_tags` ( + `id` int(11) NOT NULL auto_increment, + `type` smallint(6) NOT NULL, + `name` varchar(30) NOT NULL, + `description` varchar(60) default NULL, + `inactive` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY(`type`,`name`) +) TYPE=MyISAM AUTO_INCREMENT=1; + + +### Data of table `0_chart_tags` ### + + + +### Structure of table `0_tag_associations` ### + +DROP TABLE IF EXISTS `0_tag_associations`; + +CREATE TABLE `0_tag_associations` ( + `record_id` varchar(11) NOT NULL, + `tag_id` int(11) NOT NULL, + UNIQUE KEY(`record_id`,`tag_id`) +) TYPE=MyISAM; + + +### Data of table `0_tag_associations` ### + +DROP TABLE IF EXISTS `0_useronline` ; + +CREATE TABLE `0_useronline` ( + `id` int(11) NOT NULL AUTO_INCREMENT , + `timestamp` int(15) NOT NULL default '0', + `ip` varchar(40) NOT NULL default '', + `file` varchar(100) NOT NULL default '', + PRIMARY KEY `id` (`id`) , + KEY (`timestamp`) +) TYPE=MYISAM AUTO_INCREMENT=1; +