2 -- version 2.11.8.1deb5
3 -- http://www.phpmyadmin.net
6 -- Generation Time: Sep 26, 2014 at 11:37 AM
7 -- Server version: 5.0.51
8 -- PHP Version: 5.2.6-1+lenny2
14 -- --------------------------------------------------------
17 -- Table structure for table `0_areas`
20 DROP TABLE IF EXISTS `0_areas`;
21 CREATE TABLE IF NOT EXISTS `0_areas` (
22 `area_code` int(11) NOT NULL auto_increment,
23 `description` varchar(60) NOT NULL default '',
24 `inactive` tinyint(1) NOT NULL default '0',
25 PRIMARY KEY (`area_code`),
26 UNIQUE KEY `description` (`description`)
27 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
30 -- Dumping data for table `0_areas`
33 INSERT INTO `0_areas` VALUES(1, 'Global', 0);
35 -- --------------------------------------------------------
38 -- Table structure for table `0_attachments`
41 DROP TABLE IF EXISTS `0_attachments`;
42 CREATE TABLE IF NOT EXISTS `0_attachments` (
43 `id` int(11) unsigned NOT NULL auto_increment,
44 `description` varchar(60) NOT NULL default '',
45 `type_no` int(11) NOT NULL default '0',
46 `trans_no` int(11) NOT NULL default '0',
47 `unique_name` varchar(60) NOT NULL default '',
48 `tran_date` date NOT NULL default '0000-00-00',
49 `filename` varchar(60) NOT NULL default '',
50 `filesize` int(11) NOT NULL default '0',
51 `filetype` varchar(60) NOT NULL default '',
53 KEY `type_no` (`type_no`,`trans_no`)
54 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
57 -- Dumping data for table `0_attachments`
61 -- --------------------------------------------------------
64 -- Table structure for table `0_audit_trail`
67 DROP TABLE IF EXISTS `0_audit_trail`;
68 CREATE TABLE IF NOT EXISTS `0_audit_trail` (
69 `id` int(11) NOT NULL auto_increment,
70 `type` smallint(6) unsigned NOT NULL default '0',
71 `trans_no` int(11) unsigned NOT NULL default '0',
72 `user` smallint(6) unsigned NOT NULL default '0',
73 `stamp` timestamp NOT NULL,
74 `description` varchar(60) default NULL,
75 `fiscal_year` int(11) NOT NULL default 0,
76 `gl_date` date NOT NULL default '0000-00-00',
77 `gl_seq` int(11) unsigned default NULL,
79 KEY `Seq` (`fiscal_year`,`gl_date`,`gl_seq`),
80 KEY `Type_and_Number` (`type`,`trans_no`)
81 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
84 -- Dumping data for table `0_audit_trail`
88 -- --------------------------------------------------------
91 -- Table structure for table `0_bank_accounts`
94 DROP TABLE IF EXISTS `0_bank_accounts`;
95 CREATE TABLE IF NOT EXISTS `0_bank_accounts` (
96 `account_code` varchar(15) NOT NULL default '',
97 `account_type` smallint(6) NOT NULL default '0',
98 `bank_account_name` varchar(60) NOT NULL default '',
99 `bank_account_number` varchar(100) NOT NULL default '',
100 `bank_name` varchar(60) NOT NULL default '',
101 `bank_address` tinytext,
102 `bank_curr_code` char(3) NOT NULL default '',
103 `dflt_curr_act` tinyint(1) NOT NULL default '0',
104 `id` smallint(6) NOT NULL auto_increment,
105 `bank_charge_act` varchar(15) NOT NULL default '',
106 `last_reconciled_date` timestamp NOT NULL default '0000-00-00 00:00:00',
107 `ending_reconcile_balance` double NOT NULL default '0',
108 `inactive` tinyint(1) NOT NULL default '0',
110 KEY `bank_account_name` (`bank_account_name`),
111 KEY `bank_account_number` (`bank_account_number`),
112 KEY `account_code` (`account_code`)
113 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
116 -- Dumping data for table `0_bank_accounts`
119 INSERT INTO `0_bank_accounts` VALUES('1060', 0, 'Current account', 'N/A', 'N/A', '', 'USD', 1, 1, '5690', '0000-00-00 00:00:00', 0, 0);
120 INSERT INTO `0_bank_accounts` VALUES('1065', 3, 'Petty Cash account', 'N/A', 'N/A', '', 'USD', 0, 2, '5690', '0000-00-00 00:00:00', 0, 0);
122 -- --------------------------------------------------------
125 -- Table structure for table `0_bank_trans`
128 DROP TABLE IF EXISTS `0_bank_trans`;
129 CREATE TABLE IF NOT EXISTS `0_bank_trans` (
130 `id` int(11) NOT NULL auto_increment,
131 `type` smallint(6) default NULL,
132 `trans_no` int(11) default NULL,
133 `bank_act` varchar(15) NOT NULL default '',
134 `ref` varchar(40) default NULL,
135 `trans_date` date NOT NULL default '0000-00-00',
136 `amount` double default NULL,
137 `dimension_id` int(11) NOT NULL default '0',
138 `dimension2_id` int(11) NOT NULL default '0',
139 `person_type_id` int(11) NOT NULL default '0',
140 `person_id` tinyblob,
141 `reconciled` date default NULL,
143 KEY `bank_act` (`bank_act`,`ref`),
144 KEY `type` (`type`,`trans_no`),
145 KEY `bank_act_2` (`bank_act`,`reconciled`),
146 KEY `bank_act_3` (`bank_act`,`trans_date`)
147 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
150 -- Dumping data for table `0_bank_trans`
154 -- --------------------------------------------------------
157 -- Table structure for table `0_bom`
160 DROP TABLE IF EXISTS `0_bom`;
161 CREATE TABLE IF NOT EXISTS `0_bom` (
162 `id` int(11) NOT NULL auto_increment,
163 `parent` char(20) NOT NULL default '',
164 `component` char(20) NOT NULL default '',
165 `workcentre_added` int(11) NOT NULL default '0',
166 `loc_code` char(5) NOT NULL default '',
167 `quantity` double NOT NULL default '1',
168 PRIMARY KEY (`parent`,`component`,`workcentre_added`,`loc_code`),
169 KEY `component` (`component`),
171 KEY `loc_code` (`loc_code`),
172 KEY `parent` (`parent`,`loc_code`),
173 KEY `workcentre_added` (`workcentre_added`)
174 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
177 -- Dumping data for table `0_bom`
181 -- --------------------------------------------------------
184 -- Table structure for table `0_budget_trans`
187 DROP TABLE IF EXISTS `0_budget_trans`;
188 CREATE TABLE IF NOT EXISTS `0_budget_trans` (
189 `id` int(11) NOT NULL auto_increment,
190 `tran_date` date NOT NULL default '0000-00-00',
191 `account` varchar(15) NOT NULL default '',
192 `memo_` tinytext NOT NULL,
193 `amount` double NOT NULL default '0',
194 `dimension_id` int(11) default '0',
195 `dimension2_id` int(11) default '0',
197 KEY `Account` (`account`,`tran_date`,`dimension_id`,`dimension2_id`)
198 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
201 -- Dumping data for table `0_budget_trans`
205 -- --------------------------------------------------------
208 -- Table structure for table `0_chart_class`
211 DROP TABLE IF EXISTS `0_chart_class`;
212 CREATE TABLE IF NOT EXISTS `0_chart_class` (
213 `cid` varchar(3) NOT NULL,
214 `class_name` varchar(60) NOT NULL default '',
215 `ctype` tinyint(1) NOT NULL default '0',
216 `inactive` tinyint(1) NOT NULL default '0',
218 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
221 -- Dumping data for table `0_chart_class`
224 INSERT INTO `0_chart_class` VALUES('1', 'Assets', 1, 0);
225 INSERT INTO `0_chart_class` VALUES('2', 'Liabilities', 2, 0);
226 INSERT INTO `0_chart_class` VALUES('3', 'Income', 4, 0);
227 INSERT INTO `0_chart_class` VALUES('4', 'Costs', 6, 0);
229 -- --------------------------------------------------------
232 -- Table structure for table `0_chart_master`
235 DROP TABLE IF EXISTS `0_chart_master`;
236 CREATE TABLE IF NOT EXISTS `0_chart_master` (
237 `account_code` varchar(15) NOT NULL default '',
238 `account_code2` varchar(15) NOT NULL default '',
239 `account_name` varchar(60) NOT NULL default '',
240 `account_type` varchar(10) NOT NULL default '0',
241 `inactive` tinyint(1) NOT NULL default '0',
242 PRIMARY KEY (`account_code`),
243 KEY `account_name` (`account_name`),
244 KEY `accounts_by_type` (`account_type`,`account_code`)
245 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
248 -- Dumping data for table `0_chart_master`
251 INSERT INTO `0_chart_master` VALUES('1060', '', 'Checking Account', '1', 0);
252 INSERT INTO `0_chart_master` VALUES('1065', '', 'Petty Cash', '1', 0);
253 INSERT INTO `0_chart_master` VALUES('1200', '', 'Accounts Receivables', '1', 0);
254 INSERT INTO `0_chart_master` VALUES('1205', '', 'Allowance for doubtful accounts', '1', 0);
255 INSERT INTO `0_chart_master` VALUES('1510', '', 'Inventory', '2', 0);
256 INSERT INTO `0_chart_master` VALUES('1520', '', 'Stocks of Raw Materials', '2', 0);
257 INSERT INTO `0_chart_master` VALUES('1530', '', 'Stocks of Work In Progress', '2', 0);
258 INSERT INTO `0_chart_master` VALUES('1540', '', 'Stocks of Finsihed Goods', '2', 0);
259 INSERT INTO `0_chart_master` VALUES('1550', '', 'Goods Received Clearing account', '2', 0);
260 INSERT INTO `0_chart_master` VALUES('1820', '', 'Office Furniture & Equipment', '3', 0);
261 INSERT INTO `0_chart_master` VALUES('1825', '', 'Accum. Amort. -Furn. & Equip.', '3', 0);
262 INSERT INTO `0_chart_master` VALUES('1840', '', 'Vehicle', '3', 0);
263 INSERT INTO `0_chart_master` VALUES('1845', '', 'Accum. Amort. -Vehicle', '3', 0);
264 INSERT INTO `0_chart_master` VALUES('2100', '', 'Accounts Payable', '4', 0);
265 INSERT INTO `0_chart_master` VALUES('2110', '', 'Accrued Income Tax - Federal', '4', 0);
266 INSERT INTO `0_chart_master` VALUES('2120', '', 'Accrued Income Tax - State', '4', 0);
267 INSERT INTO `0_chart_master` VALUES('2130', '', 'Accrued Franchise Tax', '4', 0);
268 INSERT INTO `0_chart_master` VALUES('2140', '', 'Accrued Real & Personal Prop Tax', '4', 0);
269 INSERT INTO `0_chart_master` VALUES('2150', '', 'Sales Tax', '4', 0);
270 INSERT INTO `0_chart_master` VALUES('2160', '', 'Accrued Use Tax Payable', '4', 0);
271 INSERT INTO `0_chart_master` VALUES('2210', '', 'Accrued Wages', '4', 0);
272 INSERT INTO `0_chart_master` VALUES('2220', '', 'Accrued Comp Time', '4', 0);
273 INSERT INTO `0_chart_master` VALUES('2230', '', 'Accrued Holiday Pay', '4', 0);
274 INSERT INTO `0_chart_master` VALUES('2240', '', 'Accrued Vacation Pay', '4', 0);
275 INSERT INTO `0_chart_master` VALUES('2310', '', 'Accr. Benefits - 401K', '4', 0);
276 INSERT INTO `0_chart_master` VALUES('2320', '', 'Accr. Benefits - Stock Purchase', '4', 0);
277 INSERT INTO `0_chart_master` VALUES('2330', '', 'Accr. Benefits - Med, Den', '4', 0);
278 INSERT INTO `0_chart_master` VALUES('2340', '', 'Accr. Benefits - Payroll Taxes', '4', 0);
279 INSERT INTO `0_chart_master` VALUES('2350', '', 'Accr. Benefits - Credit Union', '4', 0);
280 INSERT INTO `0_chart_master` VALUES('2360', '', 'Accr. Benefits - Savings Bond', '4', 0);
281 INSERT INTO `0_chart_master` VALUES('2370', '', 'Accr. Benefits - Garnish', '4', 0);
282 INSERT INTO `0_chart_master` VALUES('2380', '', 'Accr. Benefits - Charity Cont.', '4', 0);
283 INSERT INTO `0_chart_master` VALUES('2620', '', 'Bank Loans', '5', 0);
284 INSERT INTO `0_chart_master` VALUES('2680', '', 'Loans from Shareholders', '5', 0);
285 INSERT INTO `0_chart_master` VALUES('3350', '', 'Common Shares', '6', 0);
286 INSERT INTO `0_chart_master` VALUES('3590', '', 'Retained Earnings - prior years', '7', 0);
287 INSERT INTO `0_chart_master` VALUES('4010', '', 'Sales', '8', 0);
288 INSERT INTO `0_chart_master` VALUES('4430', '', 'Shipping & Handling', '9', 0);
289 INSERT INTO `0_chart_master` VALUES('4440', '', 'Interest', '9', 0);
290 INSERT INTO `0_chart_master` VALUES('4450', '', 'Foreign Exchange Gain', '9', 0);
291 INSERT INTO `0_chart_master` VALUES('4500', '', 'Prompt Payment Discounts', '9', 0);
292 INSERT INTO `0_chart_master` VALUES('4510', '', 'Discounts Given', '9', 0);
293 INSERT INTO `0_chart_master` VALUES('5010', '', 'Cost of Goods Sold - Retail', '10', 0);
294 INSERT INTO `0_chart_master` VALUES('5020', '', 'Material Usage Varaiance', '10', 0);
295 INSERT INTO `0_chart_master` VALUES('5030', '', 'Consumable Materials', '10', 0);
296 INSERT INTO `0_chart_master` VALUES('5040', '', 'Purchase price Variance', '10', 0);
297 INSERT INTO `0_chart_master` VALUES('5050', '', 'Purchases of materials', '10', 0);
298 INSERT INTO `0_chart_master` VALUES('5060', '', 'Discounts Received', '10', 0);
299 INSERT INTO `0_chart_master` VALUES('5100', '', 'Freight', '10', 0);
300 INSERT INTO `0_chart_master` VALUES('5410', '', 'Wages & Salaries', '11', 0);
301 INSERT INTO `0_chart_master` VALUES('5420', '', 'Wages - Overtime', '11', 0);
302 INSERT INTO `0_chart_master` VALUES('5430', '', 'Benefits - Comp Time', '11', 0);
303 INSERT INTO `0_chart_master` VALUES('5440', '', 'Benefits - Payroll Taxes', '11', 0);
304 INSERT INTO `0_chart_master` VALUES('5450', '', 'Benefits - Workers Comp', '11', 0);
305 INSERT INTO `0_chart_master` VALUES('5460', '', 'Benefits - Pension', '11', 0);
306 INSERT INTO `0_chart_master` VALUES('5470', '', 'Benefits - General Benefits', '11', 0);
307 INSERT INTO `0_chart_master` VALUES('5510', '', 'Inc Tax Exp - Federal', '11', 0);
308 INSERT INTO `0_chart_master` VALUES('5520', '', 'Inc Tax Exp - State', '11', 0);
309 INSERT INTO `0_chart_master` VALUES('5530', '', 'Taxes - Real Estate', '11', 0);
310 INSERT INTO `0_chart_master` VALUES('5540', '', 'Taxes - Personal Property', '11', 0);
311 INSERT INTO `0_chart_master` VALUES('5550', '', 'Taxes - Franchise', '11', 0);
312 INSERT INTO `0_chart_master` VALUES('5560', '', 'Taxes - Foreign Withholding', '11', 0);
313 INSERT INTO `0_chart_master` VALUES('5610', '', 'Accounting & Legal', '12', 0);
314 INSERT INTO `0_chart_master` VALUES('5615', '', 'Advertising & Promotions', '12', 0);
315 INSERT INTO `0_chart_master` VALUES('5620', '', 'Bad Debts', '12', 0);
316 INSERT INTO `0_chart_master` VALUES('5660', '', 'Amortization Expense', '12', 0);
317 INSERT INTO `0_chart_master` VALUES('5685', '', 'Insurance', '12', 0);
318 INSERT INTO `0_chart_master` VALUES('5690', '', 'Interest & Bank Charges', '12', 0);
319 INSERT INTO `0_chart_master` VALUES('5700', '', 'Office Supplies', '12', 0);
320 INSERT INTO `0_chart_master` VALUES('5760', '', 'Rent', '12', 0);
321 INSERT INTO `0_chart_master` VALUES('5765', '', 'Repair & Maintenance', '12', 0);
322 INSERT INTO `0_chart_master` VALUES('5780', '', 'Telephone', '12', 0);
323 INSERT INTO `0_chart_master` VALUES('5785', '', 'Travel & Entertainment', '12', 0);
324 INSERT INTO `0_chart_master` VALUES('5790', '', 'Utilities', '12', 0);
325 INSERT INTO `0_chart_master` VALUES('5795', '', 'Registrations', '12', 0);
326 INSERT INTO `0_chart_master` VALUES('5800', '', 'Licenses', '12', 0);
327 INSERT INTO `0_chart_master` VALUES('5810', '', 'Foreign Exchange Loss', '12', 0);
328 INSERT INTO `0_chart_master` VALUES('9990', '', 'Year Profit/Loss', '12', 0);
330 -- --------------------------------------------------------
333 -- Table structure for table `0_chart_types`
336 DROP TABLE IF EXISTS `0_chart_types`;
337 CREATE TABLE IF NOT EXISTS `0_chart_types` (
338 `id` varchar(10) NOT NULL,
339 `name` varchar(60) NOT NULL default '',
340 `class_id` varchar(3) NOT NULL default '',
341 `parent` varchar(10) NOT NULL default '-1',
342 `inactive` tinyint(1) NOT NULL default '0',
345 KEY `class_id` (`class_id`)
346 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
349 -- Dumping data for table `0_chart_types`
352 INSERT INTO `0_chart_types` VALUES('1', 'Current Assets', '1', '', 0);
353 INSERT INTO `0_chart_types` VALUES('2', 'Inventory Assets', '1', '', 0);
354 INSERT INTO `0_chart_types` VALUES('3', 'Capital Assets', '1', '', 0);
355 INSERT INTO `0_chart_types` VALUES('4', 'Current Liabilities', '2', '', 0);
356 INSERT INTO `0_chart_types` VALUES('5', 'Long Term Liabilities', '2', '', 0);
357 INSERT INTO `0_chart_types` VALUES('6', 'Share Capital', '2', '', 0);
358 INSERT INTO `0_chart_types` VALUES('7', 'Retained Earnings', '2', '', 0);
359 INSERT INTO `0_chart_types` VALUES('8', 'Sales Revenue', '3', '', 0);
360 INSERT INTO `0_chart_types` VALUES('9', 'Other Revenue', '3', '', 0);
361 INSERT INTO `0_chart_types` VALUES('10', 'Cost of Goods Sold', '4', '', 0);
362 INSERT INTO `0_chart_types` VALUES('11', 'Payroll Expenses', '4', '', 0);
363 INSERT INTO `0_chart_types` VALUES('12', 'General & Administrative expenses', '4', '', 0);
365 -- --------------------------------------------------------
368 -- Table structure for table `0_comments`
371 DROP TABLE IF EXISTS `0_comments`;
372 CREATE TABLE IF NOT EXISTS `0_comments` (
373 `type` int(11) NOT NULL default '0',
374 `id` int(11) NOT NULL default '0',
375 `date_` date default '0000-00-00',
377 KEY `type_and_id` (`type`,`id`)
378 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
381 -- Dumping data for table `0_comments`
385 -- --------------------------------------------------------
388 -- Table structure for table `0_credit_status`
391 DROP TABLE IF EXISTS `0_credit_status`;
392 CREATE TABLE IF NOT EXISTS `0_credit_status` (
393 `id` int(11) NOT NULL auto_increment,
394 `reason_description` char(100) NOT NULL default '',
395 `dissallow_invoices` tinyint(1) NOT NULL default '0',
396 `inactive` tinyint(1) NOT NULL default '0',
398 UNIQUE KEY `reason_description` (`reason_description`)
399 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
402 -- Dumping data for table `0_credit_status`
405 INSERT INTO `0_credit_status` VALUES(1, 'Good History', 0, 0);
406 INSERT INTO `0_credit_status` VALUES(3, 'No more work until payment received', 1, 0);
407 INSERT INTO `0_credit_status` VALUES(4, 'In liquidation', 1, 0);
409 -- --------------------------------------------------------
412 -- Table structure for table `0_crm_categories`
415 DROP TABLE IF EXISTS `0_crm_categories`;
416 CREATE TABLE IF NOT EXISTS `0_crm_categories` (
417 `id` int(11) NOT NULL auto_increment COMMENT 'pure technical key',
418 `type` varchar(20) NOT NULL COMMENT 'contact type e.g. customer',
419 `action` varchar(20) NOT NULL COMMENT 'detailed usage e.g. department',
420 `name` varchar(30) NOT NULL COMMENT 'for category selector',
421 `description` tinytext NOT NULL COMMENT 'usage description',
422 `system` tinyint(1) NOT NULL default '0' COMMENT 'nonzero for core system usage',
423 `inactive` tinyint(1) NOT NULL default '0',
425 UNIQUE KEY `type` (`type`,`action`),
426 UNIQUE KEY `type_2` (`type`,`name`)
427 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;
430 -- Dumping data for table `0_crm_categories`
433 INSERT INTO `0_crm_categories` VALUES(1, 'cust_branch', 'general', 'General', 'General contact data for customer branch (overrides company setting)', 1, 0);
434 INSERT INTO `0_crm_categories` VALUES(2, 'cust_branch', 'invoice', 'Invoices', 'Invoice posting (overrides company setting)', 1, 0);
435 INSERT INTO `0_crm_categories` VALUES(3, 'cust_branch', 'order', 'Orders', 'Order confirmation (overrides company setting)', 1, 0);
436 INSERT INTO `0_crm_categories` VALUES(4, 'cust_branch', 'delivery', 'Deliveries', 'Delivery coordination (overrides company setting)', 1, 0);
437 INSERT INTO `0_crm_categories` VALUES(5, 'customer', 'general', 'General', 'General contact data for customer', 1, 0);
438 INSERT INTO `0_crm_categories` VALUES(6, 'customer', 'order', 'Orders', 'Order confirmation', 1, 0);
439 INSERT INTO `0_crm_categories` VALUES(7, 'customer', 'delivery', 'Deliveries', 'Delivery coordination', 1, 0);
440 INSERT INTO `0_crm_categories` VALUES(8, 'customer', 'invoice', 'Invoices', 'Invoice posting', 1, 0);
441 INSERT INTO `0_crm_categories` VALUES(9, 'supplier', 'general', 'General', 'General contact data for supplier', 1, 0);
442 INSERT INTO `0_crm_categories` VALUES(10, 'supplier', 'order', 'Orders', 'Order confirmation', 1, 0);
443 INSERT INTO `0_crm_categories` VALUES(11, 'supplier', 'delivery', 'Deliveries', 'Delivery coordination', 1, 0);
444 INSERT INTO `0_crm_categories` VALUES(12, 'supplier', 'invoice', 'Invoices', 'Invoice posting', 1, 0);
446 -- --------------------------------------------------------
449 -- Table structure for table `0_crm_contacts`
452 DROP TABLE IF EXISTS `0_crm_contacts`;
453 CREATE TABLE IF NOT EXISTS `0_crm_contacts` (
454 `id` int(11) NOT NULL auto_increment,
455 `person_id` int(11) NOT NULL default '0' COMMENT 'foreign key to crm_contacts',
456 `type` varchar(20) NOT NULL COMMENT 'foreign key to crm_categories',
457 `action` varchar(20) NOT NULL COMMENT 'foreign key to crm_categories',
458 `entity_id` varchar(11) default NULL COMMENT 'entity id in related class table',
460 KEY `type` (`type`,`action`)
461 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
464 -- Dumping data for table `0_crm_contacts`
467 -- --------------------------------------------------------
470 -- Table structure for table `0_crm_persons`
473 DROP TABLE IF EXISTS `0_crm_persons`;
474 CREATE TABLE IF NOT EXISTS `0_crm_persons` (
475 `id` int(11) NOT NULL auto_increment,
476 `ref` varchar(30) NOT NULL,
477 `name` varchar(60) NOT NULL,
478 `name2` varchar(60) default NULL,
480 `phone` varchar(30) default NULL,
481 `phone2` varchar(30) default NULL,
482 `fax` varchar(30) default NULL,
483 `email` varchar(100) default NULL,
484 `lang` char(5) default NULL,
485 `notes` tinytext NOT NULL,
486 `inactive` tinyint(1) NOT NULL default '0',
489 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
492 -- Dumping data for table `0_crm_persons`
496 -- --------------------------------------------------------
499 -- Table structure for table `0_currencies`
502 DROP TABLE IF EXISTS `0_currencies`;
503 CREATE TABLE IF NOT EXISTS `0_currencies` (
504 `currency` varchar(60) NOT NULL default '',
505 `curr_abrev` char(3) NOT NULL default '',
506 `curr_symbol` varchar(10) NOT NULL default '',
507 `country` varchar(100) NOT NULL default '',
508 `hundreds_name` varchar(15) NOT NULL default '',
509 `auto_update` tinyint(1) NOT NULL default '1',
510 `inactive` tinyint(1) NOT NULL default '0',
511 PRIMARY KEY (`curr_abrev`)
512 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
515 -- Dumping data for table `0_currencies`
518 INSERT INTO `0_currencies` VALUES('US Dollars', 'USD', '$', 'United States', 'Cents', 1, 0);
519 INSERT INTO `0_currencies` VALUES('CA Dollars', 'CAD', '$', 'Canada', 'Cents', 1, 0);
520 INSERT INTO `0_currencies` VALUES('Euro', 'EUR', '?', 'Europe', 'Cents', 1, 0);
521 INSERT INTO `0_currencies` VALUES('Pounds', 'GBP', '?', 'England', 'Pence', 1, 0);
523 -- --------------------------------------------------------
526 -- Table structure for table `0_cust_allocations`
529 DROP TABLE IF EXISTS `0_cust_allocations`;
530 CREATE TABLE IF NOT EXISTS `0_cust_allocations` (
531 `id` int(11) NOT NULL auto_increment,
532 `person_id` int(11) DEFAULT NULL,
533 `amt` double unsigned default NULL,
534 `date_alloc` date NOT NULL default '0000-00-00',
535 `trans_no_from` int(11) default NULL,
536 `trans_type_from` int(11) default NULL,
537 `trans_no_to` int(11) default NULL,
538 `trans_type_to` int(11) default NULL,
540 UNIQUE KEY `trans_type_from` (`person_id`,`trans_type_from`,`trans_no_from`,`trans_type_to`,`trans_no_to`),
541 KEY `From` (`trans_type_from`,`trans_no_from`),
542 KEY `To` (`trans_type_to`,`trans_no_to`)
543 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
546 -- Dumping data for table `0_cust_allocations`
550 -- --------------------------------------------------------
553 -- Table structure for table `0_cust_branch`
556 DROP TABLE IF EXISTS `0_cust_branch`;
557 CREATE TABLE IF NOT EXISTS `0_cust_branch` (
558 `branch_code` int(11) NOT NULL auto_increment,
559 `debtor_no` int(11) NOT NULL default '0',
560 `br_name` varchar(60) NOT NULL default '',
561 `branch_ref` varchar(30) NOT NULL default '',
562 `br_address` tinytext NOT NULL,
563 `area` int(11) default NULL,
564 `salesman` int(11) NOT NULL default '0',
565 `default_location` varchar(5) NOT NULL default '',
566 `tax_group_id` int(11) default NULL,
567 `sales_account` varchar(15) NOT NULL default '',
568 `sales_discount_account` varchar(15) NOT NULL default '',
569 `receivables_account` varchar(15) NOT NULL default '',
570 `payment_discount_account` varchar(15) NOT NULL default '',
571 `default_ship_via` int(11) NOT NULL default '1',
572 `br_post_address` tinytext NOT NULL,
573 `group_no` int(11) NOT NULL default '0',
574 `notes` tinytext NOT NULL,
575 `bank_account` varchar(60) DEFAULT NULL,
576 `inactive` tinyint(1) NOT NULL default '0',
577 PRIMARY KEY (`branch_code`,`debtor_no`),
578 KEY `branch_code` (`branch_code`),
579 KEY `branch_ref` (`branch_ref`),
580 KEY `group_no` (`group_no`)
581 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
584 -- Dumping data for table `0_cust_branch`
588 -- --------------------------------------------------------
591 -- Table structure for table `0_debtors_master`
594 DROP TABLE IF EXISTS `0_debtors_master`;
595 CREATE TABLE IF NOT EXISTS `0_debtors_master` (
596 `debtor_no` int(11) NOT NULL auto_increment,
597 `name` varchar(100) NOT NULL default '',
598 `debtor_ref` varchar(30) NOT NULL,
600 `tax_id` varchar(55) NOT NULL default '',
601 `curr_code` char(3) NOT NULL default '',
602 `sales_type` int(11) NOT NULL default '1',
603 `dimension_id` int(11) NOT NULL default '0',
604 `dimension2_id` int(11) NOT NULL default '0',
605 `credit_status` int(11) NOT NULL default '0',
606 `payment_terms` int(11) default NULL,
607 `discount` double NOT NULL default '0',
608 `pymt_discount` double NOT NULL default '0',
609 `credit_limit` float NOT NULL default '1000',
610 `notes` tinytext NOT NULL,
611 `inactive` tinyint(1) NOT NULL default '0',
612 PRIMARY KEY (`debtor_no`),
614 UNIQUE KEY `debtor_ref` (`debtor_ref`)
615 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
618 -- Dumping data for table `0_debtors_master`
622 -- --------------------------------------------------------
625 -- Table structure for table `0_debtor_trans`
628 DROP TABLE IF EXISTS `0_debtor_trans`;
629 CREATE TABLE IF NOT EXISTS `0_debtor_trans` (
630 `trans_no` int(11) unsigned NOT NULL default '0',
631 `type` smallint(6) unsigned NOT NULL default '0',
632 `version` tinyint(1) unsigned NOT NULL default '0',
633 `debtor_no` int(11) unsigned default NULL,
634 `branch_code` int(11) NOT NULL default '-1',
635 `tran_date` date NOT NULL default '0000-00-00',
636 `due_date` date NOT NULL default '0000-00-00',
637 `reference` varchar(60) NOT NULL default '',
638 `tpe` int(11) NOT NULL default '0',
639 `order_` int(11) NOT NULL default '0',
640 `ov_amount` double NOT NULL default '0',
641 `ov_gst` double NOT NULL default '0',
642 `ov_freight` double NOT NULL default '0',
643 `ov_freight_tax` double NOT NULL default '0',
644 `ov_discount` double NOT NULL default '0',
645 `alloc` double NOT NULL default '0',
646 `prep_amount` double NOT NULL DEFAULT '0',
647 `rate` double NOT NULL default '1',
648 `ship_via` int(11) default NULL,
649 `dimension_id` int(11) NOT NULL default '0',
650 `dimension2_id` int(11) NOT NULL default '0',
651 `payment_terms` int(11) default NULL,
652 `tax_included` tinyint(1) unsigned NOT NULL default '0',
653 PRIMARY KEY (`type`,`trans_no`),
654 KEY `debtor_no` (`debtor_no`,`branch_code`),
655 KEY `tran_date` (`tran_date`),
656 KEY `order_` (`order_`)
657 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
660 -- Dumping data for table `0_debtor_trans`
664 -- --------------------------------------------------------
667 -- Table structure for table `0_debtor_trans_details`
670 DROP TABLE IF EXISTS `0_debtor_trans_details`;
671 CREATE TABLE IF NOT EXISTS `0_debtor_trans_details` (
672 `id` int(11) NOT NULL auto_increment,
673 `debtor_trans_no` int(11) default NULL,
674 `debtor_trans_type` int(11) default NULL,
675 `stock_id` varchar(20) NOT NULL default '',
676 `description` tinytext,
677 `unit_price` double NOT NULL default '0',
678 `unit_tax` double NOT NULL default '0',
679 `quantity` double NOT NULL default '0',
680 `discount_percent` double NOT NULL default '0',
681 `standard_cost` double NOT NULL default '0',
682 `qty_done` double NOT NULL default '0',
683 `src_id` int(11) NOT NULL,
685 KEY `Transaction` (`debtor_trans_type`,`debtor_trans_no`),
687 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
690 -- Dumping data for table `0_debtor_trans_details`
694 -- --------------------------------------------------------
697 -- Table structure for table `0_dimensions`
700 DROP TABLE IF EXISTS `0_dimensions`;
701 CREATE TABLE IF NOT EXISTS `0_dimensions` (
702 `id` int(11) NOT NULL auto_increment,
703 `reference` varchar(60) NOT NULL default '',
704 `name` varchar(60) NOT NULL default '',
705 `type_` tinyint(1) NOT NULL default '1',
706 `closed` tinyint(1) NOT NULL default '0',
707 `date_` date NOT NULL default '0000-00-00',
708 `due_date` date NOT NULL default '0000-00-00',
710 UNIQUE KEY `reference` (`reference`),
711 KEY `date_` (`date_`),
712 KEY `due_date` (`due_date`),
713 KEY `type_` (`type_`)
714 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
717 -- Dumping data for table `0_dimensions`
721 -- --------------------------------------------------------
724 -- Table structure for table `0_exchange_rates`
727 DROP TABLE IF EXISTS `0_exchange_rates`;
728 CREATE TABLE IF NOT EXISTS `0_exchange_rates` (
729 `id` int(11) NOT NULL auto_increment,
730 `curr_code` char(3) NOT NULL default '',
731 `rate_buy` double NOT NULL default '0',
732 `rate_sell` double NOT NULL default '0',
733 `date_` date NOT NULL default '0000-00-00',
735 UNIQUE KEY `curr_code` (`curr_code`,`date_`)
736 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
739 -- Dumping data for table `0_exchange_rates`
743 -- --------------------------------------------------------
746 -- Table structure for table `0_fiscal_year`
749 DROP TABLE IF EXISTS `0_fiscal_year`;
750 CREATE TABLE IF NOT EXISTS `0_fiscal_year` (
751 `id` int(11) NOT NULL auto_increment,
752 `begin` date default '0000-00-00',
753 `end` date default '0000-00-00',
754 `closed` tinyint(1) NOT NULL default '0',
756 UNIQUE KEY `begin` (`begin`),
757 UNIQUE KEY `end` (`end`)
758 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
761 -- Dumping data for table `0_fiscal_year`
764 INSERT INTO `0_fiscal_year` VALUES(1, '2013-01-01', '2013-12-31', 0);
765 INSERT INTO `0_fiscal_year` VALUES(2, '2014-01-01', '2014-12-31', 0);
768 -- Table structure for table `0_gl_trans`
771 DROP TABLE IF EXISTS `0_gl_trans`;
772 CREATE TABLE IF NOT EXISTS `0_gl_trans` (
773 `counter` int(11) NOT NULL auto_increment,
774 `type` smallint(6) NOT NULL default '0',
775 `type_no` int(11) NOT NULL default '0',
776 `tran_date` date NOT NULL default '0000-00-00',
777 `account` varchar(15) NOT NULL default '',
778 `memo_` tinytext NOT NULL,
779 `amount` double NOT NULL default '0',
780 `dimension_id` int(11) NOT NULL default '0',
781 `dimension2_id` int(11) NOT NULL default '0',
782 `person_type_id` int(11) default NULL,
783 `person_id` tinyblob,
784 PRIMARY KEY (`counter`),
785 KEY `Type_and_Number` (`type`,`type_no`),
786 KEY `dimension_id` (`dimension_id`),
787 KEY `dimension2_id` (`dimension2_id`),
788 KEY `tran_date` (`tran_date`),
789 KEY `account_and_tran_date` (`account`,`tran_date`)
790 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
793 -- Dumping data for table `0_gl_trans`
797 -- --------------------------------------------------------
800 -- Table structure for table `0_grn_batch`
803 DROP TABLE IF EXISTS `0_grn_batch`;
804 CREATE TABLE IF NOT EXISTS `0_grn_batch` (
805 `id` int(11) NOT NULL auto_increment,
806 `supplier_id` int(11) NOT NULL default '0',
807 `purch_order_no` int(11) default NULL,
808 `reference` varchar(60) NOT NULL default '',
809 `delivery_date` date NOT NULL default '0000-00-00',
810 `loc_code` varchar(5) default NULL,
811 `rate` double NULL default '1',
813 KEY `delivery_date` (`delivery_date`),
814 KEY `purch_order_no` (`purch_order_no`)
815 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
818 -- Dumping data for table `0_grn_batch`
822 -- --------------------------------------------------------
825 -- Table structure for table `0_grn_items`
828 DROP TABLE IF EXISTS `0_grn_items`;
829 CREATE TABLE IF NOT EXISTS `0_grn_items` (
830 `id` int(11) NOT NULL auto_increment,
831 `grn_batch_id` int(11) default NULL,
832 `po_detail_item` int(11) NOT NULL default '0',
833 `item_code` varchar(20) NOT NULL default '',
834 `description` tinytext,
835 `qty_recd` double NOT NULL default '0',
836 `quantity_inv` double NOT NULL default '0',
838 KEY `grn_batch_id` (`grn_batch_id`)
839 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
842 -- Dumping data for table `0_grn_items`
846 -- --------------------------------------------------------
849 -- Table structure for table `0_groups`
852 DROP TABLE IF EXISTS `0_groups`;
853 CREATE TABLE IF NOT EXISTS `0_groups` (
854 `id` smallint(6) unsigned NOT NULL auto_increment,
855 `description` varchar(60) NOT NULL default '',
856 `inactive` tinyint(1) NOT NULL default '0',
858 UNIQUE KEY `description` (`description`)
859 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
862 -- Dumping data for table `0_groups`
865 INSERT INTO `0_groups` VALUES(1, 'Small', 0);
866 INSERT INTO `0_groups` VALUES(2, 'Medium', 0);
867 INSERT INTO `0_groups` VALUES(3, 'Large', 0);
869 -- --------------------------------------------------------
872 -- Table structure for table `0_item_codes`
875 DROP TABLE IF EXISTS `0_item_codes`;
876 CREATE TABLE IF NOT EXISTS `0_item_codes` (
877 `id` int(11) unsigned NOT NULL auto_increment,
878 `item_code` varchar(20) NOT NULL,
879 `stock_id` varchar(20) NOT NULL,
880 `description` varchar(200) NOT NULL default '',
881 `category_id` smallint(6) unsigned NOT NULL,
882 `quantity` double NOT NULL default '1',
883 `is_foreign` tinyint(1) NOT NULL default '0',
884 `inactive` tinyint(1) NOT NULL default '0',
886 UNIQUE KEY `stock_id` (`stock_id`,`item_code`),
887 KEY `item_code` (`item_code`)
888 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
891 -- Dumping data for table `0_item_codes`
895 -- --------------------------------------------------------
898 -- Table structure for table `0_item_tax_types`
901 DROP TABLE IF EXISTS `0_item_tax_types`;
902 CREATE TABLE IF NOT EXISTS `0_item_tax_types` (
903 `id` int(11) NOT NULL auto_increment,
904 `name` varchar(60) NOT NULL default '',
905 `exempt` tinyint(1) NOT NULL default '0',
906 `inactive` tinyint(1) NOT NULL default '0',
908 UNIQUE KEY `name` (`name`)
909 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
912 -- Dumping data for table `0_item_tax_types`
915 INSERT INTO `0_item_tax_types` VALUES(1, 'Regular', 0, 0);
917 -- --------------------------------------------------------
920 -- Table structure for table `0_item_tax_type_exemptions`
923 DROP TABLE IF EXISTS `0_item_tax_type_exemptions`;
924 CREATE TABLE IF NOT EXISTS `0_item_tax_type_exemptions` (
925 `item_tax_type_id` int(11) NOT NULL default '0',
926 `tax_type_id` int(11) NOT NULL default '0',
927 PRIMARY KEY (`item_tax_type_id`,`tax_type_id`)
928 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
931 -- Dumping data for table `0_item_tax_type_exemptions`
935 -- --------------------------------------------------------
938 -- Table structure for table `0_item_units`
941 DROP TABLE IF EXISTS `0_item_units`;
942 CREATE TABLE IF NOT EXISTS `0_item_units` (
943 `abbr` varchar(20) NOT NULL,
944 `name` varchar(40) NOT NULL,
945 `decimals` tinyint(2) NOT NULL,
946 `inactive` tinyint(1) NOT NULL default '0',
947 PRIMARY KEY (`abbr`),
948 UNIQUE KEY `name` (`name`)
949 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
952 -- Dumping data for table `0_item_units`
955 INSERT INTO `0_item_units` VALUES('each', 'Each', 0, 0);
956 INSERT INTO `0_item_units` VALUES('hr', 'Hours', 0, 0);
958 --- Structure of table `0_journal`
960 DROP TABLE IF EXISTS `0_journal`;
961 CREATE TABLE `0_journal` (
962 `type` smallint(6) NOT NULL DEFAULT '0',
963 `trans_no` int(11) NOT NULL DEFAULT '0',
964 `tran_date` date DEFAULT '0000-00-00',
965 `reference` varchar(60) NOT NULL DEFAULT '',
966 `source_ref` varchar(60) NOT NULL DEFAULT '',
967 `event_date` date DEFAULT '0000-00-00',
968 `doc_date` date NOT NULL DEFAULT '0000-00-00',
969 `currency` char(3) NOT NULL DEFAULT '',
970 `amount` double NOT NULL DEFAULT '0',
971 `rate` double NOT NULL DEFAULT '1',
972 PRIMARY KEY (`type`,`trans_no`),
973 KEY `tran_date` (`tran_date`)
974 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
976 --- Data of table `0_journal`
979 -- --------------------------------------------------------
982 -- Table structure for table `0_locations`
985 DROP TABLE IF EXISTS `0_locations`;
986 CREATE TABLE IF NOT EXISTS `0_locations` (
987 `loc_code` varchar(5) NOT NULL default '',
988 `location_name` varchar(60) NOT NULL default '',
989 `delivery_address` tinytext NOT NULL,
990 `phone` varchar(30) NOT NULL default '',
991 `phone2` varchar(30) NOT NULL default '',
992 `fax` varchar(30) NOT NULL default '',
993 `email` varchar(100) NOT NULL default '',
994 `contact` varchar(30) NOT NULL default '',
995 `inactive` tinyint(1) NOT NULL default '0',
996 PRIMARY KEY (`loc_code`)
997 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1000 -- Dumping data for table `0_locations`
1003 INSERT INTO `0_locations` VALUES('DEF', 'Default', 'N/A', '', '', '', '', '', 0);
1005 -- --------------------------------------------------------
1008 -- Table structure for table `0_loc_stock`
1011 DROP TABLE IF EXISTS `0_loc_stock`;
1012 CREATE TABLE IF NOT EXISTS `0_loc_stock` (
1013 `loc_code` char(5) NOT NULL default '',
1014 `stock_id` char(20) NOT NULL default '',
1015 `reorder_level` double NOT NULL default '0',
1016 PRIMARY KEY (`loc_code`,`stock_id`),
1017 KEY `stock_id` (`stock_id`)
1018 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1021 -- Dumping data for table `0_loc_stock`
1025 -- --------------------------------------------------------
1028 -- Table structure for table `0_movement_types`
1031 DROP TABLE IF EXISTS `0_movement_types`;
1032 CREATE TABLE IF NOT EXISTS `0_movement_types` (
1033 `id` int(11) NOT NULL auto_increment,
1034 `name` varchar(60) NOT NULL default '',
1035 `inactive` tinyint(1) NOT NULL default '0',
1037 UNIQUE KEY `name` (`name`)
1038 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
1041 -- Dumping data for table `0_movement_types`
1044 INSERT INTO `0_movement_types` VALUES(1, 'Adjustment', 0);
1046 -- --------------------------------------------------------
1049 -- Table structure for table `0_payment_terms`
1052 DROP TABLE IF EXISTS `0_payment_terms`;
1053 CREATE TABLE IF NOT EXISTS `0_payment_terms` (
1054 `terms_indicator` int(11) NOT NULL auto_increment,
1055 `terms` char(80) NOT NULL default '',
1056 `days_before_due` smallint(6) NOT NULL default '0',
1057 `day_in_following_month` smallint(6) NOT NULL default '0',
1058 `inactive` tinyint(1) NOT NULL default '0',
1059 PRIMARY KEY (`terms_indicator`),
1060 UNIQUE KEY `terms` (`terms`)
1061 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
1064 -- Dumping data for table `0_payment_terms`
1067 INSERT INTO `0_payment_terms` VALUES(1, 'Due 15th Of the Following Month', 0, 17, 0);
1068 INSERT INTO `0_payment_terms` VALUES(2, 'Due By End Of The Following Month', 0, 30, 0);
1069 INSERT INTO `0_payment_terms` VALUES(3, 'Payment due within 10 days', 10, 0, 0);
1070 INSERT INTO `0_payment_terms` VALUES(4, 'Cash Only', 0, 0, 0);
1072 -- --------------------------------------------------------
1075 -- Table structure for table `0_prices`
1078 DROP TABLE IF EXISTS `0_prices`;
1079 CREATE TABLE IF NOT EXISTS `0_prices` (
1080 `id` int(11) NOT NULL auto_increment,
1081 `stock_id` varchar(20) NOT NULL default '',
1082 `sales_type_id` int(11) NOT NULL default '0',
1083 `curr_abrev` char(3) NOT NULL default '',
1084 `price` double NOT NULL default '0',
1086 UNIQUE KEY `price` (`stock_id`,`sales_type_id`,`curr_abrev`)
1087 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
1090 -- Dumping data for table `0_prices`
1094 -- --------------------------------------------------------
1097 -- Table structure for table `0_printers`
1100 DROP TABLE IF EXISTS `0_printers`;
1101 CREATE TABLE IF NOT EXISTS `0_printers` (
1102 `id` tinyint(3) unsigned NOT NULL auto_increment,
1103 `name` varchar(20) NOT NULL,
1104 `description` varchar(60) NOT NULL,
1105 `queue` varchar(20) NOT NULL,
1106 `host` varchar(40) NOT NULL,
1107 `port` smallint(11) unsigned NOT NULL,
1108 `timeout` tinyint(3) unsigned NOT NULL,
1110 UNIQUE KEY `name` (`name`)
1111 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
1114 -- Dumping data for table `0_printers`
1117 INSERT INTO `0_printers` VALUES(1, 'QL500', 'Label printer', 'QL500', 'server', 127, 20);
1118 INSERT INTO `0_printers` VALUES(2, 'Samsung', 'Main network printer', 'scx4521F', 'server', 515, 5);
1119 INSERT INTO `0_printers` VALUES(3, 'Local', 'Local print server at user IP', 'lp', '', 515, 10);
1121 -- --------------------------------------------------------
1124 -- Table structure for table `0_print_profiles`
1127 DROP TABLE IF EXISTS `0_print_profiles`;
1128 CREATE TABLE IF NOT EXISTS `0_print_profiles` (
1129 `id` smallint(6) unsigned NOT NULL auto_increment,
1130 `profile` varchar(30) NOT NULL,
1131 `report` varchar(5) default NULL,
1132 `printer` tinyint(3) unsigned default NULL,
1134 UNIQUE KEY `profile` (`profile`,`report`)
1135 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
1138 -- Dumping data for table `0_print_profiles`
1141 INSERT INTO `0_print_profiles` VALUES(1, 'Out of office', '', 0);
1142 INSERT INTO `0_print_profiles` VALUES(2, 'Sales Department', '', 0);
1143 INSERT INTO `0_print_profiles` VALUES(3, 'Central', '', 2);
1144 INSERT INTO `0_print_profiles` VALUES(4, 'Sales Department', '104', 2);
1145 INSERT INTO `0_print_profiles` VALUES(5, 'Sales Department', '105', 2);
1146 INSERT INTO `0_print_profiles` VALUES(6, 'Sales Department', '107', 2);
1147 INSERT INTO `0_print_profiles` VALUES(7, 'Sales Department', '109', 2);
1148 INSERT INTO `0_print_profiles` VALUES(8, 'Sales Department', '110', 2);
1149 INSERT INTO `0_print_profiles` VALUES(9, 'Sales Department', '201', 2);
1151 -- --------------------------------------------------------
1154 -- Table structure for table `0_purch_data`
1157 DROP TABLE IF EXISTS `0_purch_data`;
1158 CREATE TABLE IF NOT EXISTS `0_purch_data` (
1159 `supplier_id` int(11) NOT NULL default '0',
1160 `stock_id` char(20) NOT NULL default '',
1161 `price` double NOT NULL default '0',
1162 `suppliers_uom` char(50) NOT NULL default '',
1163 `conversion_factor` double NOT NULL default '1',
1164 `supplier_description` char(50) NOT NULL default '',
1165 PRIMARY KEY (`supplier_id`,`stock_id`)
1166 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1169 -- Dumping data for table `0_purch_data`
1173 -- --------------------------------------------------------
1176 -- Table structure for table `0_purch_orders`
1179 DROP TABLE IF EXISTS `0_purch_orders`;
1180 CREATE TABLE IF NOT EXISTS `0_purch_orders` (
1181 `order_no` int(11) NOT NULL auto_increment,
1182 `supplier_id` int(11) NOT NULL default '0',
1183 `comments` tinytext,
1184 `ord_date` date NOT NULL default '0000-00-00',
1185 `reference` tinytext NOT NULL,
1186 `requisition_no` tinytext,
1187 `into_stock_location` varchar(5) NOT NULL default '',
1188 `delivery_address` tinytext NOT NULL,
1189 `total` double NOT NULL default '0',
1190 `prep_amount` double NOT NULL DEFAULT '0',
1191 `alloc` double NOT NULL DEFAULT '0',
1192 `tax_included` tinyint(1) NOT NULL default '0',
1193 PRIMARY KEY (`order_no`),
1194 KEY `ord_date` (`ord_date`)
1195 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
1198 -- Dumping data for table `0_purch_orders`
1202 -- --------------------------------------------------------
1205 -- Table structure for table `0_purch_order_details`
1208 DROP TABLE IF EXISTS `0_purch_order_details`;
1209 CREATE TABLE IF NOT EXISTS `0_purch_order_details` (
1210 `po_detail_item` int(11) NOT NULL auto_increment,
1211 `order_no` int(11) NOT NULL default '0',
1212 `item_code` varchar(20) NOT NULL default '',
1213 `description` tinytext,
1214 `delivery_date` date NOT NULL default '0000-00-00',
1215 `qty_invoiced` double NOT NULL default '0',
1216 `unit_price` double NOT NULL default '0',
1217 `act_price` double NOT NULL default '0',
1218 `std_cost_unit` double NOT NULL default '0',
1219 `quantity_ordered` double NOT NULL default '0',
1220 `quantity_received` double NOT NULL default '0',
1221 PRIMARY KEY (`po_detail_item`),
1222 KEY `order` (`order_no`,`po_detail_item`),
1223 KEY `itemcode` (`item_code`)
1224 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
1227 -- Dumping data for table `0_purch_order_details`
1231 -- --------------------------------------------------------
1234 -- Table structure for table `0_quick_entries`
1237 DROP TABLE IF EXISTS `0_quick_entries`;
1238 CREATE TABLE IF NOT EXISTS `0_quick_entries` (
1239 `id` smallint(6) unsigned NOT NULL auto_increment,
1240 `type` tinyint(1) NOT NULL default '0',
1241 `description` varchar(60) NOT NULL,
1242 `usage` varchar(120) NULL,
1243 `base_amount` double NOT NULL default '0',
1244 `base_desc` varchar(60) default NULL,
1245 `bal_type` tinyint(1) NOT NULL default '0',
1247 KEY `description` (`description`)
1248 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
1251 -- Dumping data for table `0_quick_entries`
1254 INSERT INTO `0_quick_entries` VALUES(1, 1, 'Maintenance', NULL, 0, 'Amount', 0);
1255 INSERT INTO `0_quick_entries` VALUES(2, 4, 'Phone', NULL, 0, 'Amount', 0);
1256 INSERT INTO `0_quick_entries` VALUES(3, 2, 'Cash Sales', 'Retail sales without invoice', 0, 'Amount', 0);
1258 -- --------------------------------------------------------
1261 -- Table structure for table `0_quick_entry_lines`
1264 DROP TABLE IF EXISTS `0_quick_entry_lines`;
1265 CREATE TABLE IF NOT EXISTS `0_quick_entry_lines` (
1266 `id` smallint(6) unsigned NOT NULL auto_increment,
1267 `qid` smallint(6) unsigned NOT NULL,
1268 `amount` double default '0',
1269 `memo` tinytext NOT NULL,
1270 `action` varchar(2) NOT NULL,
1271 `dest_id` varchar(15) NOT NULL default '',
1272 `dimension_id` smallint(6) unsigned default NULL,
1273 `dimension2_id` smallint(6) unsigned default NULL,
1276 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
1279 -- Dumping data for table `0_quick_entry_lines`
1282 INSERT INTO `0_quick_entry_lines` VALUES(1, 1, 0, '', 't-', '1', 0, 0);
1283 INSERT INTO `0_quick_entry_lines` VALUES(2, 2, 0, '', 't-', '1', 0, 0);
1284 INSERT INTO `0_quick_entry_lines` VALUES(3, 3, 0, '', 't-', '1', 0, 0);
1285 INSERT INTO `0_quick_entry_lines` VALUES(4, 3, 0, '', '=', '4010', 0, 0);
1286 INSERT INTO `0_quick_entry_lines` VALUES(5, 1, 0, '', '=', '5765', 0, 0);
1287 INSERT INTO `0_quick_entry_lines` VALUES(6, 2, 0, '', '=', '5780', 0, 0);
1289 -- --------------------------------------------------------
1292 -- Table structure for table `0_recurrent_invoices`
1295 DROP TABLE IF EXISTS `0_recurrent_invoices`;
1296 CREATE TABLE IF NOT EXISTS `0_recurrent_invoices` (
1297 `id` smallint(6) unsigned NOT NULL auto_increment,
1298 `description` varchar(60) NOT NULL default '',
1299 `order_no` int(11) unsigned NOT NULL,
1300 `debtor_no` int(11) unsigned default NULL,
1301 `group_no` smallint(6) unsigned default NULL,
1302 `days` int(11) NOT NULL default '0',
1303 `monthly` int(11) NOT NULL default '0',
1304 `begin` date NOT NULL default '0000-00-00',
1305 `end` date NOT NULL default '0000-00-00',
1306 `last_sent` date NOT NULL default '0000-00-00',
1308 UNIQUE KEY `description` (`description`)
1309 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
1312 -- Dumping data for table `0_recurrent_invoices`
1316 -- --------------------------------------------------------
1319 -- Table structure for table `0_refs`
1322 DROP TABLE IF EXISTS `0_refs`;
1323 CREATE TABLE IF NOT EXISTS `0_refs` (
1324 `id` int(11) NOT NULL default '0',
1325 `type` int(11) NOT NULL default '0',
1326 `reference` varchar(100) NOT NULL default '',
1327 PRIMARY KEY (`id`,`type`),
1328 KEY `Type_and_Reference` (`type`,`reference`)
1329 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1332 -- Dumping data for table `0_refs`
1336 -- --------------------------------------------------------
1339 -- Table structure for table `0_salesman`
1342 DROP TABLE IF EXISTS `0_salesman`;
1343 CREATE TABLE IF NOT EXISTS `0_salesman` (
1344 `salesman_code` int(11) NOT NULL auto_increment,
1345 `salesman_name` char(60) NOT NULL default '',
1346 `salesman_phone` char(30) NOT NULL default '',
1347 `salesman_fax` char(30) NOT NULL default '',
1348 `salesman_email` varchar(100) NOT NULL default '',
1349 `provision` double NOT NULL default '0',
1350 `break_pt` double NOT NULL default '0',
1351 `provision2` double NOT NULL default '0',
1352 `inactive` tinyint(1) NOT NULL default '0',
1353 PRIMARY KEY (`salesman_code`),
1354 UNIQUE KEY `salesman_name` (`salesman_name`)
1355 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
1358 -- Dumping data for table `0_salesman`
1361 INSERT INTO `0_salesman` VALUES(1, 'Sales Person', '', '', '', 5, 1000, 4, 0);
1363 -- --------------------------------------------------------
1366 -- Table structure for table `0_sales_orders`
1369 DROP TABLE IF EXISTS `0_sales_orders`;
1370 CREATE TABLE IF NOT EXISTS `0_sales_orders` (
1371 `order_no` int(11) NOT NULL,
1372 `trans_type` smallint(6) NOT NULL default '30',
1373 `version` tinyint(1) unsigned NOT NULL default '0',
1374 `type` tinyint(1) NOT NULL default '0',
1375 `debtor_no` int(11) NOT NULL default '0',
1376 `branch_code` int(11) NOT NULL default '0',
1377 `reference` varchar(100) NOT NULL default '',
1378 `customer_ref` tinytext NOT NULL,
1379 `comments` tinytext,
1380 `ord_date` date NOT NULL default '0000-00-00',
1381 `order_type` int(11) NOT NULL default '0',
1382 `ship_via` int(11) NOT NULL default '0',
1383 `delivery_address` tinytext NOT NULL,
1384 `contact_phone` varchar(30) default NULL,
1385 `contact_email` varchar(100) default NULL,
1386 `deliver_to` tinytext NOT NULL,
1387 `freight_cost` double NOT NULL default '0',
1388 `from_stk_loc` varchar(5) NOT NULL default '',
1389 `delivery_date` date NOT NULL default '0000-00-00',
1390 `payment_terms` int(11) default NULL,
1391 `total` double NOT NULL default '0',
1392 `prep_amount` double NOT NULL DEFAULT '0',
1393 `alloc` double NOT NULL DEFAULT '0',
1394 PRIMARY KEY (`trans_type`,`order_no`)
1395 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1398 -- Dumping data for table `0_sales_orders`
1402 -- --------------------------------------------------------
1405 -- Table structure for table `0_sales_order_details`
1408 DROP TABLE IF EXISTS `0_sales_order_details`;
1409 CREATE TABLE IF NOT EXISTS `0_sales_order_details` (
1410 `id` int(11) NOT NULL auto_increment,
1411 `order_no` int(11) NOT NULL default '0',
1412 `trans_type` smallint(6) NOT NULL default '30',
1413 `stk_code` varchar(20) NOT NULL default '',
1414 `description` tinytext,
1415 `qty_sent` double NOT NULL default '0',
1416 `unit_price` double NOT NULL default '0',
1417 `quantity` double NOT NULL default '0',
1418 `invoiced` double NOT NULL DEFAULT '0',
1419 `discount_percent` double NOT NULL default '0',
1421 KEY `sorder` (`trans_type`,`order_no`),
1422 KEY `stkcode` (`stk_code`)
1423 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
1426 -- Dumping data for table `0_sales_order_details`
1430 -- --------------------------------------------------------
1433 -- Table structure for table `0_sales_pos`
1436 DROP TABLE IF EXISTS `0_sales_pos`;
1437 CREATE TABLE IF NOT EXISTS `0_sales_pos` (
1438 `id` smallint(6) unsigned NOT NULL auto_increment,
1439 `pos_name` varchar(30) NOT NULL,
1440 `cash_sale` tinyint(1) NOT NULL,
1441 `credit_sale` tinyint(1) NOT NULL,
1442 `pos_location` varchar(5) NOT NULL,
1443 `pos_account` smallint(6) unsigned NOT NULL,
1444 `inactive` tinyint(1) NOT NULL default '0',
1446 UNIQUE KEY `pos_name` (`pos_name`)
1447 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
1450 -- Dumping data for table `0_sales_pos`
1453 INSERT INTO `0_sales_pos` VALUES(1, 'Default', 1, 1, 'DEF', 2, 0);
1455 -- --------------------------------------------------------
1458 -- Table structure for table `0_sales_types`
1461 DROP TABLE IF EXISTS `0_sales_types`;
1462 CREATE TABLE IF NOT EXISTS `0_sales_types` (
1463 `id` int(11) NOT NULL auto_increment,
1464 `sales_type` char(50) NOT NULL default '',
1465 `tax_included` int(1) NOT NULL default '0',
1466 `factor` double NOT NULL default '1',
1467 `inactive` tinyint(1) NOT NULL default '0',
1469 UNIQUE KEY `sales_type` (`sales_type`)
1470 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
1473 -- Dumping data for table `0_sales_types`
1476 INSERT INTO `0_sales_types` VALUES(1, 'Retail', 1, 1, 0);
1477 INSERT INTO `0_sales_types` VALUES(2, 'Wholesale', 0, 0.7, 0);
1479 -- --------------------------------------------------------
1482 -- Table structure for table `0_security_roles`
1485 DROP TABLE IF EXISTS `0_security_roles`;
1486 CREATE TABLE IF NOT EXISTS `0_security_roles` (
1487 `id` int(11) NOT NULL auto_increment,
1488 `role` varchar(30) NOT NULL,
1489 `description` varchar(50) default NULL,
1492 `inactive` tinyint(1) NOT NULL default '0',
1494 UNIQUE KEY `role` (`role`)
1495 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ;
1498 -- Dumping data for table `0_security_roles`
1501 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;775', 0);
1502 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;526;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;5890;5891;7937;7938;7939;7940;8193;8194;8195;8196;8197;8449;8450;8451;10497;10753;10754;10755;10756;10757;11009;11010;11011;11012;13057;13313;13314;13315;15617;15618;15619;15620;15621;15622;15623;15624;15628;15625;15626;15627;15873;15874;15875;15876;15877;15878;15879;15880;15883;15881;15882;16129;16130;16131;16132;775', 0);
1503 INSERT INTO `0_security_roles` VALUES(3, 'Salesman', 'Salesman', '768;3072;5632;8192;15872', '773;774;3073;3075;3081;5633;8194;15873;775', 0);
1504 INSERT INTO `0_security_roles` VALUES(4, 'Stock Manager', 'Stock Manager', '768;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;775', 0);
1505 INSERT INTO `0_security_roles` VALUES(5, 'Production Manager', 'Production Manager', '512;768;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;775', 0);
1506 INSERT INTO `0_security_roles` VALUES(6, 'Purchase Officer', 'Purchase Officer', '512;768;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;775', 0);
1507 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;775', 0);
1508 INSERT INTO `0_security_roles` VALUES(8, 'AP Officer', 'AP Officer', '512;768;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;775', 0);
1509 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;775', 0);
1510 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;775', 0);
1512 -- --------------------------------------------------------
1515 -- Table structure for table `0_shippers`
1518 DROP TABLE IF EXISTS `0_shippers`;
1519 CREATE TABLE IF NOT EXISTS `0_shippers` (
1520 `shipper_id` int(11) NOT NULL auto_increment,
1521 `shipper_name` varchar(60) NOT NULL default '',
1522 `phone` varchar(30) NOT NULL default '',
1523 `phone2` varchar(30) NOT NULL default '',
1524 `contact` tinytext NOT NULL,
1525 `address` tinytext NOT NULL,
1526 `inactive` tinyint(1) NOT NULL default '0',
1527 PRIMARY KEY (`shipper_id`),
1528 UNIQUE KEY `name` (`shipper_name`)
1529 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
1532 -- Dumping data for table `0_shippers`
1535 INSERT INTO `0_shippers` VALUES(1, 'Default', '', '', '', '', 0);
1537 -- --------------------------------------------------------
1540 -- Table structure for table `0_sql_trail`
1543 DROP TABLE IF EXISTS `0_sql_trail`;
1544 CREATE TABLE IF NOT EXISTS `0_sql_trail` (
1545 `id` int(11) unsigned NOT NULL auto_increment,
1546 `sql` text NOT NULL,
1547 `result` tinyint(1) NOT NULL,
1548 `msg` varchar(255) NOT NULL,
1550 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
1553 -- Dumping data for table `0_sql_trail`
1557 -- --------------------------------------------------------
1560 -- Table structure for table `0_stock_category`
1563 DROP TABLE IF EXISTS `0_stock_category`;
1564 CREATE TABLE IF NOT EXISTS `0_stock_category` (
1565 `category_id` int(11) NOT NULL auto_increment,
1566 `description` varchar(60) NOT NULL default '',
1567 `dflt_tax_type` int(11) NOT NULL default '1',
1568 `dflt_units` varchar(20) NOT NULL default 'each',
1569 `dflt_mb_flag` char(1) NOT NULL default 'B',
1570 `dflt_sales_act` varchar(15) NOT NULL default '',
1571 `dflt_cogs_act` varchar(15) NOT NULL default '',
1572 `dflt_inventory_act` varchar(15) NOT NULL default '',
1573 `dflt_adjustment_act` varchar(15) NOT NULL default '',
1574 `dflt_assembly_act` varchar(15) NOT NULL default '',
1575 `dflt_dim1` int(11) default NULL,
1576 `dflt_dim2` int(11) default NULL,
1577 `inactive` tinyint(1) NOT NULL default '0',
1578 `dflt_no_sale` tinyint(1) NOT NULL default '0',
1579 `dflt_no_purchase` tinyint(1) NOT NULL default '0',
1580 PRIMARY KEY (`category_id`),
1581 UNIQUE KEY `description` (`description`)
1582 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
1585 -- Dumping data for table `0_stock_category`
1588 INSERT INTO `0_stock_category` VALUES(1, 'Components', 1, 'each', 'B', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1589 INSERT INTO `0_stock_category` VALUES(2, 'Charges', 1, 'each', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1590 INSERT INTO `0_stock_category` VALUES(3, 'Systems', 1, 'each', 'M', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1591 INSERT INTO `0_stock_category` VALUES(4, 'Services', 1, 'hr', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1592 -- --------------------------------------------------------
1595 -- Table structure for table `0_stock_master`
1598 DROP TABLE IF EXISTS `0_stock_master`;
1599 CREATE TABLE IF NOT EXISTS `0_stock_master` (
1600 `stock_id` varchar(20) NOT NULL default '',
1601 `category_id` int(11) NOT NULL default '0',
1602 `tax_type_id` int(11) NOT NULL default '0',
1603 `description` varchar(200) NOT NULL default '',
1604 `long_description` tinytext NOT NULL,
1605 `units` varchar(20) NOT NULL default 'each',
1606 `mb_flag` char(1) NOT NULL default 'B',
1607 `sales_account` varchar(15) NOT NULL default '',
1608 `cogs_account` varchar(15) NOT NULL default '',
1609 `inventory_account` varchar(15) NOT NULL default '',
1610 `adjustment_account` varchar(15) NOT NULL default '',
1611 `assembly_account` varchar(15) NOT NULL default '',
1612 `dimension_id` int(11) default NULL,
1613 `dimension2_id` int(11) default NULL,
1614 `actual_cost` double NOT NULL default '0',
1615 `last_cost` double NOT NULL default '0',
1616 `material_cost` double NOT NULL default '0',
1617 `labour_cost` double NOT NULL default '0',
1618 `overhead_cost` double NOT NULL default '0',
1619 `inactive` tinyint(1) NOT NULL default '0',
1620 `no_sale` tinyint(1) NOT NULL default '0',
1621 `no_purchase` tinyint(1) NOT NULL default '0',
1622 `editable` tinyint(1) NOT NULL default '0',
1623 PRIMARY KEY (`stock_id`)
1624 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1627 -- Dumping data for table `0_stock_master`
1631 -- --------------------------------------------------------
1634 -- Table structure for table `0_stock_moves`
1637 DROP TABLE IF EXISTS `0_stock_moves`;
1638 CREATE TABLE IF NOT EXISTS `0_stock_moves` (
1639 `trans_id` int(11) NOT NULL auto_increment,
1640 `trans_no` int(11) NOT NULL default '0',
1641 `stock_id` char(20) NOT NULL default '',
1642 `type` smallint(6) NOT NULL default '0',
1643 `loc_code` char(5) NOT NULL default '',
1644 `tran_date` date NOT NULL default '0000-00-00',
1645 `person_id` int(11) default NULL,
1646 `price` double NOT NULL default '0',
1647 `reference` char(40) NOT NULL default '',
1648 `qty` double NOT NULL default '1',
1649 `discount_percent` double NOT NULL default '0',
1650 `standard_cost` double NOT NULL default '0',
1651 `visible` tinyint(1) NOT NULL default '1',
1652 PRIMARY KEY (`trans_id`),
1653 KEY `type` (`type`,`trans_no`),
1654 KEY `Move` (`stock_id`,`loc_code`,`tran_date`)
1655 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
1658 -- Dumping data for table `0_stock_moves`
1662 -- --------------------------------------------------------
1665 -- Table structure for table `0_suppliers`
1668 DROP TABLE IF EXISTS `0_suppliers`;
1669 CREATE TABLE IF NOT EXISTS `0_suppliers` (
1670 `supplier_id` int(11) NOT NULL auto_increment,
1671 `supp_name` varchar(60) NOT NULL default '',
1672 `supp_ref` varchar(30) NOT NULL default '',
1673 `address` tinytext NOT NULL,
1674 `supp_address` tinytext NOT NULL,
1675 `gst_no` varchar(25) NOT NULL default '',
1676 `contact` varchar(60) NOT NULL default '',
1677 `supp_account_no` varchar(40) NOT NULL default '',
1678 `website` varchar(100) NOT NULL default '',
1679 `bank_account` varchar(60) NOT NULL default '',
1680 `curr_code` char(3) default NULL,
1681 `payment_terms` int(11) default NULL,
1682 `tax_included` tinyint(1) NOT NULL default '0',
1683 `tax_algorithm` tinyint(1) NOT NULL default '1',
1684 `dimension_id` int(11) default '0',
1685 `dimension2_id` int(11) default '0',
1686 `tax_group_id` int(11) default NULL,
1687 `credit_limit` double NOT NULL default '0',
1688 `purchase_account` varchar(15) NOT NULL default '',
1689 `payable_account` varchar(15) NOT NULL default '',
1690 `payment_discount_account` varchar(15) NOT NULL default '',
1691 `notes` tinytext NOT NULL,
1692 `inactive` tinyint(1) NOT NULL default '0',
1693 PRIMARY KEY (`supplier_id`),
1694 KEY `supp_ref` (`supp_ref`)
1695 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
1698 -- Dumping data for table `0_suppliers`
1702 -- --------------------------------------------------------
1705 -- Table structure for table `0_supp_allocations`
1708 DROP TABLE IF EXISTS `0_supp_allocations`;
1709 CREATE TABLE IF NOT EXISTS `0_supp_allocations` (
1710 `id` int(11) NOT NULL auto_increment,
1711 `person_id` int(11) DEFAULT NULL,
1712 `amt` double unsigned default NULL,
1713 `date_alloc` date NOT NULL default '0000-00-00',
1714 `trans_no_from` int(11) default NULL,
1715 `trans_type_from` int(11) default NULL,
1716 `trans_no_to` int(11) default NULL,
1717 `trans_type_to` int(11) default NULL,
1719 UNIQUE KEY `trans_type_from` (`person_id`,`trans_type_from`,`trans_no_from`,`trans_type_to`,`trans_no_to`),
1720 KEY `From` (`trans_type_from`,`trans_no_from`),
1721 KEY `To` (`trans_type_to`,`trans_no_to`)
1722 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
1725 -- Dumping data for table `0_supp_allocations`
1729 -- --------------------------------------------------------
1732 -- Table structure for table `0_supp_invoice_items`
1735 DROP TABLE IF EXISTS `0_supp_invoice_items`;
1736 CREATE TABLE IF NOT EXISTS `0_supp_invoice_items` (
1737 `id` int(11) NOT NULL auto_increment,
1738 `supp_trans_no` int(11) default NULL,
1739 `supp_trans_type` int(11) default NULL,
1740 `gl_code` varchar(15) NOT NULL default '',
1741 `grn_item_id` int(11) default NULL,
1742 `po_detail_item_id` int(11) default NULL,
1743 `stock_id` varchar(20) NOT NULL default '',
1744 `description` tinytext,
1745 `quantity` double NOT NULL default '0',
1746 `unit_price` double NOT NULL default '0',
1747 `unit_tax` double NOT NULL default '0',
1749 `dimension_id` int(11) NOT NULL DEFAULT '0',
1750 `dimension2_id` int(11) NOT NULL DEFAULT '0',
1752 KEY `Transaction` (`supp_trans_type`,`supp_trans_no`,`stock_id`)
1753 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
1756 -- Dumping data for table `0_supp_invoice_items`
1760 -- --------------------------------------------------------
1763 -- Table structure for table `0_supp_trans`
1766 DROP TABLE IF EXISTS `0_supp_trans`;
1767 CREATE TABLE IF NOT EXISTS `0_supp_trans` (
1768 `trans_no` int(11) unsigned NOT NULL default '0',
1769 `type` smallint(6) unsigned NOT NULL default '0',
1770 `supplier_id` int(11) unsigned default NULL,
1771 `reference` tinytext NOT NULL,
1772 `supp_reference` varchar(60) NOT NULL default '',
1773 `tran_date` date NOT NULL default '0000-00-00',
1774 `due_date` date NOT NULL default '0000-00-00',
1775 `ov_amount` double NOT NULL default '0',
1776 `ov_discount` double NOT NULL default '0',
1777 `ov_gst` double NOT NULL default '0',
1778 `rate` double NOT NULL default '1',
1779 `alloc` double NOT NULL default '0',
1780 `tax_included` tinyint(1) NOT NULL default '0',
1781 `tax_algorithm` tinyint(1) NOT NULL default '1',
1782 PRIMARY KEY (`type`,`trans_no`),
1783 KEY `supplier_id` (`supplier_id`),
1784 KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
1785 KEY `type` (`type`),
1786 KEY `tran_date` (`tran_date`)
1787 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1790 -- Dumping data for table `0_supp_trans`
1794 -- --------------------------------------------------------
1797 -- Table structure for table `0_sys_prefs`
1800 DROP TABLE IF EXISTS `0_sys_prefs`;
1801 CREATE TABLE IF NOT EXISTS `0_sys_prefs` (
1802 `name` varchar(35) NOT NULL default '',
1803 `category` varchar(30) default NULL,
1804 `type` varchar(20) NOT NULL default '',
1805 `length` smallint(6) default NULL,
1806 `value` text NOT NULL,
1807 PRIMARY KEY (`name`),
1808 KEY `category` (`category`)
1809 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1812 -- Dumping data for table `0_sys_prefs`
1815 INSERT INTO `0_sys_prefs` VALUES('coy_name', 'setup.company', 'varchar', 60, 'Company name');
1816 INSERT INTO `0_sys_prefs` VALUES('gst_no', 'setup.company', 'varchar', 25, '');
1817 INSERT INTO `0_sys_prefs` VALUES('coy_no', 'setup.company', 'varchar', 25, '');
1818 INSERT INTO `0_sys_prefs` VALUES('tax_prd', 'setup.company', 'int', 11, '1');
1819 INSERT INTO `0_sys_prefs` VALUES('tax_last', 'setup.company', 'int', 11, '1');
1820 INSERT INTO `0_sys_prefs` VALUES('postal_address', 'setup.company', 'tinytext', 0, 'N/A');
1821 INSERT INTO `0_sys_prefs` VALUES('phone', 'setup.company', 'varchar', 30, '');
1822 INSERT INTO `0_sys_prefs` VALUES('fax', 'setup.company', 'varchar', 30, '');
1823 INSERT INTO `0_sys_prefs` VALUES('email', 'setup.company', 'varchar', 100, '');
1824 INSERT INTO `0_sys_prefs` VALUES('coy_logo', 'setup.company', 'varchar', 100, '');
1825 INSERT INTO `0_sys_prefs` VALUES('domicile', 'setup.company', 'varchar', 55, '');
1826 INSERT INTO `0_sys_prefs` VALUES('curr_default', 'setup.company', 'char', 3, 'USD');
1827 INSERT INTO `0_sys_prefs` VALUES('use_dimension', 'setup.company', 'tinyint', 1, '1');
1828 INSERT INTO `0_sys_prefs` VALUES('f_year', 'setup.company', 'int', 11, '2');
1829 INSERT INTO `0_sys_prefs` VALUES('no_item_list', 'setup.company', 'tinyint', 1, '0');
1830 INSERT INTO `0_sys_prefs` VALUES('no_customer_list', 'setup.company', 'tinyint', 1, '0');
1831 INSERT INTO `0_sys_prefs` VALUES('no_supplier_list', 'setup.company', 'tinyint', 1, '0');
1832 INSERT INTO `0_sys_prefs` VALUES('base_sales', 'setup.company', 'int', 11, '1');
1833 INSERT INTO `0_sys_prefs` VALUES('time_zone', 'setup.company', 'tinyint', 1, '0');
1834 INSERT INTO `0_sys_prefs` VALUES('add_pct', 'setup.company', 'int', 5, '-1');
1835 INSERT INTO `0_sys_prefs` VALUES('round_to', 'setup.company', 'int', 5, '1');
1836 INSERT INTO `0_sys_prefs` VALUES('login_tout', 'setup.company', 'smallint', 6, '600');
1837 INSERT INTO `0_sys_prefs` VALUES('past_due_days', 'glsetup.general', 'int', 11, '30');
1838 INSERT INTO `0_sys_prefs` VALUES('profit_loss_year_act', 'glsetup.general', 'varchar', 15, '9990');
1839 INSERT INTO `0_sys_prefs` VALUES('retained_earnings_act', 'glsetup.general', 'varchar', 15, '3590');
1840 INSERT INTO `0_sys_prefs` VALUES('bank_charge_act', 'glsetup.general', 'varchar', 15, '5690');
1841 INSERT INTO `0_sys_prefs` VALUES('exchange_diff_act', 'glsetup.general', 'varchar', 15, '4450');
1842 INSERT INTO `0_sys_prefs` VALUES('tax_algorithm', 'glsetup.customer', 'tinyint', 1, '1');
1843 INSERT INTO `0_sys_prefs` VALUES('default_credit_limit', 'glsetup.customer', 'int', 11, '1000');
1844 INSERT INTO `0_sys_prefs` VALUES('accumulate_shipping', 'glsetup.customer', 'tinyint', 1, '0');
1845 INSERT INTO `0_sys_prefs` VALUES('legal_text', 'glsetup.customer', 'tinytext', 0, '');
1846 INSERT INTO `0_sys_prefs` VALUES('freight_act', 'glsetup.customer', 'varchar', 15, '4430');
1847 INSERT INTO `0_sys_prefs` VALUES('debtors_act', 'glsetup.sales', 'varchar', 15, '1200');
1848 INSERT INTO `0_sys_prefs` VALUES('default_sales_act', 'glsetup.sales', 'varchar', 15, '4010');
1849 INSERT INTO `0_sys_prefs` VALUES('default_sales_discount_act', 'glsetup.sales', 'varchar', 15, '4510');
1850 INSERT INTO `0_sys_prefs` VALUES('default_prompt_payment_act', 'glsetup.sales', 'varchar', 15, '4500');
1851 INSERT INTO `0_sys_prefs` VALUES('default_delivery_required', 'glsetup.sales', 'smallint', 6, '1');
1852 INSERT INTO `0_sys_prefs` VALUES('default_receival_required', 'glsetup.purchase', 'smallint', 6, '10');
1853 INSERT INTO `0_sys_prefs` VALUES('default_quote_valid_days', 'glsetup.sales', 'smallint', 6, '30');
1854 INSERT INTO `0_sys_prefs` VALUES('default_dim_required', 'glsetup.dims', 'int', 11, '20');
1855 INSERT INTO `0_sys_prefs` VALUES('pyt_discount_act', 'glsetup.purchase', 'varchar', 15, '5060');
1856 INSERT INTO `0_sys_prefs` VALUES('creditors_act', 'glsetup.purchase', 'varchar', 15, '2100');
1857 INSERT INTO `0_sys_prefs` VALUES('po_over_receive', 'glsetup.purchase', 'int', 11, '10');
1858 INSERT INTO `0_sys_prefs` VALUES('po_over_charge', 'glsetup.purchase', 'int', 11, '10');
1859 INSERT INTO `0_sys_prefs` VALUES('allow_negative_stock', 'glsetup.inventory', 'tinyint', 1, '0');
1860 INSERT INTO `0_sys_prefs` VALUES('default_inventory_act', 'glsetup.items', 'varchar', 15, '1510');
1861 INSERT INTO `0_sys_prefs` VALUES('default_cogs_act', 'glsetup.items', 'varchar', 15, '5010');
1862 INSERT INTO `0_sys_prefs` VALUES('default_adj_act', 'glsetup.items', 'varchar', 15, '5040');
1863 INSERT INTO `0_sys_prefs` VALUES('default_inv_sales_act', 'glsetup.items', 'varchar', 15, '4010');
1864 INSERT INTO `0_sys_prefs` VALUES('default_assembly_act', 'glsetup.items', 'varchar', 15, '1530');
1865 INSERT INTO `0_sys_prefs` VALUES('default_workorder_required', 'glsetup.manuf', 'int', 11, '20');
1866 INSERT INTO `0_sys_prefs` VALUES('version_id', 'system', 'varchar', 11, '2.4.0');
1867 INSERT INTO `0_sys_prefs` VALUES('auto_curr_reval', 'setup.company', 'smallint', 6, '1');
1868 INSERT INTO `0_sys_prefs` VALUES('grn_clearing_act', 'glsetup.purchase', 'varchar', 15, '1550');
1869 INSERT INTO `0_sys_prefs` VALUES('bcc_email', 'setup.company', 'varchar', 100, '');
1870 INSERT INTO `0_sys_prefs` VALUES('deferred_income_act', 'glsetup.sales', 'varchar', '15', '');
1871 INSERT INTO `0_sys_prefs` VALUES('gl_closing_date','setup.closing_date', 'date', 8, '');
1872 INSERT INTO `0_sys_prefs` VALUES('alternative_tax_include_on_docs','setup.company', 'tinyint', 1, '0');
1873 INSERT INTO `0_sys_prefs` VALUES('no_zero_lines_amount','glsetup.sales', 'tinyint', 1, '1');
1874 INSERT INTO `0_sys_prefs` VALUES('show_po_item_codes','glsetup.purchase', 'tinyint', 1, '0');
1875 INSERT INTO `0_sys_prefs` VALUES('accounts_alpha','glsetup.general', 'tinyint', 1, '0');
1876 INSERT INTO `0_sys_prefs` VALUES('loc_notification','glsetup.inventory', 'tinyint', 1, '0');
1877 INSERT INTO `0_sys_prefs` VALUES('print_invoice_no','glsetup.sales', 'tinyint', 1, '0');
1878 INSERT INTO `0_sys_prefs` VALUES('allow_negative_prices','glsetup.inventory', 'tinyint', 1, '1');
1879 INSERT INTO `0_sys_prefs` VALUES('print_item_images_on_quote','glsetup.inventory', 'tinyint', 1, '0');
1880 INSERT INTO `0_sys_prefs` VALUES('suppress_tax_rates','setup.company', 'tinyint', 1, '0');
1882 -- --------------------------------------------------------
1885 -- Table structure for table `0_sys_types`
1888 DROP TABLE IF EXISTS `0_sys_types`;
1889 CREATE TABLE IF NOT EXISTS `0_sys_types` (
1890 `type_id` smallint(6) NOT NULL default '0',
1891 `type_no` int(11) NOT NULL default '1',
1892 `next_reference` varchar(100) NOT NULL default '',
1893 PRIMARY KEY (`type_id`)
1894 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1897 -- Dumping data for table `0_sys_types`
1900 INSERT INTO `0_sys_types` VALUES(0, 17, '1');
1901 INSERT INTO `0_sys_types` VALUES(1, 7, '1');
1902 INSERT INTO `0_sys_types` VALUES(2, 4, '1');
1903 INSERT INTO `0_sys_types` VALUES(4, 3, '1');
1904 INSERT INTO `0_sys_types` VALUES(10, 16, '1');
1905 INSERT INTO `0_sys_types` VALUES(11, 2, '1');
1906 INSERT INTO `0_sys_types` VALUES(12, 6, '1');
1907 INSERT INTO `0_sys_types` VALUES(13, 1, '1');
1908 INSERT INTO `0_sys_types` VALUES(16, 2, '1');
1909 INSERT INTO `0_sys_types` VALUES(17, 2, '1');
1910 INSERT INTO `0_sys_types` VALUES(18, 1, '1');
1911 INSERT INTO `0_sys_types` VALUES(20, 6, '1');
1912 INSERT INTO `0_sys_types` VALUES(21, 1, '1');
1913 INSERT INTO `0_sys_types` VALUES(22, 3, '1');
1914 INSERT INTO `0_sys_types` VALUES(25, 1, '1');
1915 INSERT INTO `0_sys_types` VALUES(26, 1, '1');
1916 INSERT INTO `0_sys_types` VALUES(28, 1, '1');
1917 INSERT INTO `0_sys_types` VALUES(29, 1, '1');
1918 INSERT INTO `0_sys_types` VALUES(30, 0, '1');
1919 INSERT INTO `0_sys_types` VALUES(32, 0, '1');
1920 INSERT INTO `0_sys_types` VALUES(35, 1, '1');
1921 INSERT INTO `0_sys_types` VALUES(40, 1, '1');
1923 -- --------------------------------------------------------
1926 -- Table structure for table `0_tags`
1929 DROP TABLE IF EXISTS `0_tags`;
1930 CREATE TABLE IF NOT EXISTS `0_tags` (
1931 `id` int(11) NOT NULL auto_increment,
1932 `type` smallint(6) NOT NULL,
1933 `name` varchar(30) NOT NULL,
1934 `description` varchar(60) default NULL,
1935 `inactive` tinyint(1) NOT NULL default '0',
1937 UNIQUE KEY `type` (`type`,`name`)
1938 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
1941 -- Dumping data for table `0_tags`
1945 -- --------------------------------------------------------
1948 -- Table structure for table `0_tag_associations`
1951 DROP TABLE IF EXISTS `0_tag_associations`;
1952 CREATE TABLE IF NOT EXISTS `0_tag_associations` (
1953 `record_id` varchar(15) NOT NULL,
1954 `tag_id` int(11) NOT NULL,
1955 UNIQUE KEY `record_id` (`record_id`,`tag_id`)
1956 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1959 -- Dumping data for table `0_tag_associations`
1963 -- --------------------------------------------------------
1966 -- Table structure for table `0_tax_groups`
1969 DROP TABLE IF EXISTS `0_tax_groups`;
1970 CREATE TABLE IF NOT EXISTS `0_tax_groups` (
1971 `id` int(11) NOT NULL auto_increment,
1972 `name` varchar(60) NOT NULL default '',
1973 `inactive` tinyint(1) NOT NULL default '0',
1975 UNIQUE KEY `name` (`name`)
1976 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
1979 -- Dumping data for table `0_tax_groups`
1982 INSERT INTO `0_tax_groups` VALUES(1, 'Tax', 0);
1983 INSERT INTO `0_tax_groups` VALUES(2, 'Tax Exempt', 0);
1985 -- --------------------------------------------------------
1988 -- Table structure for table `0_tax_group_items`
1991 DROP TABLE IF EXISTS `0_tax_group_items`;
1992 CREATE TABLE IF NOT EXISTS `0_tax_group_items` (
1993 `tax_group_id` int(11) NOT NULL default '0',
1994 `tax_type_id` int(11) NOT NULL default '0',
1995 `tax_shipping` tinyint(1) NOT NULL default '0',
1996 PRIMARY KEY (`tax_group_id`,`tax_type_id`)
1997 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2000 -- Dumping data for table `0_tax_group_items`
2003 INSERT INTO `0_tax_group_items` VALUES(1, 1, 1);
2005 -- --------------------------------------------------------
2008 -- Table structure for table `0_tax_types`
2011 DROP TABLE IF EXISTS `0_tax_types`;
2012 CREATE TABLE IF NOT EXISTS `0_tax_types` (
2013 `id` int(11) NOT NULL auto_increment,
2014 `rate` double NOT NULL default '0',
2015 `sales_gl_code` varchar(15) NOT NULL default '',
2016 `purchasing_gl_code` varchar(15) NOT NULL default '',
2017 `name` varchar(60) NOT NULL default '',
2018 `inactive` tinyint(1) NOT NULL default '0',
2020 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
2023 -- Dumping data for table `0_tax_types`
2026 INSERT INTO `0_tax_types` VALUES(1, 5, '2150', '2150', 'Tax', 0);
2028 -- --------------------------------------------------------
2031 -- Table structure for table `0_trans_tax_details`
2034 DROP TABLE IF EXISTS `0_trans_tax_details`;
2035 CREATE TABLE IF NOT EXISTS `0_trans_tax_details` (
2036 `id` int(11) NOT NULL auto_increment,
2037 `trans_type` smallint(6) default NULL,
2038 `trans_no` int(11) default NULL,
2039 `tran_date` date NOT NULL,
2040 `tax_type_id` int(11) NOT NULL default '0',
2041 `rate` double NOT NULL default '0',
2042 `ex_rate` double NOT NULL default '1',
2043 `included_in_price` tinyint(1) NOT NULL default '0',
2044 `net_amount` double NOT NULL default '0',
2045 `amount` double NOT NULL default '0',
2047 `reg_type` tinyint(1) default NULL,
2049 KEY `Type_and_Number` (`trans_type`,`trans_no`),
2050 KEY `tran_date` (`tran_date`)
2051 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
2054 -- Dumping data for table `0_trans_tax_details`
2058 -- --------------------------------------------------------
2061 -- Table structure for table `0_useronline`
2064 DROP TABLE IF EXISTS `0_useronline`;
2065 CREATE TABLE IF NOT EXISTS `0_useronline` (
2066 `id` int(11) NOT NULL auto_increment,
2067 `timestamp` int(15) NOT NULL default '0',
2068 `ip` varchar(40) NOT NULL default '',
2069 `file` varchar(100) NOT NULL default '',
2071 KEY `timestamp` (`timestamp`),
2073 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
2076 -- Dumping data for table `0_useronline`
2080 -- --------------------------------------------------------
2083 -- Table structure for table `0_users`
2086 DROP TABLE IF EXISTS `0_users`;
2087 CREATE TABLE IF NOT EXISTS `0_users` (
2088 `id` smallint(6) NOT NULL auto_increment,
2089 `user_id` varchar(60) NOT NULL default '',
2090 `password` varchar(100) NOT NULL default '',
2091 `real_name` varchar(100) NOT NULL default '',
2092 `role_id` int(11) NOT NULL default '1',
2093 `phone` varchar(30) NOT NULL default '',
2094 `email` varchar(100) default NULL,
2095 `language` varchar(20) default NULL,
2096 `date_format` tinyint(1) NOT NULL default '0',
2097 `date_sep` tinyint(1) NOT NULL default '0',
2098 `tho_sep` tinyint(1) NOT NULL default '0',
2099 `dec_sep` tinyint(1) NOT NULL default '0',
2100 `theme` varchar(20) NOT NULL default 'default',
2101 `page_size` varchar(20) NOT NULL default 'A4',
2102 `prices_dec` smallint(6) NOT NULL default '2',
2103 `qty_dec` smallint(6) NOT NULL default '2',
2104 `rates_dec` smallint(6) NOT NULL default '4',
2105 `percent_dec` smallint(6) NOT NULL default '1',
2106 `show_gl` tinyint(1) NOT NULL default '1',
2107 `show_codes` tinyint(1) NOT NULL default '0',
2108 `show_hints` tinyint(1) NOT NULL default '0',
2109 `last_visit_date` datetime default NULL,
2110 `query_size` tinyint(1) unsigned NOT NULL default '10',
2111 `graphic_links` tinyint(1) default '1',
2112 `pos` smallint(6) default '1',
2113 `print_profile` varchar(30) NOT NULL default '',
2114 `rep_popup` tinyint(1) default '1',
2115 `sticky_doc_date` tinyint(1) default '0',
2116 `startup_tab` varchar(20) NOT NULL default '',
2117 `transaction_days` smallint(6) NOT NULL default '30',
2118 `save_report_selections` smallint(6) NOT NULL default '0',
2119 `use_date_picker` tinyint(1) NOT NULL default '1',
2120 `def_print_destination` tinyint(1) NOT NULL default '0',
2121 `def_print_orientation` tinyint(1) NOT NULL default '0',
2122 `inactive` tinyint(1) NOT NULL default '0',
2124 UNIQUE KEY `user_id` (`user_id`)
2125 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
2128 -- Dumping data for table `0_users`
2131 INSERT INTO `0_users` VALUES(1, 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', 2, '', 'adm@adm.com', 'en_US', 0, 0, 0, 0, 'default', 'Letter', 2, 2, 4, 1, 1, 0, 0, '2008-04-04 12:34:29', 10, 1, 1, '1', 1, 0, 'orders', 30, 0, 1, 0, 0, 0);
2133 -- --------------------------------------------------------
2136 -- Table structure for table `0_voided`
2139 DROP TABLE IF EXISTS `0_voided`;
2140 CREATE TABLE IF NOT EXISTS `0_voided` (
2141 `type` int(11) NOT NULL default '0',
2142 `id` int(11) NOT NULL default '0',
2143 `date_` date NOT NULL default '0000-00-00',
2144 `memo_` tinytext NOT NULL,
2145 UNIQUE KEY `id` (`type`,`id`)
2146 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2149 -- Dumping data for table `0_voided`
2153 -- --------------------------------------------------------
2156 -- Table structure for table `0_workcentres`
2159 DROP TABLE IF EXISTS `0_workcentres`;
2160 CREATE TABLE IF NOT EXISTS `0_workcentres` (
2161 `id` int(11) NOT NULL auto_increment,
2162 `name` char(40) NOT NULL default '',
2163 `description` char(50) NOT NULL default '',
2164 `inactive` tinyint(1) NOT NULL default '0',
2166 UNIQUE KEY `name` (`name`)
2167 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
2170 -- Dumping data for table `0_workcentres`
2174 -- --------------------------------------------------------
2177 -- Table structure for table `0_workorders`
2180 DROP TABLE IF EXISTS `0_workorders`;
2181 CREATE TABLE IF NOT EXISTS `0_workorders` (
2182 `id` int(11) NOT NULL auto_increment,
2183 `wo_ref` varchar(60) NOT NULL default '',
2184 `loc_code` varchar(5) NOT NULL default '',
2185 `units_reqd` double NOT NULL default '1',
2186 `stock_id` varchar(20) NOT NULL default '',
2187 `date_` date NOT NULL default '0000-00-00',
2188 `type` tinyint(4) NOT NULL default '0',
2189 `required_by` date NOT NULL default '0000-00-00',
2190 `released_date` date NOT NULL default '0000-00-00',
2191 `units_issued` double NOT NULL default '0',
2192 `closed` tinyint(1) NOT NULL default '0',
2193 `released` tinyint(1) NOT NULL default '0',
2194 `additional_costs` double NOT NULL default '0',
2196 UNIQUE KEY `wo_ref` (`wo_ref`)
2197 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
2200 -- Dumping data for table `0_workorders`
2204 -- --------------------------------------------------------
2207 -- Table structure for table `0_wo_costing`
2210 DROP TABLE IF EXISTS `0_wo_costing`;
2211 CREATE TABLE `0_wo_costing` (
2212 `id` int(11) NOT NULL auto_increment,
2213 `workorder_id` int(11) NOT NULL default '0',
2214 `cost_type` tinyint(1) NOT NULL default '0',
2215 `trans_type` int(11) NOT NULL default '0',
2216 `trans_no` int(11) NOT NULL default '0',
2217 `factor` double NOT NULL default '1',
2219 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2222 -- Dumping data for table `0_wo_costing`
2226 -- --------------------------------------------------------
2229 -- Table structure for table `0_wo_issues`
2232 DROP TABLE IF EXISTS `0_wo_issues`;
2233 CREATE TABLE IF NOT EXISTS `0_wo_issues` (
2234 `issue_no` int(11) NOT NULL auto_increment,
2235 `workorder_id` int(11) NOT NULL default '0',
2236 `reference` varchar(100) default NULL,
2237 `issue_date` date default NULL,
2238 `loc_code` varchar(5) default NULL,
2239 `workcentre_id` int(11) default NULL,
2240 PRIMARY KEY (`issue_no`),
2241 KEY `workorder_id` (`workorder_id`)
2242 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
2245 -- Dumping data for table `0_wo_issues`
2249 -- --------------------------------------------------------
2252 -- Table structure for table `0_wo_issue_items`
2255 DROP TABLE IF EXISTS `0_wo_issue_items`;
2256 CREATE TABLE IF NOT EXISTS `0_wo_issue_items` (
2257 `id` int(11) NOT NULL auto_increment,
2258 `stock_id` varchar(40) default NULL,
2259 `issue_id` int(11) default NULL,
2260 `qty_issued` double default NULL,
2262 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
2265 -- Dumping data for table `0_wo_issue_items`
2269 -- --------------------------------------------------------
2272 -- Table structure for table `0_wo_manufacture`
2275 DROP TABLE IF EXISTS `0_wo_manufacture`;
2276 CREATE TABLE IF NOT EXISTS `0_wo_manufacture` (
2277 `id` int(11) NOT NULL auto_increment,
2278 `reference` varchar(100) default NULL,
2279 `workorder_id` int(11) NOT NULL default '0',
2280 `quantity` double NOT NULL default '0',
2281 `date_` date NOT NULL default '0000-00-00',
2283 KEY `workorder_id` (`workorder_id`)
2284 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
2287 -- Dumping data for table `0_wo_manufacture`
2291 -- --------------------------------------------------------
2294 -- Table structure for table `0_wo_requirements`
2297 DROP TABLE IF EXISTS `0_wo_requirements`;
2298 CREATE TABLE IF NOT EXISTS `0_wo_requirements` (
2299 `id` int(11) NOT NULL auto_increment,
2300 `workorder_id` int(11) NOT NULL default '0',
2301 `stock_id` char(20) NOT NULL default '',
2302 `workcentre` int(11) NOT NULL default '0',
2303 `units_req` double NOT NULL default '1',
2304 `std_cost` double NOT NULL default '0',
2305 `loc_code` char(5) NOT NULL default '',
2306 `units_issued` double NOT NULL default '0',
2308 KEY `workorder_id` (`workorder_id`)
2309 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
2312 -- Dumping data for table `0_wo_requirements`