0000684: Space for Legal Text is not enough. Extended to a text field.
[fa-stable.git] / sql / en_US-demo.sql
index a80a7b7e85615b08d69e3eb9f4be68a05dd4d3f8..38cb4958aa43f8f3ade38482ec973d0b32aec802 100644 (file)
@@ -24,7 +24,7 @@ CREATE TABLE IF NOT EXISTS `0_areas` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`area_code`),
   UNIQUE KEY `description` (`description`)
-) TYPE=MyISAM  AUTO_INCREMENT=2 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=2 ;
 
 --
 -- Dumping data for table `0_areas`
@@ -51,7 +51,7 @@ CREATE TABLE IF NOT EXISTS `0_attachments` (
   `filetype` varchar(60) NOT NULL default '',
   PRIMARY KEY  (`id`),
   KEY `type_no` (`type_no`,`trans_no`)
-) TYPE=MyISAM AUTO_INCREMENT=1 ;
+) ENGINE=MyISAM AUTO_INCREMENT=1 ;
 
 --
 -- Dumping data for table `0_attachments`
@@ -78,7 +78,7 @@ CREATE TABLE IF NOT EXISTS `0_audit_trail` (
   PRIMARY KEY  (`id`),
   KEY `Seq` (`fiscal_year`,`gl_date`,`gl_seq`),
   KEY `Type_and_Number` (`type`,`trans_no`)
-) TYPE=InnoDB AUTO_INCREMENT=1 ;
+) ENGINE=InnoDB AUTO_INCREMENT=1 ;
 
 --
 -- Dumping data for table `0_audit_trail`
@@ -109,7 +109,7 @@ CREATE TABLE IF NOT EXISTS `0_bank_accounts` (
   KEY `bank_account_name` (`bank_account_name`),
   KEY `bank_account_number` (`bank_account_number`),
   KEY `account_code` (`account_code`)
-) TYPE=MyISAM  AUTO_INCREMENT=3 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=3 ;
 
 --
 -- Dumping data for table `0_bank_accounts`
@@ -143,7 +143,7 @@ CREATE TABLE IF NOT EXISTS `0_bank_trans` (
   KEY `type` (`type`,`trans_no`),
   KEY `bank_act_2` (`bank_act`,`reconciled`),
   KEY `bank_act_3` (`bank_act`,`trans_date`)
-) TYPE=InnoDB  AUTO_INCREMENT=12 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=12 ;
 
 --
 -- Dumping data for table `0_bank_trans`
@@ -181,7 +181,7 @@ CREATE TABLE IF NOT EXISTS `0_bom` (
   KEY `loc_code` (`loc_code`),
   KEY `parent` (`parent`,`loc_code`),
   KEY `workcentre_added` (`workcentre_added`)
-) TYPE=MyISAM  AUTO_INCREMENT=4 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=4 ;
 
 --
 -- Dumping data for table `0_bom`
@@ -213,7 +213,7 @@ CREATE TABLE IF NOT EXISTS `0_budget_trans` (
   PRIMARY KEY  (`counter`),
   KEY `Type_and_Number` (`type`,`type_no`),
   KEY `Account` (`account`,`tran_date`,`dimension_id`,`dimension2_id`)
-) TYPE=InnoDB AUTO_INCREMENT=1 ;
+) ENGINE=InnoDB AUTO_INCREMENT=1 ;
 
 --
 -- Dumping data for table `0_budget_trans`
@@ -233,7 +233,7 @@ CREATE TABLE IF NOT EXISTS `0_chart_class` (
   `ctype` tinyint(1) NOT NULL default '0',
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`cid`)
-) TYPE=MyISAM;
+) ENGINE=MyISAM;
 
 --
 -- Dumping data for table `0_chart_class`
@@ -260,7 +260,7 @@ CREATE TABLE IF NOT EXISTS `0_chart_master` (
   PRIMARY KEY  (`account_code`),
   KEY `account_name` (`account_name`),
   KEY `accounts_by_type` (`account_type`,`account_code`)
-) TYPE=MyISAM;
+) ENGINE=MyISAM;
 
 --
 -- Dumping data for table `0_chart_master`
@@ -361,7 +361,7 @@ CREATE TABLE IF NOT EXISTS `0_chart_types` (
   PRIMARY KEY  (`id`),
   KEY `name` (`name`),
   KEY `class_id` (`class_id`)
-) TYPE=MyISAM ;
+) ENGINE=MyISAM ;
 
 --
 -- Dumping data for table `0_chart_types`
@@ -393,7 +393,7 @@ CREATE TABLE IF NOT EXISTS `0_comments` (
   `date_` date default '0000-00-00',
   `memo_` tinytext,
   KEY `type_and_id` (`type`,`id`)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 --
 -- Dumping data for table `0_comments`
@@ -414,7 +414,7 @@ CREATE TABLE IF NOT EXISTS `0_credit_status` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `reason_description` (`reason_description`)
-) TYPE=MyISAM  AUTO_INCREMENT=5 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=5 ;
 
 --
 -- Dumping data for table `0_credit_status`
@@ -442,7 +442,7 @@ CREATE TABLE IF NOT EXISTS `0_crm_categories` (
   PRIMARY KEY  (`id`),
   UNIQUE KEY `type` (`type`,`action`),
   UNIQUE KEY `type_2` (`type`,`name`)
-) TYPE=InnoDB  AUTO_INCREMENT=13 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=13 ;
 
 --
 -- Dumping data for table `0_crm_categories`
@@ -476,7 +476,7 @@ CREATE TABLE IF NOT EXISTS `0_crm_contacts` (
   `entity_id` varchar(11) default NULL COMMENT 'entity id in related class table',
   PRIMARY KEY  (`id`),
   KEY `type` (`type`,`action`)
-) TYPE=InnoDB  AUTO_INCREMENT=10 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=10 ;
 
 --
 -- Dumping data for table `0_crm_contacts`
@@ -514,7 +514,7 @@ CREATE TABLE IF NOT EXISTS `0_crm_persons` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   KEY `ref` (`ref`)
-) TYPE=InnoDB  AUTO_INCREMENT=10 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=10 ;
 
 --
 -- Dumping data for table `0_crm_persons`
@@ -546,7 +546,7 @@ CREATE TABLE IF NOT EXISTS `0_currencies` (
   `auto_update` tinyint(1) NOT NULL default '1',
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`curr_abrev`)
-) TYPE=MyISAM;
+) ENGINE=MyISAM;
 
 --
 -- Dumping data for table `0_currencies`
@@ -576,7 +576,7 @@ CREATE TABLE IF NOT EXISTS `0_cust_allocations` (
   PRIMARY KEY  (`id`),
   KEY `From` (`trans_type_from`,`trans_no_from`),
   KEY `To` (`trans_type_to`,`trans_no_to`)
-) TYPE=InnoDB  AUTO_INCREMENT=2 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=2 ;
 
 --
 -- Dumping data for table `0_cust_allocations`
@@ -616,7 +616,7 @@ CREATE TABLE IF NOT EXISTS `0_cust_branch` (
   KEY `branch_code` (`branch_code`),
   KEY `branch_ref` (`branch_ref`),
   KEY `group_no` (`group_no`)
-) TYPE=MyISAM  AUTO_INCREMENT=4 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=4 ;
 
 --
 -- Dumping data for table `0_cust_branch`
@@ -651,9 +651,9 @@ CREATE TABLE IF NOT EXISTS `0_debtors_master` (
   `notes` tinytext NOT NULL,
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`debtor_no`),
-  UNIQUE KEY `name` (`name`),
-  KEY `debtor_ref` (`debtor_ref`)
-) TYPE=MyISAM  AUTO_INCREMENT=4 ;
+  KEY `name` (`name`),
+  UNIQUE KEY `debtor_ref` (`debtor_ref`)
+) ENGINE=MyISAM  AUTO_INCREMENT=4 ;
 
 --
 -- Dumping data for table `0_debtors_master`
@@ -695,7 +695,7 @@ CREATE TABLE IF NOT EXISTS `0_debtor_trans` (
   PRIMARY KEY  (`type`,`trans_no`),
   KEY `debtor_no` (`debtor_no`,`branch_code`),
   KEY `tran_date` (`tran_date`)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 --
 -- Dumping data for table `0_debtor_trans`
@@ -733,7 +733,7 @@ CREATE TABLE IF NOT EXISTS `0_debtor_trans_details` (
   PRIMARY KEY  (`id`),
   KEY `Transaction` (`debtor_trans_type`,`debtor_trans_no`),
   KEY (`src_id`)
-) TYPE=InnoDB  AUTO_INCREMENT=9 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=9 ;
 
 --
 -- Dumping data for table `0_debtor_trans_details`
@@ -768,7 +768,7 @@ CREATE TABLE IF NOT EXISTS `0_dimensions` (
   KEY `date_` (`date_`),
   KEY `due_date` (`due_date`),
   KEY `type_` (`type_`)
-) TYPE=InnoDB  AUTO_INCREMENT=3 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=3 ;
 
 --
 -- Dumping data for table `0_dimensions`
@@ -792,7 +792,7 @@ CREATE TABLE IF NOT EXISTS `0_exchange_rates` (
   `date_` date NOT NULL default '0000-00-00',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `curr_code` (`curr_code`,`date_`)
-) TYPE=MyISAM  AUTO_INCREMENT=4 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=4 ;
 
 --
 -- Dumping data for table `0_exchange_rates`
@@ -817,14 +817,14 @@ CREATE TABLE IF NOT EXISTS `0_fiscal_year` (
   PRIMARY KEY  (`id`),
   UNIQUE KEY `begin` (`begin`),
   UNIQUE KEY `end` (`end`)
-) TYPE=InnoDB  AUTO_INCREMENT=4 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=4 ;
 
 --
 -- Dumping data for table `0_fiscal_year`
 --
 
-INSERT INTO `0_fiscal_year` VALUES(1, '2008-01-01', '2008-12-31', 0);
-INSERT INTO `0_fiscal_year` VALUES(2, '2009-01-01', '2009-12-31', 0);
+INSERT INTO `0_fiscal_year` VALUES(1, '2008-01-01', '2008-12-31', 1);
+INSERT INTO `0_fiscal_year` VALUES(2, '2009-01-01', '2009-12-31', 1);
 INSERT INTO `0_fiscal_year` VALUES(3, '2010-01-01', '2010-12-31', 0);
 
 --
@@ -850,7 +850,7 @@ CREATE TABLE IF NOT EXISTS `0_gl_trans` (
   KEY `dimension2_id` (`dimension2_id`),
   KEY `tran_date` (`tran_date`),
   KEY `account_and_tran_date` (`account`,`tran_date`)
-) TYPE=InnoDB  AUTO_INCREMENT=84 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=84 ;
 
 --
 -- Dumping data for table `0_gl_trans`
@@ -939,6 +939,8 @@ INSERT INTO `0_gl_trans` VALUES(80, 11, 3, '2009-06-21', '1510', '', 10, 0, 0, 2
 INSERT INTO `0_gl_trans` VALUES(81, 11, 3, '2009-06-21', '4010', '', 50, 2, 0, 2, '3');
 INSERT INTO `0_gl_trans` VALUES(82, 11, 3, '2009-06-21', '1200', '', -52.5, 0, 0, 2, '3');
 INSERT INTO `0_gl_trans` VALUES(83, 11, 3, '2009-06-21', '2150', '', 2.5, 0, 0, 2, '3');
+INSERT INTO `0_gl_trans` VALUES ('84', '0', '20', '2009-12-31', '3590', 'Closing Year', '-91.19', '0', '0', NULL, NULL);
+INSERT INTO `0_gl_trans` VALUES ('85', '0', '20', '2009-12-31', '9990', 'Closing Year', '91.19', '0', '0', NULL, NULL);
 
 -- --------------------------------------------------------
 
@@ -957,7 +959,7 @@ CREATE TABLE IF NOT EXISTS `0_grn_batch` (
   PRIMARY KEY  (`id`),
   KEY `delivery_date` (`delivery_date`),
   KEY `purch_order_no` (`purch_order_no`)
-) TYPE=InnoDB  AUTO_INCREMENT=2 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=2 ;
 
 --
 -- Dumping data for table `0_grn_batch`
@@ -982,7 +984,7 @@ CREATE TABLE IF NOT EXISTS `0_grn_items` (
   `quantity_inv` double NOT NULL default '0',
   PRIMARY KEY  (`id`),
   KEY `grn_batch_id` (`grn_batch_id`)
-) TYPE=InnoDB  AUTO_INCREMENT=4 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=4 ;
 
 --
 -- Dumping data for table `0_grn_items`
@@ -1005,7 +1007,7 @@ CREATE TABLE IF NOT EXISTS `0_groups` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `description` (`description`)
-) TYPE=MyISAM  AUTO_INCREMENT=4 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=4 ;
 
 --
 -- Dumping data for table `0_groups`
@@ -1034,7 +1036,7 @@ CREATE TABLE IF NOT EXISTS `0_item_codes` (
   PRIMARY KEY  (`id`),
   UNIQUE KEY `stock_id` (`stock_id`,`item_code`),
   KEY `item_code` (`item_code`)
-) TYPE=MyISAM  AUTO_INCREMENT=6 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=6 ;
 
 --
 -- Dumping data for table `0_item_codes`
@@ -1060,7 +1062,7 @@ CREATE TABLE IF NOT EXISTS `0_item_tax_types` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `name` (`name`)
-) TYPE=InnoDB  AUTO_INCREMENT=2 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=2 ;
 
 --
 -- Dumping data for table `0_item_tax_types`
@@ -1079,7 +1081,7 @@ CREATE TABLE IF NOT EXISTS `0_item_tax_type_exemptions` (
   `item_tax_type_id` int(11) NOT NULL default '0',
   `tax_type_id` int(11) NOT NULL default '0',
   PRIMARY KEY  (`item_tax_type_id`,`tax_type_id`)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 --
 -- Dumping data for table `0_item_tax_type_exemptions`
@@ -1100,7 +1102,7 @@ CREATE TABLE IF NOT EXISTS `0_item_units` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`abbr`),
   UNIQUE KEY `name` (`name`)
-) TYPE=MyISAM;
+) ENGINE=MyISAM;
 
 --
 -- Dumping data for table `0_item_units`
@@ -1127,7 +1129,7 @@ CREATE TABLE IF NOT EXISTS `0_locations` (
   `contact` varchar(30) NOT NULL default '',
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`loc_code`)
-) TYPE=MyISAM;
+) ENGINE=MyISAM;
 
 --
 -- Dumping data for table `0_locations`
@@ -1148,7 +1150,7 @@ CREATE TABLE IF NOT EXISTS `0_loc_stock` (
   `reorder_level` bigint(20) NOT NULL default '0',
   PRIMARY KEY  (`loc_code`,`stock_id`),
   KEY `stock_id` (`stock_id`)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 --
 -- Dumping data for table `0_loc_stock`
@@ -1173,7 +1175,7 @@ CREATE TABLE IF NOT EXISTS `0_movement_types` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `name` (`name`)
-) TYPE=MyISAM  AUTO_INCREMENT=2 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=2 ;
 
 --
 -- Dumping data for table `0_movement_types`
@@ -1196,7 +1198,7 @@ CREATE TABLE IF NOT EXISTS `0_payment_terms` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`terms_indicator`),
   UNIQUE KEY `terms` (`terms`)
-) TYPE=MyISAM  AUTO_INCREMENT=5 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=5 ;
 
 --
 -- Dumping data for table `0_payment_terms`
@@ -1205,7 +1207,7 @@ CREATE TABLE IF NOT EXISTS `0_payment_terms` (
 INSERT INTO `0_payment_terms` VALUES(1, 'Due 15th Of the Following Month', 0, 17, 0);
 INSERT INTO `0_payment_terms` VALUES(2, 'Due By End Of The Following Month', 0, 30, 0);
 INSERT INTO `0_payment_terms` VALUES(3, 'Payment due within 10 days', 10, 0, 0);
-INSERT INTO `0_payment_terms` VALUES(4, 'Cash Only', 1, 0, 0);
+INSERT INTO `0_payment_terms` VALUES(4, 'Cash Only', 0, 0, 0);
 
 -- --------------------------------------------------------
 
@@ -1222,7 +1224,7 @@ CREATE TABLE IF NOT EXISTS `0_prices` (
   `price` double NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `price` (`stock_id`,`sales_type_id`,`curr_abrev`)
-) TYPE=MyISAM  AUTO_INCREMENT=5 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=5 ;
 
 --
 -- Dumping data for table `0_prices`
@@ -1250,7 +1252,7 @@ CREATE TABLE IF NOT EXISTS `0_printers` (
   `timeout` tinyint(3) unsigned NOT NULL,
   PRIMARY KEY  (`id`),
   UNIQUE KEY `name` (`name`)
-) TYPE=MyISAM  AUTO_INCREMENT=4 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=4 ;
 
 --
 -- Dumping data for table `0_printers`
@@ -1274,7 +1276,7 @@ CREATE TABLE IF NOT EXISTS `0_print_profiles` (
   `printer` tinyint(3) unsigned default NULL,
   PRIMARY KEY  (`id`),
   UNIQUE KEY `profile` (`profile`,`report`)
-) TYPE=MyISAM  AUTO_INCREMENT=10 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=10 ;
 
 --
 -- Dumping data for table `0_print_profiles`
@@ -1305,7 +1307,7 @@ CREATE TABLE IF NOT EXISTS `0_purch_data` (
   `conversion_factor` double NOT NULL default '1',
   `supplier_description` char(50) NOT NULL default '',
   PRIMARY KEY  (`supplier_id`,`stock_id`)
-) TYPE=MyISAM;
+) ENGINE=MyISAM;
 
 --
 -- Dumping data for table `0_purch_data`
@@ -1335,7 +1337,7 @@ CREATE TABLE IF NOT EXISTS `0_purch_orders` (
   `tax_included` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`order_no`),
   KEY `ord_date` (`ord_date`)
-) TYPE=InnoDB  AUTO_INCREMENT=3 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=3 ;
 
 --
 -- Dumping data for table `0_purch_orders`
@@ -1364,8 +1366,9 @@ CREATE TABLE IF NOT EXISTS `0_purch_order_details` (
   `quantity_ordered` double NOT NULL default '0',
   `quantity_received` double NOT NULL default '0',
   PRIMARY KEY  (`po_detail_item`),
-  KEY `order` (`order_no`,`po_detail_item`)
-) TYPE=InnoDB  AUTO_INCREMENT=6 ;
+  KEY `order` (`order_no`,`po_detail_item`),
+  KEY `itemcode` (`item_code`)
+) ENGINE=InnoDB  AUTO_INCREMENT=6 ;
 
 --
 -- Dumping data for table `0_purch_order_details`
@@ -1393,7 +1396,7 @@ CREATE TABLE IF NOT EXISTS `0_quick_entries` (
   `bal_type` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   KEY `description` (`description`)
-) TYPE=MyISAM  AUTO_INCREMENT=4 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=4 ;
 
 --
 -- Dumping data for table `0_quick_entries`
@@ -1420,7 +1423,7 @@ CREATE TABLE IF NOT EXISTS `0_quick_entry_lines` (
   `dimension2_id` smallint(6) unsigned default NULL,
   PRIMARY KEY  (`id`),
   KEY `qid` (`qid`)
-) TYPE=MyISAM  AUTO_INCREMENT=8 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=8 ;
 
 --
 -- Dumping data for table `0_quick_entry_lines`
@@ -1453,7 +1456,7 @@ CREATE TABLE IF NOT EXISTS `0_recurrent_invoices` (
   `last_sent` date NOT NULL default '0000-00-00',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `description` (`description`)
-) TYPE=InnoDB AUTO_INCREMENT=1 ;
+) ENGINE=InnoDB AUTO_INCREMENT=1 ;
 
 --
 -- Dumping data for table `0_recurrent_invoices`
@@ -1473,7 +1476,7 @@ CREATE TABLE IF NOT EXISTS `0_refs` (
   `reference` varchar(100) NOT NULL default '',
   PRIMARY KEY  (`id`,`type`),
   KEY `Type_and_Reference` (`type`,`reference`)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 --
 -- Dumping data for table `0_refs`
@@ -1501,7 +1504,7 @@ CREATE TABLE IF NOT EXISTS `0_salesman` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`salesman_code`),
   UNIQUE KEY `salesman_name` (`salesman_name`)
-) TYPE=MyISAM  AUTO_INCREMENT=2 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=2 ;
 
 --
 -- Dumping data for table `0_salesman`
@@ -1539,7 +1542,7 @@ CREATE TABLE IF NOT EXISTS `0_sales_orders` (
   `payment_terms` int(11) default NULL,
   `total` double NOT NULL default '0',
   PRIMARY KEY  (`trans_type`,`order_no`)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 --
 -- Dumping data for table `0_sales_orders`
@@ -1569,8 +1572,9 @@ CREATE TABLE IF NOT EXISTS `0_sales_order_details` (
   `quantity` double NOT NULL default '0',
   `discount_percent` double NOT NULL default '0',
   PRIMARY KEY  (`id`),
-  KEY `sorder` (`trans_type`,`order_no`)
-) TYPE=InnoDB  AUTO_INCREMENT=6 ;
+  KEY `sorder` (`trans_type`,`order_no`),
+  KEY `stkcode` (`stk_code`)
+) ENGINE=InnoDB  AUTO_INCREMENT=6 ;
 
 --
 -- Dumping data for table `0_sales_order_details`
@@ -1599,7 +1603,7 @@ CREATE TABLE IF NOT EXISTS `0_sales_pos` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `pos_name` (`pos_name`)
-) TYPE=MyISAM  AUTO_INCREMENT=2 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=2 ;
 
 --
 -- Dumping data for table `0_sales_pos`
@@ -1622,7 +1626,7 @@ CREATE TABLE IF NOT EXISTS `0_sales_types` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `sales_type` (`sales_type`)
-) TYPE=MyISAM  AUTO_INCREMENT=3 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=3 ;
 
 --
 -- Dumping data for table `0_sales_types`
@@ -1647,7 +1651,7 @@ CREATE TABLE IF NOT EXISTS `0_security_roles` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `role` (`role`)
-) TYPE=MyISAM  AUTO_INCREMENT=11 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=11 ;
 
 --
 -- Dumping data for table `0_security_roles`
@@ -1681,7 +1685,7 @@ CREATE TABLE IF NOT EXISTS `0_shippers` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`shipper_id`),
   UNIQUE KEY `name` (`shipper_name`)
-) TYPE=MyISAM  AUTO_INCREMENT=2 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=2 ;
 
 --
 -- Dumping data for table `0_shippers`
@@ -1702,7 +1706,7 @@ CREATE TABLE IF NOT EXISTS `0_sql_trail` (
   `result` tinyint(1) NOT NULL,
   `msg` varchar(255) NOT NULL,
   PRIMARY KEY  (`id`)
-) TYPE=MyISAM AUTO_INCREMENT=1 ;
+) ENGINE=MyISAM AUTO_INCREMENT=1 ;
 
 --
 -- Dumping data for table `0_sql_trail`
@@ -1733,7 +1737,7 @@ CREATE TABLE IF NOT EXISTS `0_stock_category` (
   `dflt_no_sale` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`category_id`),
   UNIQUE KEY `description` (`description`)
-) TYPE=MyISAM  AUTO_INCREMENT=5 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=5 ;
 
 --
 -- Dumping data for table `0_stock_category`
@@ -1775,7 +1779,7 @@ CREATE TABLE IF NOT EXISTS `0_stock_master` (
   `no_sale` tinyint(1) NOT NULL default '0',
   `editable` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`stock_id`)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 --
 -- Dumping data for table `0_stock_master`
@@ -1811,7 +1815,7 @@ CREATE TABLE IF NOT EXISTS `0_stock_moves` (
   PRIMARY KEY  (`trans_id`),
   KEY `type` (`type`,`trans_no`),
   KEY `Move` (`stock_id`,`loc_code`,`tran_date`)
-) TYPE=InnoDB  AUTO_INCREMENT=37 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=37 ;
 
 --
 -- Dumping data for table `0_stock_moves`
@@ -1875,6 +1879,7 @@ CREATE TABLE IF NOT EXISTS `0_suppliers` (
   `curr_code` char(3) default NULL,
   `payment_terms` int(11) default NULL,
   `tax_included` tinyint(1) NOT NULL default '0',
+  `tax_algorithm` tinyint(1) NOT NULL default '1',
   `dimension_id` int(11) default '0',
   `dimension2_id` int(11) default '0',
   `tax_group_id` int(11) default NULL,
@@ -1886,15 +1891,15 @@ CREATE TABLE IF NOT EXISTS `0_suppliers` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`supplier_id`),
   KEY `supp_ref` (`supp_ref`)
-) TYPE=MyISAM  AUTO_INCREMENT=4 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=4 ;
 
 --
 -- Dumping data for table `0_suppliers`
 --
 
-INSERT INTO `0_suppliers` VALUES(1, 'Junk Beer ApS', 'Junk Beer', 'Mailing 1\nMailing 2\nMailing 3', 'Address 1\nAddress 2\nAddress 3', '123456', 'Contact', '111', '', '', 'DKK', 3, 0, 1, 0, 2, 1000, '', '2100', '5060', 'A supplier with junk beers.', 0);
-INSERT INTO `0_suppliers` VALUES(2, 'Lucky Luke Inc.', 'Lucky Luke', 'Mailing 1\nMailing 2\nMailing 3', 'Address 1\nAddress 2\nAddress 3', '654321', 'Luke', '333', '', '', 'USD', 3, 0, 0, 0, 1, 500, '', '2100', '5060', '', 0);
-INSERT INTO `0_suppliers` VALUES(3, 'Money Makers Ltd.', 'Money Makers', 'Mailing 1\nMailing 2\nMailing 3', 'Address 1\nAddress 2\nAddress 3', '987654', 'Makers', '222', '', '', 'GBP', 3, 0, 0, 0, 2, 300, '', '2100', '5060', '', 0);
+INSERT INTO `0_suppliers` VALUES(1, 'Junk Beer ApS', 'Junk Beer', 'Mailing 1\nMailing 2\nMailing 3', 'Address 1\nAddress 2\nAddress 3', '123456', 'Contact', '111', '', '', 'DKK', 3, 0, 1, 1, 0, 2, 1000, '', '2100', '5060', 'A supplier with junk beers.', 0);
+INSERT INTO `0_suppliers` VALUES(2, 'Lucky Luke Inc.', 'Lucky Luke', 'Mailing 1\nMailing 2\nMailing 3', 'Address 1\nAddress 2\nAddress 3', '654321', 'Luke', '333', '', '', 'USD', 3, 0, 1, 0, 0, 1, 500, '', '2100', '5060', '', 0);
+INSERT INTO `0_suppliers` VALUES(3, 'Money Makers Ltd.', 'Money Makers', 'Mailing 1\nMailing 2\nMailing 3', 'Address 1\nAddress 2\nAddress 3', '987654', 'Makers', '222', '', '', 'GBP', 3, 0, 1, 0, 0, 2, 300, '', '2100', '5060', '', 0);
 
 -- --------------------------------------------------------
 
@@ -1914,7 +1919,7 @@ CREATE TABLE IF NOT EXISTS `0_supp_allocations` (
   PRIMARY KEY  (`id`),
   KEY `From` (`trans_type_from`,`trans_no_from`),
   KEY `To` (`trans_type_to`,`trans_no_to`)
-) TYPE=InnoDB  AUTO_INCREMENT=2 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=2 ;
 
 --
 -- Dumping data for table `0_supp_allocations`
@@ -1944,7 +1949,7 @@ CREATE TABLE IF NOT EXISTS `0_supp_invoice_items` (
   `memo_` tinytext,
   PRIMARY KEY  (`id`),
   KEY `Transaction` (`supp_trans_type`,`supp_trans_no`,`stock_id`)
-) TYPE=InnoDB  AUTO_INCREMENT=6 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=6 ;
 
 --
 -- Dumping data for table `0_supp_invoice_items`
@@ -1977,20 +1982,21 @@ CREATE TABLE IF NOT EXISTS `0_supp_trans` (
   `rate` double NOT NULL default '1',
   `alloc` double NOT NULL default '0',
   `tax_included` tinyint(1) NOT NULL default '0',
+  `tax_algorihm` tinyint(1) NOT NULL default '1',
   PRIMARY KEY  (`type`,`trans_no`),
   KEY `supplier_id` (`supplier_id`),
   KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
   KEY `type` (`type`),
   KEY `tran_date` (`tran_date`)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 --
 -- Dumping data for table `0_supp_trans`
 --
 
-INSERT INTO `0_supp_trans` VALUES(7, 20, 2, '1', '5t', '2009-06-21', '2009-07-01', 3300, 0, 165, 1, 3465, 0);
-INSERT INTO `0_supp_trans` VALUES(8, 20, 2, '2', 'cc', '2009-06-21', '2009-07-01', 20, 0, 0, 1, 0, 0);
-INSERT INTO `0_supp_trans` VALUES(4, 22, 2, '1', '', '2009-06-21', '2009-06-21', -3465, 0, 0, 1, 3465, 0);
+INSERT INTO `0_supp_trans` VALUES(7, 20, 2, '1', '5t', '2009-06-21', '2009-07-01', 3300, 0, 165, 1, 3465, 0, 1);
+INSERT INTO `0_supp_trans` VALUES(8, 20, 2, '2', 'cc', '2009-06-21', '2009-07-01', 20, 0, 0, 1, 0, 0, 1);
+INSERT INTO `0_supp_trans` VALUES(4, 22, 2, '1', '', '2009-06-21', '2009-06-21', -3465, 0, 0, 1, 3465, 0, 1);
 
 -- --------------------------------------------------------
 
@@ -2004,10 +2010,10 @@ CREATE TABLE IF NOT EXISTS `0_sys_prefs` (
   `category` varchar(30) default NULL,
   `type` varchar(20) NOT NULL default '',
   `length` smallint(6) default NULL,
-  `value` tinytext,
+  `value` text,
   PRIMARY KEY  (`name`),
   KEY `category` (`category`)
-) TYPE=MyISAM;
+) ENGINE=MyISAM;
 
 --
 -- Dumping data for table `0_sys_prefs`
@@ -2040,6 +2046,7 @@ INSERT INTO `0_sys_prefs` VALUES('profit_loss_year_act', 'glsetup.general', 'var
 INSERT INTO `0_sys_prefs` VALUES('retained_earnings_act', 'glsetup.general', 'varchar', 15, '3590');
 INSERT INTO `0_sys_prefs` VALUES('bank_charge_act', 'glsetup.general', 'varchar', 15, '5690');
 INSERT INTO `0_sys_prefs` VALUES('exchange_diff_act', 'glsetup.general', 'varchar', 15, '4450');
+INSERT INTO `0_sys_prefs` VALUES('tax_algorithm', 'glsetup.general', 'tinyint', 1, '1');
 INSERT INTO `0_sys_prefs` VALUES('default_credit_limit', 'glsetup.customer', 'int', 11, '1000');
 INSERT INTO `0_sys_prefs` VALUES('accumulate_shipping', 'glsetup.customer', 'tinyint', 1, '0');
 INSERT INTO `0_sys_prefs` VALUES('legal_text', 'glsetup.customer', 'tinytext', 0, '');
@@ -2063,6 +2070,7 @@ INSERT INTO `0_sys_prefs` VALUES('default_assembly_act', 'glsetup.items', 'varch
 INSERT INTO `0_sys_prefs` VALUES('default_workorder_required', 'glsetup.manuf', 'int', 11, '20');
 INSERT INTO `0_sys_prefs` VALUES('version_id', 'system', 'varchar', 11, '2.3rc');
 INSERT INTO `0_sys_prefs` VALUES('auto_curr_reval', 'setup.company', 'smallint', 6, '1');
+INSERT INTO `0_sys_prefs` VALUES('grn_clearing_act', 'glsetup.purchase', 'varchar', 15, '1550');
 
 -- --------------------------------------------------------
 
@@ -2076,7 +2084,7 @@ CREATE TABLE IF NOT EXISTS `0_sys_types` (
   `type_no` int(11) NOT NULL default '1',
   `next_reference` varchar(100) NOT NULL default '',
   PRIMARY KEY  (`type_id`)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 --
 -- Dumping data for table `0_sys_types`
@@ -2120,7 +2128,7 @@ CREATE TABLE IF NOT EXISTS `0_tags` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `type` (`type`,`name`)
-) TYPE=MyISAM AUTO_INCREMENT=1 ;
+) ENGINE=MyISAM AUTO_INCREMENT=1 ;
 
 --
 -- Dumping data for table `0_tags`
@@ -2138,7 +2146,7 @@ CREATE TABLE IF NOT EXISTS `0_tag_associations` (
   `record_id` varchar(15) NOT NULL,
   `tag_id` int(11) NOT NULL,
   UNIQUE KEY `record_id` (`record_id`,`tag_id`)
-) TYPE=MyISAM;
+) ENGINE=MyISAM;
 
 --
 -- Dumping data for table `0_tag_associations`
@@ -2155,18 +2163,17 @@ DROP TABLE IF EXISTS `0_tax_groups`;
 CREATE TABLE IF NOT EXISTS `0_tax_groups` (
   `id` int(11) NOT NULL auto_increment,
   `name` varchar(60) NOT NULL default '',
-  `tax_shipping` tinyint(1) NOT NULL default '0',
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `name` (`name`)
-) TYPE=InnoDB  AUTO_INCREMENT=3 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=3 ;
 
 --
 -- Dumping data for table `0_tax_groups`
 --
 
-INSERT INTO `0_tax_groups` VALUES(1, 'Tax', 0, 0);
-INSERT INTO `0_tax_groups` VALUES(2, 'Tax Exempt', 0, 0);
+INSERT INTO `0_tax_groups` VALUES(1, 'Tax', 0);
+INSERT INTO `0_tax_groups` VALUES(2, 'Tax Exempt', 0);
 
 -- --------------------------------------------------------
 
@@ -2178,15 +2185,15 @@ DROP TABLE IF EXISTS `0_tax_group_items`;
 CREATE TABLE IF NOT EXISTS `0_tax_group_items` (
   `tax_group_id` int(11) NOT NULL default '0',
   `tax_type_id` int(11) NOT NULL default '0',
-  `rate` double NOT NULL default '0',
+  `tax_shipping` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`tax_group_id`,`tax_type_id`)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 --
 -- Dumping data for table `0_tax_group_items`
 --
 
-INSERT INTO `0_tax_group_items` VALUES(1, 1, 5);
+INSERT INTO `0_tax_group_items` VALUES(1, 1, 1);
 
 -- --------------------------------------------------------
 
@@ -2203,7 +2210,7 @@ CREATE TABLE IF NOT EXISTS `0_tax_types` (
   `name` varchar(60) NOT NULL default '',
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`)
-) TYPE=InnoDB  AUTO_INCREMENT=2 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=2 ;
 
 --
 -- Dumping data for table `0_tax_types`
@@ -2233,7 +2240,7 @@ CREATE TABLE IF NOT EXISTS `0_trans_tax_details` (
   PRIMARY KEY  (`id`),
   KEY `Type_and_Number` (`trans_type`,`trans_no`),
   KEY `tran_date` (`tran_date`)
-) TYPE=InnoDB  AUTO_INCREMENT=12 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=12 ;
 
 --
 -- Dumping data for table `0_trans_tax_details`
@@ -2266,7 +2273,7 @@ CREATE TABLE IF NOT EXISTS `0_useronline` (
   PRIMARY KEY  (`id`),
   KEY `timestamp` (`timestamp`),
   KEY `ip` (`ip`)
-) TYPE=MyISAM AUTO_INCREMENT=1 ;
+) ENGINE=MyISAM AUTO_INCREMENT=1 ;
 
 --
 -- Dumping data for table `0_useronline`
@@ -2313,7 +2320,7 @@ CREATE TABLE IF NOT EXISTS `0_users` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `user_id` (`user_id`)
-) TYPE=MyISAM  AUTO_INCREMENT=3 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=3 ;
 
 --
 -- Dumping data for table `0_users`
@@ -2335,7 +2342,7 @@ CREATE TABLE IF NOT EXISTS `0_voided` (
   `date_` date NOT NULL default '0000-00-00',
   `memo_` tinytext NOT NULL,
   UNIQUE KEY `id` (`type`,`id`)
-) TYPE=InnoDB;
+) ENGINE=InnoDB;
 
 --
 -- Dumping data for table `0_voided`
@@ -2356,7 +2363,7 @@ CREATE TABLE IF NOT EXISTS `0_workcentres` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `name` (`name`)
-) TYPE=MyISAM  AUTO_INCREMENT=2 ;
+) ENGINE=MyISAM  AUTO_INCREMENT=2 ;
 
 --
 -- Dumping data for table `0_workcentres`
@@ -2387,7 +2394,7 @@ CREATE TABLE IF NOT EXISTS `0_workorders` (
   `additional_costs` double NOT NULL default '0',
   PRIMARY KEY  (`id`),
   UNIQUE KEY `wo_ref` (`wo_ref`)
-) TYPE=InnoDB  AUTO_INCREMENT=8 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=8 ;
 
 --
 -- Dumping data for table `0_workorders`
@@ -2417,7 +2424,7 @@ CREATE TABLE IF NOT EXISTS `0_wo_issues` (
   `workcentre_id` int(11) default NULL,
   PRIMARY KEY  (`issue_no`),
   KEY `workorder_id` (`workorder_id`)
-) TYPE=InnoDB AUTO_INCREMENT=1 ;
+) ENGINE=InnoDB AUTO_INCREMENT=1 ;
 
 --
 -- Dumping data for table `0_wo_issues`
@@ -2437,7 +2444,7 @@ CREATE TABLE IF NOT EXISTS `0_wo_issue_items` (
   `issue_id` int(11) default NULL,
   `qty_issued` double default NULL,
   PRIMARY KEY  (`id`)
-) TYPE=InnoDB AUTO_INCREMENT=1 ;
+) ENGINE=InnoDB AUTO_INCREMENT=1 ;
 
 --
 -- Dumping data for table `0_wo_issue_items`
@@ -2459,7 +2466,7 @@ CREATE TABLE IF NOT EXISTS `0_wo_manufacture` (
   `date_` date NOT NULL default '0000-00-00',
   PRIMARY KEY  (`id`),
   KEY `workorder_id` (`workorder_id`)
-) TYPE=InnoDB  AUTO_INCREMENT=2 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=2 ;
 
 --
 -- Dumping data for table `0_wo_manufacture`
@@ -2485,7 +2492,7 @@ CREATE TABLE IF NOT EXISTS `0_wo_requirements` (
   `units_issued` double NOT NULL default '0',
   PRIMARY KEY  (`id`),
   KEY `workorder_id` (`workorder_id`)
-) TYPE=InnoDB  AUTO_INCREMENT=22 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=22 ;
 
 --
 -- Dumping data for table `0_wo_requirements`