SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
-- --------------------------------------------------------
-- Table structure for table `0_areas`
`area_code` int(11) NOT NULL AUTO_INCREMENT,
`description` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`inactive` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`area_code`),
UNIQUE KEY `description` (`description`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
-- Dumping data for table `0_areas`
INSERT INTO `0_areas` VALUES
-- --------------------------------------------------------
-- Table structure for table `0_attachments`
CREATE TABLE `0_attachments` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`description` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`type_no` int(11) NOT NULL DEFAULT '0',
`trans_no` int(11) NOT NULL DEFAULT '0',
`unique_name` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`tran_date` date NOT NULL DEFAULT '0000-00-00',
`filename` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`filesize` int(11) NOT NULL DEFAULT '0',
`filetype` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
KEY `type_no` (`type_no`,`trans_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
-- Table structure for table `0_audit_trail`
CREATE TABLE `0_audit_trail` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` smallint(6) unsigned NOT NULL DEFAULT '0',
`trans_no` int(11) unsigned NOT NULL DEFAULT '0',
`user` smallint(6) unsigned NOT NULL DEFAULT '0',
`stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`description` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL,
`fiscal_year` int(11) NOT NULL DEFAULT '0',
`gl_date` date NOT NULL DEFAULT '0000-00-00',
`gl_seq` int(11) unsigned DEFAULT NULL,
KEY `Seq` (`fiscal_year`,`gl_date`,`gl_seq`),
KEY `Type_and_Number` (`type`,`trans_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
-- Table structure for table `0_bank_accounts`
CREATE TABLE `0_bank_accounts` (
`account_code` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`account_type` smallint(6) NOT NULL DEFAULT '0',
`bank_account_name` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`bank_account_number` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`bank_name` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`bank_address` tinytext COLLATE utf8_unicode_ci,
`bank_curr_code` char(3) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`dflt_curr_act` tinyint(1) NOT NULL DEFAULT '0',
`id` smallint(6) NOT NULL AUTO_INCREMENT,
`bank_charge_act` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`last_reconciled_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`ending_reconcile_balance` double NOT NULL DEFAULT '0',
`inactive` tinyint(1) NOT NULL DEFAULT '0',
KEY `bank_account_name` (`bank_account_name`),
KEY `bank_account_number` (`bank_account_number`),
KEY `account_code` (`account_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;
-- Dumping data for table `0_bank_accounts`
INSERT INTO `0_bank_accounts` VALUES
('1060', 0, 'Current account', 'N/A', 'N/A', NULL, 'USD', 1, 1, '5690', '0000-00-00 00:00:00', 0, 0),
('1065', 3, 'Petty Cash account', 'N/A', 'N/A', NULL, 'USD', 0, 2, '5690', '0000-00-00 00:00:00', 0, 0);
-- --------------------------------------------------------
-- Table structure for table `0_bank_trans`
CREATE TABLE `0_bank_trans` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` smallint(6) DEFAULT NULL,
`trans_no` int(11) DEFAULT NULL,
`bank_act` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`ref` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
`trans_date` date NOT NULL DEFAULT '0000-00-00',
`amount` double DEFAULT NULL,
`dimension_id` int(11) NOT NULL DEFAULT '0',
`dimension2_id` int(11) NOT NULL DEFAULT '0',
`person_type_id` int(11) NOT NULL DEFAULT '0',
`reconciled` date DEFAULT NULL,
KEY `bank_act` (`bank_act`,`ref`),
KEY `type` (`type`,`trans_no`),
KEY `bank_act_2` (`bank_act`,`reconciled`),
KEY `bank_act_3` (`bank_act`,`trans_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
-- Table structure for table `0_bom`
`id` int(11) NOT NULL AUTO_INCREMENT,
`parent` char(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`component` char(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`workcentre_added` int(11) NOT NULL DEFAULT '0',
`loc_code` char(5) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`quantity` double NOT NULL DEFAULT '1',
PRIMARY KEY (`parent`,`component`,`workcentre_added`,`loc_code`),
KEY `component` (`component`),
KEY `loc_code` (`loc_code`),
KEY `parent` (`parent`,`loc_code`),
KEY `workcentre_added` (`workcentre_added`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
-- Table structure for table `0_budget_trans`
CREATE TABLE `0_budget_trans` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tran_date` date NOT NULL DEFAULT '0000-00-00',
`account` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`memo_` tinytext COLLATE utf8_unicode_ci NOT NULL,
`amount` double NOT NULL DEFAULT '0',
`dimension_id` int(11) DEFAULT '0',
`dimension2_id` int(11) DEFAULT '0',
KEY `Account` (`account`,`tran_date`,`dimension_id`,`dimension2_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
-- Table structure for table `0_chart_class`
CREATE TABLE `0_chart_class` (
`cid` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
`class_name` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`ctype` tinyint(1) NOT NULL DEFAULT '0',
`inactive` tinyint(1) NOT NULL DEFAULT '0',
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- Dumping data for table `0_chart_class`
INSERT INTO `0_chart_class` VALUES
('2', 'Liabilities', 2, 0),
-- --------------------------------------------------------
-- Table structure for table `0_chart_master`
CREATE TABLE `0_chart_master` (
`account_code` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`account_code2` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`account_name` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`account_type` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`inactive` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`account_code`),
KEY `account_name` (`account_name`),
KEY `accounts_by_type` (`account_type`,`account_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- Dumping data for table `0_chart_master`
INSERT INTO `0_chart_master` VALUES
('1060', '', 'Checking Account', '1', 0),
('1065', '', 'Petty Cash', '1', 0),
('1200', '', 'Accounts Receivables', '1', 0),
('1205', '', 'Allowance for doubtful accounts', '1', 0),
('1510', '', 'Inventory', '2', 0),
('1520', '', 'Stocks of Raw Materials', '2', 0),
('1530', '', 'Stocks of Work In Progress', '2', 0),
('1540', '', 'Stocks of Finished Goods', '2', 0),
('1550', '', 'Goods Received Clearing account', '2', 0),
('1820', '', 'Office Furniture & Equipment', '3', 0),
('1825', '', 'Accum. Amort. -Furn. & Equip.', '3', 0),
('1840', '', 'Vehicle', '3', 0),
('1845', '', 'Accum. Amort. -Vehicle', '3', 0),
('2100', '', 'Accounts Payable', '4', 0),
('2105', '', 'Deferred Income', '4', 0),
('2110', '', 'Accrued Income Tax - Federal', '4', 0),
('2120', '', 'Accrued Income Tax - State', '4', 0),
('2130', '', 'Accrued Franchise Tax', '4', 0),
('2140', '', 'Accrued Real & Personal Prop Tax', '4', 0),
('2150', '', 'Sales Tax', '4', 0),
('2160', '', 'Accrued Use Tax Payable', '4', 0),
('2210', '', 'Accrued Wages', '4', 0),
('2220', '', 'Accrued Comp Time', '4', 0),
('2230', '', 'Accrued Holiday Pay', '4', 0),
('2240', '', 'Accrued Vacation Pay', '4', 0),
('2310', '', 'Accr. Benefits - 401K', '4', 0),
('2320', '', 'Accr. Benefits - Stock Purchase', '4', 0),
('2330', '', 'Accr. Benefits - Med, Den', '4', 0),
('2340', '', 'Accr. Benefits - Payroll Taxes', '4', 0),
('2350', '', 'Accr. Benefits - Credit Union', '4', 0),
('2360', '', 'Accr. Benefits - Savings Bond', '4', 0),
('2370', '', 'Accr. Benefits - Garnish', '4', 0),
('2380', '', 'Accr. Benefits - Charity Cont.', '4', 0),
('2620', '', 'Bank Loans', '5', 0),
('2680', '', 'Loans from Shareholders', '5', 0),
('3350', '', 'Common Shares', '6', 0),
('3590', '', 'Retained Earnings - prior years', '7', 0),
('4010', '', 'Sales', '8', 0),
('4430', '', 'Shipping & Handling', '9', 0),
('4440', '', 'Interest', '9', 0),
('4450', '', 'Foreign Exchange Gain', '9', 0),
('4500', '', 'Prompt Payment Discounts', '9', 0),
('4510', '', 'Discounts Given', '9', 0),
('5010', '', 'Cost of Goods Sold - Retail', '10', 0),
('5020', '', 'Material Usage Varaiance', '10', 0),
('5030', '', 'Consumable Materials', '10', 0),
('5040', '', 'Purchase price Variance', '10', 0),
('5050', '', 'Purchases of materials', '10', 0),
('5060', '', 'Discounts Received', '10', 0),
('5100', '', 'Freight', '10', 0),
('5410', '', 'Wages & Salaries', '11', 0),
('5420', '', 'Wages - Overtime', '11', 0),
('5430', '', 'Benefits - Comp Time', '11', 0),
('5440', '', 'Benefits - Payroll Taxes', '11', 0),
('5450', '', 'Benefits - Workers Comp', '11', 0),
('5460', '', 'Benefits - Pension', '11', 0),
('5470', '', 'Benefits - General Benefits', '11', 0),
('5510', '', 'Inc Tax Exp - Federal', '11', 0),
('5520', '', 'Inc Tax Exp - State', '11', 0),
('5530', '', 'Taxes - Real Estate', '11', 0),
('5540', '', 'Taxes - Personal Property', '11', 0),
('5550', '', 'Taxes - Franchise', '11', 0),
('5560', '', 'Taxes - Foreign Withholding', '11', 0),
('5610', '', 'Accounting & Legal', '12', 0),
('5615', '', 'Advertising & Promotions', '12', 0),
('5620', '', 'Bad Debts', '12', 0),
('5660', '', 'Amortization Expense', '12', 0),
('5685', '', 'Insurance', '12', 0),
('5690', '', 'Interest & Bank Charges', '12', 0),
('5700', '', 'Office Supplies', '12', 0),
('5760', '', 'Rent', '12', 0),
('5765', '', 'Repair & Maintenance', '12', 0),
('5780', '', 'Telephone', '12', 0),
('5785', '', 'Travel & Entertainment', '12', 0),
('5790', '', 'Utilities', '12', 0),
('5795', '', 'Registrations', '12', 0),
('5800', '', 'Licenses', '12', 0),
('5810', '', 'Foreign Exchange Loss', '12', 0),
('9990', '', 'Year Profit/Loss', '12', 0);
-- --------------------------------------------------------
-- Table structure for table `0_chart_types`
CREATE TABLE `0_chart_types` (
`id` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`class_id` varchar(3) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`parent` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '-1',
`inactive` tinyint(1) NOT NULL DEFAULT '0',
KEY `class_id` (`class_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- Dumping data for table `0_chart_types`
INSERT INTO `0_chart_types` VALUES
('1', 'Current Assets', '1', '', 0),
('10', 'Cost of Goods Sold', '4', '', 0),
('11', 'Payroll Expenses', '4', '', 0),
('12', 'General & Administrative expenses', '4', '', 0),
('2', 'Inventory Assets', '1', '', 0),
('3', 'Capital Assets', '1', '', 0),
('4', 'Current Liabilities', '2', '', 0),
('5', 'Long Term Liabilities', '2', '', 0),
('6', 'Share Capital', '2', '', 0),
('7', 'Retained Earnings', '2', '', 0),
('8', 'Sales Revenue', '3', '', 0),
('9', 'Other Revenue', '3', '', 0);
-- --------------------------------------------------------
-- Table structure for table `0_comments`
CREATE TABLE `0_comments` (
`type` int(11) NOT NULL DEFAULT '0',
`id` int(11) NOT NULL DEFAULT '0',
`date_` date DEFAULT '0000-00-00',
`memo_` tinytext COLLATE utf8_unicode_ci,
KEY `type_and_id` (`type`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
-- Table structure for table `0_credit_status`
CREATE TABLE `0_credit_status` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`reason_description` char(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`dissallow_invoices` tinyint(1) NOT NULL DEFAULT '0',
`inactive` tinyint(1) NOT NULL DEFAULT '0',
UNIQUE KEY `reason_description` (`reason_description`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ;
-- Dumping data for table `0_credit_status`
INSERT INTO `0_credit_status` VALUES
(1, 'Good History', 0, 0),
(3, 'No more work until payment received', 1, 0),
(4, 'In liquidation', 1, 0);
-- --------------------------------------------------------
-- Table structure for table `0_crm_categories`
CREATE TABLE `0_crm_categories` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'pure technical key',
`type` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT 'contact type e.g. customer',
`action` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT 'detailed usage e.g. department',
`name` varchar(30) COLLATE utf8_unicode_ci NOT NULL COMMENT 'for category selector',
`description` tinytext COLLATE utf8_unicode_ci NOT NULL COMMENT 'usage description',
`system` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'nonzero for core system usage',
`inactive` tinyint(1) NOT NULL DEFAULT '0',
UNIQUE KEY `type` (`type`,`action`),
UNIQUE KEY `type_2` (`type`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=13 ;
-- Dumping data for table `0_crm_categories`
INSERT INTO `0_crm_categories` VALUES
(1, 'cust_branch', 'general', 'General', 'General contact data for customer branch (overrides company setting)', 1, 0),
(2, 'cust_branch', 'invoice', 'Invoices', 'Invoice posting (overrides company setting)', 1, 0),
(3, 'cust_branch', 'order', 'Orders', 'Order confirmation (overrides company setting)', 1, 0),
(4, 'cust_branch', 'delivery', 'Deliveries', 'Delivery coordination (overrides company setting)', 1, 0),
(5, 'customer', 'general', 'General', 'General contact data for customer', 1, 0),
(6, 'customer', 'order', 'Orders', 'Order confirmation', 1, 0),
(7, 'customer', 'delivery', 'Deliveries', 'Delivery coordination', 1, 0),
(8, 'customer', 'invoice', 'Invoices', 'Invoice posting', 1, 0),
(9, 'supplier', 'general', 'General', 'General contact data for supplier', 1, 0),
(10, 'supplier', 'order', 'Orders', 'Order confirmation', 1, 0),
(11, 'supplier', 'delivery', 'Deliveries', 'Delivery coordination', 1, 0),
(12, 'supplier', 'invoice', 'Invoices', 'Invoice posting', 1, 0);
-- --------------------------------------------------------
-- Table structure for table `0_crm_contacts`
CREATE TABLE `0_crm_contacts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`person_id` int(11) NOT NULL DEFAULT '0' COMMENT 'foreign key to crm_persons',
`type` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT 'foreign key to crm_categories',
`action` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT 'foreign key to crm_categories',
`entity_id` varchar(11) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'entity id in related class table',
KEY `type` (`type`,`action`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
-- Table structure for table `0_crm_persons`
CREATE TABLE `0_crm_persons` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ref` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
`name2` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL,
`address` tinytext COLLATE utf8_unicode_ci,
`phone` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
`phone2` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
`fax` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
`email` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`lang` char(5) COLLATE utf8_unicode_ci DEFAULT NULL,
`notes` tinytext COLLATE utf8_unicode_ci NOT NULL,
`inactive` tinyint(1) NOT NULL DEFAULT '0',
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
-- Table structure for table `0_currencies`
CREATE TABLE `0_currencies` (
`currency` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`curr_abrev` char(3) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`curr_symbol` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`country` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`hundreds_name` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`auto_update` tinyint(1) NOT NULL DEFAULT '1',
`inactive` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`curr_abrev`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- Dumping data for table `0_currencies`
INSERT INTO `0_currencies` VALUES
('CA Dollars', 'CAD', '$', 'Canada', 'Cents', 1, 0),
('Euro', 'EUR', '€', 'Europe', 'Cents', 1, 0),
('Pounds', 'GBP', '£', 'England', 'Pence', 1, 0),
('US Dollars', 'USD', '$', 'United States', 'Cents', 1, 0);
-- --------------------------------------------------------
-- Table structure for table `0_cust_allocations`
CREATE TABLE `0_cust_allocations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`person_id` int(11) DEFAULT NULL,
`amt` double unsigned DEFAULT NULL,
`date_alloc` date NOT NULL DEFAULT '0000-00-00',
`trans_no_from` int(11) DEFAULT NULL,
`trans_type_from` int(11) DEFAULT NULL,
`trans_no_to` int(11) DEFAULT NULL,
`trans_type_to` int(11) DEFAULT NULL,
UNIQUE KEY `trans_type_from` (`person_id`,`trans_type_from`,`trans_no_from`,`trans_type_to`,`trans_no_to`),
KEY `From` (`trans_type_from`,`trans_no_from`),
KEY `To` (`trans_type_to`,`trans_no_to`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------