Fixed buggy prefix in sql query in 2.1 upgrade class.
[fa-stable.git] / sql / en_US-demo.sql
index 21dbbbcc354ba4e23f8be3b4fe0085864bae4fb7..ceaab19592c45ac46a2dbdbf00739b7a90d389e6 100644 (file)
@@ -851,13 +851,14 @@ CREATE TABLE IF NOT EXISTS `0_fiscal_year` (
   PRIMARY KEY (`id`),
   UNIQUE KEY `begin` (`begin`),
   UNIQUE KEY `end` (`end`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 ;
+) ENGINE=InnoDB AUTO_INCREMENT=3 ;
 
 --
 -- Dumping data for table `0_fiscal_year`
 --
 
 INSERT INTO `0_fiscal_year` VALUES (1, '2015-01-01', '2015-12-31', 0);
+INSERT INTO `0_fiscal_year` VALUES (2, '2016-01-01', '2016-12-31', 0);
 
 -- --------------------------------------------------------
 
@@ -1477,7 +1478,7 @@ INSERT INTO `0_recurrent_invoices` VALUES ('1', 'Weekly Maintenance', '6', '1',
 -- --------------------------------------------------------
 
 --
---- Table structure for table `0_reflines`
+-- Table structure for table `0_reflines`
 --
 
 DROP TABLE IF EXISTS `0_reflines`;
@@ -1495,7 +1496,7 @@ CREATE TABLE `0_reflines` (
 ) ENGINE=InnoDB AUTO_INCREMENT=23;
 
 --
---- Dumping data for table `0_reflines`
+-- Dumping data for table `0_reflines`
 --
 
 INSERT INTO `0_reflines` VALUES
@@ -1817,7 +1818,7 @@ CREATE TABLE IF NOT EXISTS `0_stock_category` (
   `dflt_cogs_act` varchar(15) NOT NULL DEFAULT '',
   `dflt_inventory_act` varchar(15) NOT NULL DEFAULT '',
   `dflt_adjustment_act` varchar(15) NOT NULL DEFAULT '',
-  `dflt_assembly_act` varchar(15) NOT NULL DEFAULT '',
+  `dflt_wip_act` varchar(15) NOT NULL DEFAULT '',
   `dflt_dim1` int(11) DEFAULT NULL,
   `dflt_dim2` int(11) DEFAULT NULL,
   `inactive` tinyint(1) NOT NULL DEFAULT '0',
@@ -1848,9 +1849,7 @@ CREATE TABLE `0_stock_fa_class` (
   `parent_id` varchar(20) NOT NULL DEFAULT '',
   `description` varchar(200) NOT NULL DEFAULT '',
   `long_description` tinytext NOT NULL,
-  `depreciation_method` char(1) NOT NULL DEFAULT 'D',
   `depreciation_rate` double NOT NULL DEFAULT '0',
-  `depreciation_period` tinyint(1) NOT NULL DEFAULT '0',
   `inactive` tinyint(1) NOT NULL DEFAULT '0',
   PRIMARY KEY (`fa_class_id`)
 ) ENGINE=InnoDB;
@@ -1874,11 +1873,10 @@ CREATE TABLE IF NOT EXISTS `0_stock_master` (
   `cogs_account` varchar(15) NOT NULL DEFAULT '',
   `inventory_account` varchar(15) NOT NULL DEFAULT '',
   `adjustment_account` varchar(15) NOT NULL DEFAULT '',
-  `assembly_account` varchar(15) NOT NULL DEFAULT '',
+  `wip_account` varchar(15) NOT NULL DEFAULT '',
   `dimension_id` int(11) DEFAULT NULL,
   `dimension2_id` int(11) DEFAULT NULL,
-  `actual_cost` double NOT NULL DEFAULT '0',
-  `last_cost` double NOT NULL DEFAULT '0',
+  `purchase_cost` double NOT NULL DEFAULT '0',
   `material_cost` double NOT NULL DEFAULT '0',
   `labour_cost` double NOT NULL DEFAULT '0',
   `overhead_cost` double NOT NULL DEFAULT '0',
@@ -1886,8 +1884,9 @@ CREATE TABLE IF NOT EXISTS `0_stock_master` (
   `no_sale` tinyint(1) NOT NULL DEFAULT '0',
   `no_purchase` tinyint(1) NOT NULL DEFAULT '0',
   `editable` tinyint(1) NOT NULL DEFAULT '0',
-  `depreciation_method` char(1) NOT NULL DEFAULT 'D',
+  `depreciation_method` char(1) NOT NULL DEFAULT 'S',
   `depreciation_rate` double NOT NULL DEFAULT '0',
+  `depreciation_factor` double NOT NULL DEFAULT '1',
   `depreciation_start` date NOT NULL DEFAULT '0000-00-00',
   `depreciation_date` date NOT NULL DEFAULT '0000-00-00',
   `fa_class_id` varchar(20) NOT NULL DEFAULT '',
@@ -1899,12 +1898,12 @@ CREATE TABLE IF NOT EXISTS `0_stock_master` (
 --
 
 INSERT INTO `0_stock_master` VALUES
-('101', '1', '1', 'iPad Air 2 16GB', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '200', '0', '0', '0', '0', '0', '0', 'D', '0', '0000-00-00', '0000-00-00', ''),
-('102', '1', '1', 'iPhone 6 64GB', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '150', '0', '0', '0', '0', '0', '0', 'D', '0', '0000-00-00', '0000-00-00', ''),
-('103', '1', '1', 'iPhone Cover Case', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '10', '0', '0', '0', '0', '0', '0', 'D', '0', '0000-00-00', '0000-00-00', ''),
-('201', '3', '1', 'AP Surf Set', '', 'each', 'M', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '360', '0', '0', '0', '0', '0', '0', 'D', '0', '0000-00-00', '0000-00-00', ''),
-('202', '4', '1', 'Maintenance', '', 'hr', 'D', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', 'D', '0', '0000-00-00', '0000-00-00', ''),
-('301', '4', '1', 'Support', '', 'hr', 'D', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'D', '0', '0000-00-00', '0000-00-00', '');
+('101', '1', '1', 'iPad Air 2 16GB', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '200', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''),
+('102', '1', '1', 'iPhone 6 64GB', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '150', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''),
+('103', '1', '1', 'iPhone Cover Case', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0',  '0', '10', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''),
+('201', '3', '1', 'AP Surf Set', '', 'each', 'M', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '360', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''),
+('202', '4', '1', 'Maintenance', '', 'hr', 'D', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', 'S', '0', '1', '0000-00-00', '0000-00-00', ''),
+('301', '4', '1', 'Support', '', 'hr', 'D', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', '');
 
 -- --------------------------------------------------------
 
@@ -2153,9 +2152,9 @@ INSERT INTO `0_sys_prefs` VALUES ('default_inventory_act', 'glsetup.items', 'var
 INSERT INTO `0_sys_prefs` VALUES ('default_cogs_act', 'glsetup.items', 'varchar', 15, '5010');
 INSERT INTO `0_sys_prefs` VALUES ('default_adj_act', 'glsetup.items', 'varchar', 15, '5040');
 INSERT INTO `0_sys_prefs` VALUES ('default_inv_sales_act', 'glsetup.items', 'varchar', 15, '4010');
-INSERT INTO `0_sys_prefs` VALUES ('default_assembly_act', 'glsetup.items', 'varchar', 15, '1530');
+INSERT INTO `0_sys_prefs` VALUES ('default_wip_act', 'glsetup.items', 'varchar', 15, '1530');
 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.4.0');
+INSERT INTO `0_sys_prefs` VALUES ('version_id', 'system', 'varchar', 11, '2.4.1');
 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');
 INSERT INTO `0_sys_prefs` VALUES ('bcc_email', 'setup.company', 'varchar', 100, '');
@@ -2172,6 +2171,8 @@ INSERT INTO `0_sys_prefs` VALUES ('print_item_images_on_quote','glsetup.inventor
 INSERT INTO `0_sys_prefs` VALUES ('suppress_tax_rates','setup.company', 'tinyint', 1, '0');
 INSERT INTO `0_sys_prefs` VALUES ('default_loss_on_asset_disposal_act', 'glsetup.items', 'varchar', '15', '5660');
 INSERT INTO `0_sys_prefs` VALUES ('depreciation_period', 'glsetup.company', 'tinyint', '1', '1');
+INSERT INTO `0_sys_prefs` VALUES ('use_manufacturing','setup.company', 'tinyint', 1, '1');
+INSERT INTO `0_sys_prefs` VALUES ('use_fixed_assets','setup.company', 'tinyint', 1, '1');
 
 
 -- --------------------------------------------------------
@@ -2519,6 +2520,7 @@ CREATE TABLE IF NOT EXISTS `0_wo_issue_items` (
   `stock_id` varchar(40) DEFAULT NULL,
   `issue_id` int(11) DEFAULT NULL,
   `qty_issued` double DEFAULT NULL,
+  `unit_cost` double NOT NULL default '0',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB;
 
@@ -2560,7 +2562,7 @@ CREATE TABLE IF NOT EXISTS `0_wo_requirements` (
   `stock_id` char(20) NOT NULL DEFAULT '',
   `workcentre` int(11) NOT NULL DEFAULT '0',
   `units_req` double NOT NULL DEFAULT '1',
-  `std_cost` double NOT NULL DEFAULT '0',
+  `unit_cost` double NOT NULL DEFAULT '0',
   `loc_code` char(5) NOT NULL DEFAULT '',
   `units_issued` double NOT NULL DEFAULT '0',
   PRIMARY KEY (`id`),