2 -- version 2.11.8.1deb5
3 -- http://www.phpmyadmin.net
6 -- Generation Time: May 11, 2010 at 11:37 PM
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=MyISAM 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=MyISAM 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,
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 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=MyISAM 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 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=MyISAM 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 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',
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`)
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`)
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`)
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=MyISAM 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 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 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 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`)
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 `amt` double unsigned default NULL,
533 `date_alloc` date NOT NULL default '0000-00-00',
534 `trans_no_from` int(11) default NULL,
535 `trans_type_from` int(11) default NULL,
536 `trans_no_to` int(11) default NULL,
537 `trans_type_to` int(11) default NULL,
539 UNIQUE KEY (`trans_type_from`,`trans_no_from`,`trans_type_to`,`trans_no_to`),
540 KEY `From` (`trans_type_from`,`trans_no_from`),
541 KEY `To` (`trans_type_to`,`trans_no_to`)
542 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
545 -- Dumping data for table `0_cust_allocations`
549 -- --------------------------------------------------------
552 -- Table structure for table `0_cust_branch`
555 DROP TABLE IF EXISTS `0_cust_branch`;
556 CREATE TABLE IF NOT EXISTS `0_cust_branch` (
557 `branch_code` int(11) NOT NULL auto_increment,
558 `debtor_no` int(11) NOT NULL default '0',
559 `br_name` varchar(60) NOT NULL default '',
560 `branch_ref` varchar(30) NOT NULL default '',
561 `br_address` tinytext NOT NULL,
562 `area` int(11) default NULL,
563 `salesman` int(11) NOT NULL default '0',
564 `contact_name` varchar(60) NOT NULL default '',
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 `disable_trans` tinyint(4) NOT NULL default '0',
573 `br_post_address` tinytext NOT NULL,
574 `group_no` int(11) NOT NULL default '0',
575 `notes` tinytext NOT NULL,
576 `bank_account` varchar(60) DEFAULT NULL,
577 `inactive` tinyint(1) NOT NULL default '0',
578 PRIMARY KEY (`branch_code`,`debtor_no`),
579 KEY `branch_code` (`branch_code`),
580 KEY `branch_ref` (`branch_ref`),
581 KEY `group_no` (`group_no`)
582 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
585 -- Dumping data for table `0_cust_branch`
589 -- --------------------------------------------------------
592 -- Table structure for table `0_debtors_master`
595 DROP TABLE IF EXISTS `0_debtors_master`;
596 CREATE TABLE IF NOT EXISTS `0_debtors_master` (
597 `debtor_no` int(11) NOT NULL auto_increment,
598 `name` varchar(100) NOT NULL default '',
599 `debtor_ref` varchar(30) NOT NULL,
601 `tax_id` varchar(55) NOT NULL default '',
602 `curr_code` char(3) NOT NULL default '',
603 `sales_type` int(11) NOT NULL default '1',
604 `dimension_id` int(11) NOT NULL default '0',
605 `dimension2_id` int(11) NOT NULL default '0',
606 `credit_status` int(11) NOT NULL default '0',
607 `payment_terms` int(11) default NULL,
608 `discount` double NOT NULL default '0',
609 `pymt_discount` double NOT NULL default '0',
610 `credit_limit` float NOT NULL default '1000',
611 `notes` tinytext NOT NULL,
612 `inactive` tinyint(1) NOT NULL default '0',
613 PRIMARY KEY (`debtor_no`),
615 UNIQUE KEY `debtor_ref` (`debtor_ref`)
616 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
619 -- Dumping data for table `0_debtors_master`
623 -- --------------------------------------------------------
626 -- Table structure for table `0_debtor_trans`
629 DROP TABLE IF EXISTS `0_debtor_trans`;
630 CREATE TABLE IF NOT EXISTS `0_debtor_trans` (
631 `trans_no` int(11) unsigned NOT NULL default '0',
632 `type` smallint(6) unsigned NOT NULL default '0',
633 `version` tinyint(1) unsigned NOT NULL default '0',
634 `debtor_no` int(11) unsigned default NULL,
635 `branch_code` int(11) NOT NULL default '-1',
636 `tran_date` date NOT NULL default '0000-00-00',
637 `due_date` date NOT NULL default '0000-00-00',
638 `reference` varchar(60) NOT NULL default '',
639 `tpe` int(11) NOT NULL default '0',
640 `order_` int(11) NOT NULL default '0',
641 `ov_amount` double NOT NULL default '0',
642 `ov_gst` double NOT NULL default '0',
643 `ov_freight` double NOT NULL default '0',
644 `ov_freight_tax` double NOT NULL default '0',
645 `ov_discount` double NOT NULL default '0',
646 `alloc` double NOT NULL default '0',
647 `prep_amount` double NOT NULL DEFAULT '0',
648 `rate` double NOT NULL default '1',
649 `ship_via` int(11) default NULL,
650 `dimension_id` int(11) NOT NULL default '0',
651 `dimension2_id` int(11) NOT NULL default '0',
652 `payment_terms` int(11) default NULL,
653 `tax_included` tinyint(1) unsigned NOT NULL default '0',
654 PRIMARY KEY (`type`,`trans_no`),
655 KEY `debtor_no` (`debtor_no`,`branch_code`),
656 KEY `tran_date` (`tran_date`),
657 KEY `order_` (`order_`)
661 -- Dumping data for table `0_debtor_trans`
665 -- --------------------------------------------------------
668 -- Table structure for table `0_debtor_trans_details`
671 DROP TABLE IF EXISTS `0_debtor_trans_details`;
672 CREATE TABLE IF NOT EXISTS `0_debtor_trans_details` (
673 `id` int(11) NOT NULL auto_increment,
674 `debtor_trans_no` int(11) default NULL,
675 `debtor_trans_type` int(11) default NULL,
676 `stock_id` varchar(20) NOT NULL default '',
677 `description` tinytext,
678 `unit_price` double NOT NULL default '0',
679 `unit_tax` double NOT NULL default '0',
680 `quantity` double NOT NULL default '0',
681 `discount_percent` double NOT NULL default '0',
682 `standard_cost` double NOT NULL default '0',
683 `qty_done` double NOT NULL default '0',
684 `src_id` int(11) NOT NULL,
686 KEY `Transaction` (`debtor_trans_type`,`debtor_trans_no`),
688 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
691 -- Dumping data for table `0_debtor_trans_details`
695 -- --------------------------------------------------------
698 -- Table structure for table `0_dimensions`
701 DROP TABLE IF EXISTS `0_dimensions`;
702 CREATE TABLE IF NOT EXISTS `0_dimensions` (
703 `id` int(11) NOT NULL auto_increment,
704 `reference` varchar(60) NOT NULL default '',
705 `name` varchar(60) NOT NULL default '',
706 `type_` tinyint(1) NOT NULL default '1',
707 `closed` tinyint(1) NOT NULL default '0',
708 `date_` date NOT NULL default '0000-00-00',
709 `due_date` date NOT NULL default '0000-00-00',
711 UNIQUE KEY `reference` (`reference`),
712 KEY `date_` (`date_`),
713 KEY `due_date` (`due_date`),
714 KEY `type_` (`type_`)
715 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
718 -- Dumping data for table `0_dimensions`
722 -- --------------------------------------------------------
725 -- Table structure for table `0_exchange_rates`
728 DROP TABLE IF EXISTS `0_exchange_rates`;
729 CREATE TABLE IF NOT EXISTS `0_exchange_rates` (
730 `id` int(11) NOT NULL auto_increment,
731 `curr_code` char(3) NOT NULL default '',
732 `rate_buy` double NOT NULL default '0',
733 `rate_sell` double NOT NULL default '0',
734 `date_` date NOT NULL default '0000-00-00',
736 UNIQUE KEY `curr_code` (`curr_code`,`date_`)
737 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
740 -- Dumping data for table `0_exchange_rates`
744 -- --------------------------------------------------------
747 -- Table structure for table `0_fiscal_year`
750 DROP TABLE IF EXISTS `0_fiscal_year`;
751 CREATE TABLE IF NOT EXISTS `0_fiscal_year` (
752 `id` int(11) NOT NULL auto_increment,
753 `begin` date default '0000-00-00',
754 `end` date default '0000-00-00',
755 `closed` tinyint(1) NOT NULL default '0',
757 UNIQUE KEY `begin` (`begin`),
758 UNIQUE KEY `end` (`end`)
759 ) ENGINE=InnoDB AUTO_INCREMENT=4 ;
762 -- Dumping data for table `0_fiscal_year`
765 INSERT INTO `0_fiscal_year` VALUES(1, '2008-01-01', '2008-12-31', 0);
766 INSERT INTO `0_fiscal_year` VALUES(2, '2009-01-01', '2009-12-31', 0);
767 INSERT INTO `0_fiscal_year` VALUES(3, '2010-01-01', '2010-12-31', 0);
768 INSERT INTO `0_fiscal_year` VALUES(4, '2011-01-01', '2011-12-31', 0);
769 INSERT INTO `0_fiscal_year` VALUES(5, '2012-01-01', '2012-12-31', 0);
770 INSERT INTO `0_fiscal_year` VALUES(6, '2013-01-01', '2013-12-31', 0);
773 -- Table structure for table `0_gl_trans`
776 DROP TABLE IF EXISTS `0_gl_trans`;
777 CREATE TABLE IF NOT EXISTS `0_gl_trans` (
778 `counter` int(11) NOT NULL auto_increment,
779 `type` smallint(6) NOT NULL default '0',
780 `type_no` bigint(16) NOT NULL default '1',
781 `tran_date` date NOT NULL default '0000-00-00',
782 `account` varchar(15) NOT NULL default '',
783 `memo_` tinytext NOT NULL,
784 `amount` double NOT NULL default '0',
785 `dimension_id` int(11) NOT NULL default '0',
786 `dimension2_id` int(11) NOT NULL default '0',
787 `person_type_id` int(11) default NULL,
788 `person_id` tinyblob,
789 PRIMARY KEY (`counter`),
790 KEY `Type_and_Number` (`type`,`type_no`),
791 KEY `dimension_id` (`dimension_id`),
792 KEY `dimension2_id` (`dimension2_id`),
793 KEY `tran_date` (`tran_date`),
794 KEY `account_and_tran_date` (`account`,`tran_date`)
795 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
798 -- Dumping data for table `0_gl_trans`
802 -- --------------------------------------------------------
805 -- Table structure for table `0_grn_batch`
808 DROP TABLE IF EXISTS `0_grn_batch`;
809 CREATE TABLE IF NOT EXISTS `0_grn_batch` (
810 `id` int(11) NOT NULL auto_increment,
811 `supplier_id` int(11) NOT NULL default '0',
812 `purch_order_no` int(11) default NULL,
813 `reference` varchar(60) NOT NULL default '',
814 `delivery_date` date NOT NULL default '0000-00-00',
815 `loc_code` varchar(5) default NULL,
816 `rate` double NOT NULL default '1',
818 KEY `delivery_date` (`delivery_date`),
819 KEY `purch_order_no` (`purch_order_no`)
820 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
823 -- Dumping data for table `0_grn_batch`
827 -- --------------------------------------------------------
830 -- Table structure for table `0_grn_items`
833 DROP TABLE IF EXISTS `0_grn_items`;
834 CREATE TABLE IF NOT EXISTS `0_grn_items` (
835 `id` int(11) NOT NULL auto_increment,
836 `grn_batch_id` int(11) default NULL,
837 `po_detail_item` int(11) NOT NULL default '0',
838 `item_code` varchar(20) NOT NULL default '',
839 `description` tinytext,
840 `qty_recd` double NOT NULL default '0',
841 `quantity_inv` double NOT NULL default '0',
843 KEY `grn_batch_id` (`grn_batch_id`)
844 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
847 -- Dumping data for table `0_grn_items`
851 -- --------------------------------------------------------
854 -- Table structure for table `0_groups`
857 DROP TABLE IF EXISTS `0_groups`;
858 CREATE TABLE IF NOT EXISTS `0_groups` (
859 `id` smallint(6) unsigned NOT NULL auto_increment,
860 `description` varchar(60) NOT NULL default '',
861 `inactive` tinyint(1) NOT NULL default '0',
863 UNIQUE KEY `description` (`description`)
864 ) ENGINE=MyISAM AUTO_INCREMENT=4 ;
867 -- Dumping data for table `0_groups`
870 INSERT INTO `0_groups` VALUES(1, 'Small', 0);
871 INSERT INTO `0_groups` VALUES(2, 'Medium', 0);
872 INSERT INTO `0_groups` VALUES(3, 'Large', 0);
874 -- --------------------------------------------------------
877 -- Table structure for table `0_item_codes`
880 DROP TABLE IF EXISTS `0_item_codes`;
881 CREATE TABLE IF NOT EXISTS `0_item_codes` (
882 `id` int(11) unsigned NOT NULL auto_increment,
883 `item_code` varchar(20) NOT NULL,
884 `stock_id` varchar(20) NOT NULL,
885 `description` varchar(200) NOT NULL default '',
886 `category_id` smallint(6) unsigned NOT NULL,
887 `quantity` double NOT NULL default '1',
888 `is_foreign` tinyint(1) NOT NULL default '0',
889 `inactive` tinyint(1) NOT NULL default '0',
891 UNIQUE KEY `stock_id` (`stock_id`,`item_code`),
892 KEY `item_code` (`item_code`)
893 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
896 -- Dumping data for table `0_item_codes`
900 -- --------------------------------------------------------
903 -- Table structure for table `0_item_tax_types`
906 DROP TABLE IF EXISTS `0_item_tax_types`;
907 CREATE TABLE IF NOT EXISTS `0_item_tax_types` (
908 `id` int(11) NOT NULL auto_increment,
909 `name` varchar(60) NOT NULL default '',
910 `exempt` tinyint(1) NOT NULL default '0',
911 `inactive` tinyint(1) NOT NULL default '0',
913 UNIQUE KEY `name` (`name`)
914 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
917 -- Dumping data for table `0_item_tax_types`
920 INSERT INTO `0_item_tax_types` VALUES(1, 'Regular', 0, 0);
922 -- --------------------------------------------------------
925 -- Table structure for table `0_item_tax_type_exemptions`
928 DROP TABLE IF EXISTS `0_item_tax_type_exemptions`;
929 CREATE TABLE IF NOT EXISTS `0_item_tax_type_exemptions` (
930 `item_tax_type_id` int(11) NOT NULL default '0',
931 `tax_type_id` int(11) NOT NULL default '0',
932 PRIMARY KEY (`item_tax_type_id`,`tax_type_id`)
936 -- Dumping data for table `0_item_tax_type_exemptions`
940 -- --------------------------------------------------------
943 -- Table structure for table `0_item_units`
946 DROP TABLE IF EXISTS `0_item_units`;
947 CREATE TABLE IF NOT EXISTS `0_item_units` (
948 `abbr` varchar(20) NOT NULL,
949 `name` varchar(40) NOT NULL,
950 `decimals` tinyint(2) NOT NULL,
951 `inactive` tinyint(1) NOT NULL default '0',
952 PRIMARY KEY (`abbr`),
953 UNIQUE KEY `name` (`name`)
957 -- Dumping data for table `0_item_units`
960 INSERT INTO `0_item_units` VALUES('ea.', 'Each', 0, 0);
962 -- --------------------------------------------------------
965 -- Table structure for table `0_locations`
968 DROP TABLE IF EXISTS `0_locations`;
969 CREATE TABLE IF NOT EXISTS `0_locations` (
970 `loc_code` varchar(5) NOT NULL default '',
971 `location_name` varchar(60) NOT NULL default '',
972 `delivery_address` tinytext NOT NULL,
973 `phone` varchar(30) NOT NULL default '',
974 `phone2` varchar(30) NOT NULL default '',
975 `fax` varchar(30) NOT NULL default '',
976 `email` varchar(100) NOT NULL default '',
977 `contact` varchar(30) NOT NULL default '',
978 `inactive` tinyint(1) NOT NULL default '0',
979 PRIMARY KEY (`loc_code`)
983 -- Dumping data for table `0_locations`
986 INSERT INTO `0_locations` VALUES('DEF', 'Default', 'N/A', '', '', '', '', '', 0);
988 -- --------------------------------------------------------
991 -- Table structure for table `0_loc_stock`
994 DROP TABLE IF EXISTS `0_loc_stock`;
995 CREATE TABLE IF NOT EXISTS `0_loc_stock` (
996 `loc_code` char(5) NOT NULL default '',
997 `stock_id` char(20) NOT NULL default '',
998 `reorder_level` bigint(20) NOT NULL default '0',
999 PRIMARY KEY (`loc_code`,`stock_id`),
1000 KEY `stock_id` (`stock_id`)
1004 -- Dumping data for table `0_loc_stock`
1008 -- --------------------------------------------------------
1011 -- Table structure for table `0_movement_types`
1014 DROP TABLE IF EXISTS `0_movement_types`;
1015 CREATE TABLE IF NOT EXISTS `0_movement_types` (
1016 `id` int(11) NOT NULL auto_increment,
1017 `name` varchar(60) NOT NULL default '',
1018 `inactive` tinyint(1) NOT NULL default '0',
1020 UNIQUE KEY `name` (`name`)
1021 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
1024 -- Dumping data for table `0_movement_types`
1027 INSERT INTO `0_movement_types` VALUES(1, 'Adjustment', 0);
1029 -- --------------------------------------------------------
1032 -- Table structure for table `0_payment_terms`
1035 DROP TABLE IF EXISTS `0_payment_terms`;
1036 CREATE TABLE IF NOT EXISTS `0_payment_terms` (
1037 `terms_indicator` int(11) NOT NULL auto_increment,
1038 `terms` char(80) NOT NULL default '',
1039 `days_before_due` smallint(6) NOT NULL default '0',
1040 `day_in_following_month` smallint(6) NOT NULL default '0',
1041 `inactive` tinyint(1) NOT NULL default '0',
1042 PRIMARY KEY (`terms_indicator`),
1043 UNIQUE KEY `terms` (`terms`)
1044 ) ENGINE=MyISAM AUTO_INCREMENT=5 ;
1047 -- Dumping data for table `0_payment_terms`
1050 INSERT INTO `0_payment_terms` VALUES(1, 'Due 15th Of the Following Month', 0, 17, 0);
1051 INSERT INTO `0_payment_terms` VALUES(2, 'Due By End Of The Following Month', 0, 30, 0);
1052 INSERT INTO `0_payment_terms` VALUES(3, 'Payment due within 10 days', 10, 0, 0);
1053 INSERT INTO `0_payment_terms` VALUES(4, 'Cash Only', 0, 0, 0);
1055 -- --------------------------------------------------------
1058 -- Table structure for table `0_prices`
1061 DROP TABLE IF EXISTS `0_prices`;
1062 CREATE TABLE IF NOT EXISTS `0_prices` (
1063 `id` int(11) NOT NULL auto_increment,
1064 `stock_id` varchar(20) NOT NULL default '',
1065 `sales_type_id` int(11) NOT NULL default '0',
1066 `curr_abrev` char(3) NOT NULL default '',
1067 `price` double NOT NULL default '0',
1069 UNIQUE KEY `price` (`stock_id`,`sales_type_id`,`curr_abrev`)
1070 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1073 -- Dumping data for table `0_prices`
1077 -- --------------------------------------------------------
1080 -- Table structure for table `0_printers`
1083 DROP TABLE IF EXISTS `0_printers`;
1084 CREATE TABLE IF NOT EXISTS `0_printers` (
1085 `id` tinyint(3) unsigned NOT NULL auto_increment,
1086 `name` varchar(20) NOT NULL,
1087 `description` varchar(60) NOT NULL,
1088 `queue` varchar(20) NOT NULL,
1089 `host` varchar(40) NOT NULL,
1090 `port` smallint(11) unsigned NOT NULL,
1091 `timeout` tinyint(3) unsigned NOT NULL,
1093 UNIQUE KEY `name` (`name`)
1094 ) ENGINE=MyISAM AUTO_INCREMENT=4 ;
1097 -- Dumping data for table `0_printers`
1100 INSERT INTO `0_printers` VALUES(1, 'QL500', 'Label printer', 'QL500', 'server', 127, 20);
1101 INSERT INTO `0_printers` VALUES(2, 'Samsung', 'Main network printer', 'scx4521F', 'server', 515, 5);
1102 INSERT INTO `0_printers` VALUES(3, 'Local', 'Local print server at user IP', 'lp', '', 515, 10);
1104 -- --------------------------------------------------------
1107 -- Table structure for table `0_print_profiles`
1110 DROP TABLE IF EXISTS `0_print_profiles`;
1111 CREATE TABLE IF NOT EXISTS `0_print_profiles` (
1112 `id` smallint(6) unsigned NOT NULL auto_increment,
1113 `profile` varchar(30) NOT NULL,
1114 `report` varchar(5) default NULL,
1115 `printer` tinyint(3) unsigned default NULL,
1117 UNIQUE KEY `profile` (`profile`,`report`)
1118 ) ENGINE=MyISAM AUTO_INCREMENT=10 ;
1121 -- Dumping data for table `0_print_profiles`
1124 INSERT INTO `0_print_profiles` VALUES(1, 'Out of office', '', 0);
1125 INSERT INTO `0_print_profiles` VALUES(2, 'Sales Department', '', 0);
1126 INSERT INTO `0_print_profiles` VALUES(3, 'Central', '', 2);
1127 INSERT INTO `0_print_profiles` VALUES(4, 'Sales Department', '104', 2);
1128 INSERT INTO `0_print_profiles` VALUES(5, 'Sales Department', '105', 2);
1129 INSERT INTO `0_print_profiles` VALUES(6, 'Sales Department', '107', 2);
1130 INSERT INTO `0_print_profiles` VALUES(7, 'Sales Department', '109', 2);
1131 INSERT INTO `0_print_profiles` VALUES(8, 'Sales Department', '110', 2);
1132 INSERT INTO `0_print_profiles` VALUES(9, 'Sales Department', '201', 2);
1134 -- --------------------------------------------------------
1137 -- Table structure for table `0_purch_data`
1140 DROP TABLE IF EXISTS `0_purch_data`;
1141 CREATE TABLE IF NOT EXISTS `0_purch_data` (
1142 `supplier_id` int(11) NOT NULL default '0',
1143 `stock_id` char(20) NOT NULL default '',
1144 `price` double NOT NULL default '0',
1145 `suppliers_uom` char(50) NOT NULL default '',
1146 `conversion_factor` double NOT NULL default '1',
1147 `supplier_description` char(50) NOT NULL default '',
1148 PRIMARY KEY (`supplier_id`,`stock_id`)
1152 -- Dumping data for table `0_purch_data`
1156 -- --------------------------------------------------------
1159 -- Table structure for table `0_purch_orders`
1162 DROP TABLE IF EXISTS `0_purch_orders`;
1163 CREATE TABLE IF NOT EXISTS `0_purch_orders` (
1164 `order_no` int(11) NOT NULL auto_increment,
1165 `supplier_id` int(11) NOT NULL default '0',
1166 `comments` tinytext,
1167 `ord_date` date NOT NULL default '0000-00-00',
1168 `reference` tinytext NOT NULL,
1169 `requisition_no` tinytext,
1170 `into_stock_location` varchar(5) NOT NULL default '',
1171 `delivery_address` tinytext NOT NULL,
1172 `total` double NOT NULL default '0',
1173 `prep_amount` double NOT NULL DEFAULT '0',
1174 `alloc` double NOT NULL DEFAULT '0',
1175 `tax_included` tinyint(1) NOT NULL default '0',
1176 PRIMARY KEY (`order_no`),
1177 KEY `ord_date` (`ord_date`)
1178 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1181 -- Dumping data for table `0_purch_orders`
1185 -- --------------------------------------------------------
1188 -- Table structure for table `0_purch_order_details`
1191 DROP TABLE IF EXISTS `0_purch_order_details`;
1192 CREATE TABLE IF NOT EXISTS `0_purch_order_details` (
1193 `po_detail_item` int(11) NOT NULL auto_increment,
1194 `order_no` int(11) NOT NULL default '0',
1195 `item_code` varchar(20) NOT NULL default '',
1196 `description` tinytext,
1197 `delivery_date` date NOT NULL default '0000-00-00',
1198 `qty_invoiced` double NOT NULL default '0',
1199 `unit_price` double NOT NULL default '0',
1200 `act_price` double NOT NULL default '0',
1201 `std_cost_unit` double NOT NULL default '0',
1202 `quantity_ordered` double NOT NULL default '0',
1203 `quantity_received` double NOT NULL default '0',
1204 PRIMARY KEY (`po_detail_item`),
1205 KEY `order` (`order_no`,`po_detail_item`),
1206 KEY `itemcode` (`item_code`)
1207 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1210 -- Dumping data for table `0_purch_order_details`
1214 -- --------------------------------------------------------
1217 -- Table structure for table `0_quick_entries`
1220 DROP TABLE IF EXISTS `0_quick_entries`;
1221 CREATE TABLE IF NOT EXISTS `0_quick_entries` (
1222 `id` smallint(6) unsigned NOT NULL auto_increment,
1223 `type` tinyint(1) NOT NULL default '0',
1224 `description` varchar(60) NOT NULL,
1225 `base_amount` double NOT NULL default '0',
1226 `base_desc` varchar(60) default NULL,
1227 `bal_type` tinyint(1) NOT NULL default '0',
1229 KEY `description` (`description`)
1230 ) ENGINE=MyISAM AUTO_INCREMENT=4 ;
1233 -- Dumping data for table `0_quick_entries`
1236 INSERT INTO `0_quick_entries` VALUES(1, 1, 'Maintenance', 0, 'Amount', 0);
1237 INSERT INTO `0_quick_entries` VALUES(2, 4, 'Phone', 0, 'Amount', 0);
1238 INSERT INTO `0_quick_entries` VALUES(3, 2, 'Cash Sales', 0, 'Amount', 0);
1240 -- --------------------------------------------------------
1243 -- Table structure for table `0_quick_entry_lines`
1246 DROP TABLE IF EXISTS `0_quick_entry_lines`;
1247 CREATE TABLE IF NOT EXISTS `0_quick_entry_lines` (
1248 `id` smallint(6) unsigned NOT NULL auto_increment,
1249 `qid` smallint(6) unsigned NOT NULL,
1250 `amount` double default '0',
1251 `action` varchar(2) NOT NULL,
1252 `dest_id` varchar(15) NOT NULL default '',
1253 `dimension_id` smallint(6) unsigned default NULL,
1254 `dimension2_id` smallint(6) unsigned default NULL,
1257 ) ENGINE=MyISAM AUTO_INCREMENT=7 ;
1260 -- Dumping data for table `0_quick_entry_lines`
1263 INSERT INTO `0_quick_entry_lines` VALUES(1, 1, 0, 't-', '1', 0, 0);
1264 INSERT INTO `0_quick_entry_lines` VALUES(2, 2, 0, 't-', '1', 0, 0);
1265 INSERT INTO `0_quick_entry_lines` VALUES(3, 3, 0, 't-', '1', 0, 0);
1266 INSERT INTO `0_quick_entry_lines` VALUES(4, 3, 0, '=', '4010', 0, 0);
1267 INSERT INTO `0_quick_entry_lines` VALUES(5, 1, 0, '=', '5765', 0, 0);
1268 INSERT INTO `0_quick_entry_lines` VALUES(6, 2, 0, '=', '5780', 0, 0);
1270 -- --------------------------------------------------------
1273 -- Table structure for table `0_recurrent_invoices`
1276 DROP TABLE IF EXISTS `0_recurrent_invoices`;
1277 CREATE TABLE IF NOT EXISTS `0_recurrent_invoices` (
1278 `id` smallint(6) unsigned NOT NULL auto_increment,
1279 `description` varchar(60) NOT NULL default '',
1280 `order_no` int(11) unsigned NOT NULL,
1281 `debtor_no` int(11) unsigned default NULL,
1282 `group_no` smallint(6) unsigned default NULL,
1283 `days` int(11) NOT NULL default '0',
1284 `monthly` int(11) NOT NULL default '0',
1285 `begin` date NOT NULL default '0000-00-00',
1286 `end` date NOT NULL default '0000-00-00',
1287 `last_sent` date NOT NULL default '0000-00-00',
1289 UNIQUE KEY `description` (`description`)
1290 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1293 -- Dumping data for table `0_recurrent_invoices`
1297 -- --------------------------------------------------------
1300 -- Table structure for table `0_refs`
1303 DROP TABLE IF EXISTS `0_refs`;
1304 CREATE TABLE IF NOT EXISTS `0_refs` (
1305 `id` int(11) NOT NULL default '0',
1306 `type` int(11) NOT NULL default '0',
1307 `reference` varchar(100) NOT NULL default '',
1308 PRIMARY KEY (`id`,`type`),
1309 KEY `Type_and_Reference` (`type`,`reference`)
1313 -- Dumping data for table `0_refs`
1317 -- --------------------------------------------------------
1320 -- Table structure for table `0_salesman`
1323 DROP TABLE IF EXISTS `0_salesman`;
1324 CREATE TABLE IF NOT EXISTS `0_salesman` (
1325 `salesman_code` int(11) NOT NULL auto_increment,
1326 `salesman_name` char(60) NOT NULL default '',
1327 `salesman_phone` char(30) NOT NULL default '',
1328 `salesman_fax` char(30) NOT NULL default '',
1329 `salesman_email` varchar(100) NOT NULL default '',
1330 `provision` double NOT NULL default '0',
1331 `break_pt` double NOT NULL default '0',
1332 `provision2` double NOT NULL default '0',
1333 `inactive` tinyint(1) NOT NULL default '0',
1334 PRIMARY KEY (`salesman_code`),
1335 UNIQUE KEY `salesman_name` (`salesman_name`)
1336 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
1339 -- Dumping data for table `0_salesman`
1342 INSERT INTO `0_salesman` VALUES(1, 'Sales Person', '', '', '', 5, 1000, 4, 0);
1344 -- --------------------------------------------------------
1347 -- Table structure for table `0_sales_orders`
1350 DROP TABLE IF EXISTS `0_sales_orders`;
1351 CREATE TABLE IF NOT EXISTS `0_sales_orders` (
1352 `order_no` int(11) NOT NULL,
1353 `trans_type` smallint(6) NOT NULL default '30',
1354 `version` tinyint(1) unsigned NOT NULL default '0',
1355 `type` tinyint(1) NOT NULL default '0',
1356 `debtor_no` int(11) NOT NULL default '0',
1357 `branch_code` int(11) NOT NULL default '0',
1358 `reference` varchar(100) NOT NULL default '',
1359 `customer_ref` tinytext NOT NULL,
1360 `comments` tinytext,
1361 `ord_date` date NOT NULL default '0000-00-00',
1362 `order_type` int(11) NOT NULL default '0',
1363 `ship_via` int(11) NOT NULL default '0',
1364 `delivery_address` tinytext NOT NULL,
1365 `contact_phone` varchar(30) default NULL,
1366 `contact_email` varchar(100) default NULL,
1367 `deliver_to` tinytext NOT NULL,
1368 `freight_cost` double NOT NULL default '0',
1369 `from_stk_loc` varchar(5) NOT NULL default '',
1370 `delivery_date` date NOT NULL default '0000-00-00',
1371 `payment_terms` int(11) default NULL,
1372 `total` double NOT NULL default '0',
1373 `prep_amount` double NOT NULL DEFAULT '0',
1374 `alloc` double NOT NULL DEFAULT '0',
1375 PRIMARY KEY (`trans_type`,`order_no`)
1379 -- Dumping data for table `0_sales_orders`
1383 -- --------------------------------------------------------
1386 -- Table structure for table `0_sales_order_details`
1389 DROP TABLE IF EXISTS `0_sales_order_details`;
1390 CREATE TABLE IF NOT EXISTS `0_sales_order_details` (
1391 `id` int(11) NOT NULL auto_increment,
1392 `order_no` int(11) NOT NULL default '0',
1393 `trans_type` smallint(6) NOT NULL default '30',
1394 `stk_code` varchar(20) NOT NULL default '',
1395 `description` tinytext,
1396 `qty_sent` double NOT NULL default '0',
1397 `unit_price` double NOT NULL default '0',
1398 `quantity` double NOT NULL default '0',
1399 `invoiced` double NOT NULL DEFAULT '0',
1400 `discount_percent` double NOT NULL default '0',
1402 KEY `sorder` (`trans_type`,`order_no`),
1403 KEY `stkcode` (`stk_code`)
1404 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1407 -- Dumping data for table `0_sales_order_details`
1411 -- --------------------------------------------------------
1414 -- Table structure for table `0_sales_pos`
1417 DROP TABLE IF EXISTS `0_sales_pos`;
1418 CREATE TABLE IF NOT EXISTS `0_sales_pos` (
1419 `id` smallint(6) unsigned NOT NULL auto_increment,
1420 `pos_name` varchar(30) NOT NULL,
1421 `cash_sale` tinyint(1) NOT NULL,
1422 `credit_sale` tinyint(1) NOT NULL,
1423 `pos_location` varchar(5) NOT NULL,
1424 `pos_account` smallint(6) unsigned NOT NULL,
1425 `inactive` tinyint(1) NOT NULL default '0',
1427 UNIQUE KEY `pos_name` (`pos_name`)
1428 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
1431 -- Dumping data for table `0_sales_pos`
1434 INSERT INTO `0_sales_pos` VALUES(1, 'Default', 1, 1, 'DEF', 2, 0);
1436 -- --------------------------------------------------------
1439 -- Table structure for table `0_sales_types`
1442 DROP TABLE IF EXISTS `0_sales_types`;
1443 CREATE TABLE IF NOT EXISTS `0_sales_types` (
1444 `id` int(11) NOT NULL auto_increment,
1445 `sales_type` char(50) NOT NULL default '',
1446 `tax_included` int(1) NOT NULL default '0',
1447 `factor` double NOT NULL default '1',
1448 `inactive` tinyint(1) NOT NULL default '0',
1450 UNIQUE KEY `sales_type` (`sales_type`)
1451 ) ENGINE=MyISAM AUTO_INCREMENT=3 ;
1454 -- Dumping data for table `0_sales_types`
1457 INSERT INTO `0_sales_types` VALUES(1, 'Retail', 1, 1, 0);
1458 INSERT INTO `0_sales_types` VALUES(2, 'Wholesale', 0, 0.7, 0);
1460 -- --------------------------------------------------------
1463 -- Table structure for table `0_security_roles`
1466 DROP TABLE IF EXISTS `0_security_roles`;
1467 CREATE TABLE IF NOT EXISTS `0_security_roles` (
1468 `id` int(11) NOT NULL auto_increment,
1469 `role` varchar(30) NOT NULL,
1470 `description` varchar(50) default NULL,
1473 `inactive` tinyint(1) NOT NULL default '0',
1475 UNIQUE KEY `role` (`role`)
1476 ) ENGINE=MyISAM AUTO_INCREMENT=11 ;
1479 -- Dumping data for table `0_security_roles`
1482 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);
1483 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);
1484 INSERT INTO `0_security_roles` VALUES(3, 'Salesman', 'Salesman', '768;3072;5632;8192;15872', '773;774;3073;3075;3081;5633;8194;15873;775', 0);
1485 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);
1486 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);
1487 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);
1488 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);
1489 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);
1490 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);
1491 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);
1493 -- --------------------------------------------------------
1496 -- Table structure for table `0_shippers`
1499 DROP TABLE IF EXISTS `0_shippers`;
1500 CREATE TABLE IF NOT EXISTS `0_shippers` (
1501 `shipper_id` int(11) NOT NULL auto_increment,
1502 `shipper_name` varchar(60) NOT NULL default '',
1503 `phone` varchar(30) NOT NULL default '',
1504 `phone2` varchar(30) NOT NULL default '',
1505 `contact` tinytext NOT NULL,
1506 `address` tinytext NOT NULL,
1507 `inactive` tinyint(1) NOT NULL default '0',
1508 PRIMARY KEY (`shipper_id`),
1509 UNIQUE KEY `name` (`shipper_name`)
1510 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
1513 -- Dumping data for table `0_shippers`
1516 INSERT INTO `0_shippers` VALUES(1, 'Default', '', '', '', '', 0);
1518 -- --------------------------------------------------------
1521 -- Table structure for table `0_sql_trail`
1524 DROP TABLE IF EXISTS `0_sql_trail`;
1525 CREATE TABLE IF NOT EXISTS `0_sql_trail` (
1526 `id` int(11) unsigned NOT NULL auto_increment,
1527 `sql` text NOT NULL,
1528 `result` tinyint(1) NOT NULL,
1529 `msg` varchar(255) NOT NULL,
1531 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1534 -- Dumping data for table `0_sql_trail`
1538 -- --------------------------------------------------------
1541 -- Table structure for table `0_stock_category`
1544 DROP TABLE IF EXISTS `0_stock_category`;
1545 CREATE TABLE IF NOT EXISTS `0_stock_category` (
1546 `category_id` int(11) NOT NULL auto_increment,
1547 `description` varchar(60) NOT NULL default '',
1548 `dflt_tax_type` int(11) NOT NULL default '1',
1549 `dflt_units` varchar(20) NOT NULL default 'each',
1550 `dflt_mb_flag` char(1) NOT NULL default 'B',
1551 `dflt_sales_act` varchar(15) NOT NULL default '',
1552 `dflt_cogs_act` varchar(15) NOT NULL default '',
1553 `dflt_inventory_act` varchar(15) NOT NULL default '',
1554 `dflt_adjustment_act` varchar(15) NOT NULL default '',
1555 `dflt_assembly_act` varchar(15) NOT NULL default '',
1556 `dflt_dim1` int(11) default NULL,
1557 `dflt_dim2` int(11) default NULL,
1558 `inactive` tinyint(1) NOT NULL default '0',
1559 `dflt_no_sale` tinyint(1) NOT NULL default '0',
1560 `dflt_no_sale` tinyint(1) NOT NULL default '0',
1561 PRIMARY KEY (`category_id`),
1562 UNIQUE KEY `description` (`description`)
1563 ) ENGINE=MyISAM AUTO_INCREMENT=5 ;
1566 -- Dumping data for table `0_stock_category`
1569 INSERT INTO `0_stock_category` VALUES(1, 'Components', 1, 'each', 'B', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1570 INSERT INTO `0_stock_category` VALUES(2, 'Charges', 1, 'each', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1571 INSERT INTO `0_stock_category` VALUES(3, 'Systems', 1, 'each', 'M', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1572 INSERT INTO `0_stock_category` VALUES(4, 'Services', 1, 'hrs', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1574 -- --------------------------------------------------------
1577 -- Table structure for table `0_stock_master`
1580 DROP TABLE IF EXISTS `0_stock_master`;
1581 CREATE TABLE IF NOT EXISTS `0_stock_master` (
1582 `stock_id` varchar(20) NOT NULL default '',
1583 `category_id` int(11) NOT NULL default '0',
1584 `tax_type_id` int(11) NOT NULL default '0',
1585 `description` varchar(200) NOT NULL default '',
1586 `long_description` tinytext NOT NULL,
1587 `units` varchar(20) NOT NULL default 'each',
1588 `mb_flag` char(1) NOT NULL default 'B',
1589 `sales_account` varchar(15) NOT NULL default '',
1590 `cogs_account` varchar(15) NOT NULL default '',
1591 `inventory_account` varchar(15) NOT NULL default '',
1592 `adjustment_account` varchar(15) NOT NULL default '',
1593 `assembly_account` varchar(15) NOT NULL default '',
1594 `dimension_id` int(11) default NULL,
1595 `dimension2_id` int(11) default NULL,
1596 `actual_cost` double NOT NULL default '0',
1597 `last_cost` double NOT NULL default '0',
1598 `material_cost` double NOT NULL default '0',
1599 `labour_cost` double NOT NULL default '0',
1600 `overhead_cost` double NOT NULL default '0',
1601 `inactive` tinyint(1) NOT NULL default '0',
1602 `no_sale` tinyint(1) NOT NULL default '0',
1603 `no_purchase` tinyint(1) NOT NULL default '0',
1604 `editable` tinyint(1) NOT NULL default '0',
1605 PRIMARY KEY (`stock_id`)
1609 -- Dumping data for table `0_stock_master`
1613 -- --------------------------------------------------------
1616 -- Table structure for table `0_stock_moves`
1619 DROP TABLE IF EXISTS `0_stock_moves`;
1620 CREATE TABLE IF NOT EXISTS `0_stock_moves` (
1621 `trans_id` int(11) NOT NULL auto_increment,
1622 `trans_no` int(11) NOT NULL default '0',
1623 `stock_id` char(20) NOT NULL default '',
1624 `type` smallint(6) NOT NULL default '0',
1625 `loc_code` char(5) NOT NULL default '',
1626 `tran_date` date NOT NULL default '0000-00-00',
1627 `person_id` int(11) default NULL,
1628 `price` double NOT NULL default '0',
1629 `reference` char(40) NOT NULL default '',
1630 `qty` double NOT NULL default '1',
1631 `discount_percent` double NOT NULL default '0',
1632 `standard_cost` double NOT NULL default '0',
1633 `visible` tinyint(1) NOT NULL default '1',
1634 PRIMARY KEY (`trans_id`),
1635 KEY `type` (`type`,`trans_no`),
1636 KEY `Move` (`stock_id`,`loc_code`,`tran_date`)
1637 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1640 -- Dumping data for table `0_stock_moves`
1644 -- --------------------------------------------------------
1647 -- Table structure for table `0_suppliers`
1650 DROP TABLE IF EXISTS `0_suppliers`;
1651 CREATE TABLE IF NOT EXISTS `0_suppliers` (
1652 `supplier_id` int(11) NOT NULL auto_increment,
1653 `supp_name` varchar(60) NOT NULL default '',
1654 `supp_ref` varchar(30) NOT NULL default '',
1655 `address` tinytext NOT NULL,
1656 `supp_address` tinytext NOT NULL,
1657 `gst_no` varchar(25) NOT NULL default '',
1658 `contact` varchar(60) NOT NULL default '',
1659 `supp_account_no` varchar(40) NOT NULL default '',
1660 `website` varchar(100) NOT NULL default '',
1661 `bank_account` varchar(60) NOT NULL default '',
1662 `curr_code` char(3) default NULL,
1663 `payment_terms` int(11) default NULL,
1664 `tax_included` tinyint(1) NOT NULL default '0',
1665 `tax_algorithm` tinyint(1) NOT NULL default '1',
1666 `dimension_id` int(11) default '0',
1667 `dimension2_id` int(11) default '0',
1668 `tax_group_id` int(11) default NULL,
1669 `credit_limit` double NOT NULL default '0',
1670 `purchase_account` varchar(15) NOT NULL default '',
1671 `payable_account` varchar(15) NOT NULL default '',
1672 `payment_discount_account` varchar(15) NOT NULL default '',
1673 `notes` tinytext NOT NULL,
1674 `inactive` tinyint(1) NOT NULL default '0',
1675 PRIMARY KEY (`supplier_id`),
1676 KEY `supp_ref` (`supp_ref`)
1677 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1680 -- Dumping data for table `0_suppliers`
1684 -- --------------------------------------------------------
1687 -- Table structure for table `0_supp_allocations`
1690 DROP TABLE IF EXISTS `0_supp_allocations`;
1691 CREATE TABLE IF NOT EXISTS `0_supp_allocations` (
1692 `id` int(11) NOT NULL auto_increment,
1693 `amt` double unsigned default NULL,
1694 `date_alloc` date NOT NULL default '0000-00-00',
1695 `trans_no_from` int(11) default NULL,
1696 `trans_type_from` int(11) default NULL,
1697 `trans_no_to` int(11) default NULL,
1698 `trans_type_to` int(11) default NULL,
1700 UNIQUE KEY (`trans_type_from`,`trans_no_from`,`trans_type_to`,`trans_no_to`),
1701 KEY `From` (`trans_type_from`,`trans_no_from`),
1702 KEY `To` (`trans_type_to`,`trans_no_to`)
1703 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1706 -- Dumping data for table `0_supp_allocations`
1710 -- --------------------------------------------------------
1713 -- Table structure for table `0_supp_invoice_items`
1716 DROP TABLE IF EXISTS `0_supp_invoice_items`;
1717 CREATE TABLE IF NOT EXISTS `0_supp_invoice_items` (
1718 `id` int(11) NOT NULL auto_increment,
1719 `supp_trans_no` int(11) default NULL,
1720 `supp_trans_type` int(11) default NULL,
1721 `gl_code` varchar(15) NOT NULL default '',
1722 `grn_item_id` int(11) default NULL,
1723 `po_detail_item_id` int(11) default NULL,
1724 `stock_id` varchar(20) NOT NULL default '',
1725 `description` tinytext,
1726 `quantity` double NOT NULL default '0',
1727 `unit_price` double NOT NULL default '0',
1728 `unit_tax` double NOT NULL default '0',
1731 KEY `Transaction` (`supp_trans_type`,`supp_trans_no`,`stock_id`)
1732 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1735 -- Dumping data for table `0_supp_invoice_items`
1739 -- --------------------------------------------------------
1742 -- Table structure for table `0_supp_trans`
1745 DROP TABLE IF EXISTS `0_supp_trans`;
1746 CREATE TABLE IF NOT EXISTS `0_supp_trans` (
1747 `trans_no` int(11) unsigned NOT NULL default '0',
1748 `type` smallint(6) unsigned NOT NULL default '0',
1749 `supplier_id` int(11) unsigned default NULL,
1750 `reference` tinytext NOT NULL,
1751 `supp_reference` varchar(60) NOT NULL default '',
1752 `tran_date` date NOT NULL default '0000-00-00',
1753 `due_date` date NOT NULL default '0000-00-00',
1754 `ov_amount` double NOT NULL default '0',
1755 `ov_discount` double NOT NULL default '0',
1756 `ov_gst` double NOT NULL default '0',
1757 `rate` double NOT NULL default '1',
1758 `alloc` double NOT NULL default '0',
1759 `tax_included` tinyint(1) NOT NULL default '0',
1760 `tax_algorithm` tinyint(1) NOT NULL default '1',
1761 PRIMARY KEY (`type`,`trans_no`),
1762 KEY `supplier_id` (`supplier_id`),
1763 KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
1764 KEY `type` (`type`),
1765 KEY `tran_date` (`tran_date`)
1769 -- Dumping data for table `0_supp_trans`
1773 -- --------------------------------------------------------
1776 -- Table structure for table `0_sys_prefs`
1779 DROP TABLE IF EXISTS `0_sys_prefs`;
1780 CREATE TABLE IF NOT EXISTS `0_sys_prefs` (
1781 `name` varchar(35) NOT NULL default '',
1782 `category` varchar(30) default NULL,
1783 `type` varchar(20) NOT NULL default '',
1784 `length` smallint(6) default NULL,
1785 `value` text NOT NULL,
1786 PRIMARY KEY (`name`),
1787 KEY `category` (`category`)
1791 -- Dumping data for table `0_sys_prefs`
1794 INSERT INTO `0_sys_prefs` VALUES('coy_name', 'setup.company', 'varchar', 60, 'Company name');
1795 INSERT INTO `0_sys_prefs` VALUES('gst_no', 'setup.company', 'varchar', 25, '');
1796 INSERT INTO `0_sys_prefs` VALUES('coy_no', 'setup.company', 'varchar', 25, '');
1797 INSERT INTO `0_sys_prefs` VALUES('tax_prd', 'setup.company', 'int', 11, '1');
1798 INSERT INTO `0_sys_prefs` VALUES('tax_last', 'setup.company', 'int', 11, '1');
1799 INSERT INTO `0_sys_prefs` VALUES('postal_address', 'setup.company', 'tinytext', 0, 'N/A');
1800 INSERT INTO `0_sys_prefs` VALUES('phone', 'setup.company', 'varchar', 30, '');
1801 INSERT INTO `0_sys_prefs` VALUES('fax', 'setup.company', 'varchar', 30, '');
1802 INSERT INTO `0_sys_prefs` VALUES('email', 'setup.company', 'varchar', 100, '');
1803 INSERT INTO `0_sys_prefs` VALUES('coy_logo', 'setup.company', 'varchar', 100, '');
1804 INSERT INTO `0_sys_prefs` VALUES('domicile', 'setup.company', 'varchar', 55, '');
1805 INSERT INTO `0_sys_prefs` VALUES('curr_default', 'setup.company', 'char', 3, 'USD');
1806 INSERT INTO `0_sys_prefs` VALUES('use_dimension', 'setup.company', 'tinyint', 1, '1');
1807 INSERT INTO `0_sys_prefs` VALUES('f_year', 'setup.company', 'int', 11, '6');
1808 INSERT INTO `0_sys_prefs` VALUES('no_item_list', 'setup.company', 'tinyint', 1, '0');
1809 INSERT INTO `0_sys_prefs` VALUES('no_customer_list', 'setup.company', 'tinyint', 1, '0');
1810 INSERT INTO `0_sys_prefs` VALUES('no_supplier_list', 'setup.company', 'tinyint', 1, '0');
1811 INSERT INTO `0_sys_prefs` VALUES('base_sales', 'setup.company', 'int', 11, '1');
1812 INSERT INTO `0_sys_prefs` VALUES('time_zone', 'setup.company', 'tinyint', 1, '0');
1813 INSERT INTO `0_sys_prefs` VALUES('add_pct', 'setup.company', 'int', 5, '-1');
1814 INSERT INTO `0_sys_prefs` VALUES('round_to', 'setup.company', 'int', 5, '1');
1815 INSERT INTO `0_sys_prefs` VALUES('login_tout', 'setup.company', 'smallint', 6, '600');
1816 INSERT INTO `0_sys_prefs` VALUES('past_due_days', 'glsetup.general', 'int', 11, '30');
1817 INSERT INTO `0_sys_prefs` VALUES('profit_loss_year_act', 'glsetup.general', 'varchar', 15, '9990');
1818 INSERT INTO `0_sys_prefs` VALUES('retained_earnings_act', 'glsetup.general', 'varchar', 15, '3590');
1819 INSERT INTO `0_sys_prefs` VALUES('bank_charge_act', 'glsetup.general', 'varchar', 15, '5690');
1820 INSERT INTO `0_sys_prefs` VALUES('exchange_diff_act', 'glsetup.general', 'varchar', 15, '4450');
1821 INSERT INTO `0_sys_prefs` VALUES('tax_algorithm', 'glsetup.customer', 'tinyint', 1, '1');
1822 INSERT INTO `0_sys_prefs` VALUES('default_credit_limit', 'glsetup.customer', 'int', 11, '1000');
1823 INSERT INTO `0_sys_prefs` VALUES('accumulate_shipping', 'glsetup.customer', 'tinyint', 1, '0');
1824 INSERT INTO `0_sys_prefs` VALUES('legal_text', 'glsetup.customer', 'tinytext', 0, '');
1825 INSERT INTO `0_sys_prefs` VALUES('freight_act', 'glsetup.customer', 'varchar', 15, '4430');
1826 INSERT INTO `0_sys_prefs` VALUES('debtors_act', 'glsetup.sales', 'varchar', 15, '1200');
1827 INSERT INTO `0_sys_prefs` VALUES('default_sales_act', 'glsetup.sales', 'varchar', 15, '4010');
1828 INSERT INTO `0_sys_prefs` VALUES('default_sales_discount_act', 'glsetup.sales', 'varchar', 15, '4510');
1829 INSERT INTO `0_sys_prefs` VALUES('default_prompt_payment_act', 'glsetup.sales', 'varchar', 15, '4500');
1830 INSERT INTO `0_sys_prefs` VALUES('default_delivery_required', 'glsetup.sales', 'smallint', 6, '1');
1831 INSERT INTO `0_sys_prefs` VALUES('default_receival_required', 'glsetup.purchase', 'smallint', 6, '10');
1832 INSERT INTO `0_sys_prefs` VALUES('default_dim_required', 'glsetup.dims', 'int', 11, '20');
1833 INSERT INTO `0_sys_prefs` VALUES('pyt_discount_act', 'glsetup.purchase', 'varchar', 15, '5060');
1834 INSERT INTO `0_sys_prefs` VALUES('creditors_act', 'glsetup.purchase', 'varchar', 15, '2100');
1835 INSERT INTO `0_sys_prefs` VALUES('po_over_receive', 'glsetup.purchase', 'int', 11, '10');
1836 INSERT INTO `0_sys_prefs` VALUES('po_over_charge', 'glsetup.purchase', 'int', 11, '10');
1837 INSERT INTO `0_sys_prefs` VALUES('allow_negative_stock', 'glsetup.inventory', 'tinyint', 1, '0');
1838 INSERT INTO `0_sys_prefs` VALUES('default_inventory_act', 'glsetup.items', 'varchar', 15, '1510');
1839 INSERT INTO `0_sys_prefs` VALUES('default_cogs_act', 'glsetup.items', 'varchar', 15, '5010');
1840 INSERT INTO `0_sys_prefs` VALUES('default_adj_act', 'glsetup.items', 'varchar', 15, '5040');
1841 INSERT INTO `0_sys_prefs` VALUES('default_inv_sales_act', 'glsetup.items', 'varchar', 15, '4010');
1842 INSERT INTO `0_sys_prefs` VALUES('default_assembly_act', 'glsetup.items', 'varchar', 15, '1530');
1843 INSERT INTO `0_sys_prefs` VALUES('default_workorder_required', 'glsetup.manuf', 'int', 11, '20');
1844 INSERT INTO `0_sys_prefs` VALUES('version_id', 'system', 'varchar', 11, '2.3rc');
1845 INSERT INTO `0_sys_prefs` VALUES('auto_curr_reval', 'setup.company', 'smallint', 6, '1');
1846 INSERT INTO `0_sys_prefs` VALUES('grn_clearing_act', 'glsetup.purchase', 'varchar', 15, '1550');
1847 INSERT INTO `0_sys_prefs` VALUES('bcc_email', 'setup.company', 'varchar', 100, '');
1848 INSERT INTO `0_sys_prefs` VALUES('deferred_income_act', 'glsetup.sales', 'varchar', '15', '');
1849 INSERT INTO `0_sys_prefs` VALUES('gl_closing_date','setup.closing_date', 'date', 8, '');
1851 -- --------------------------------------------------------
1854 -- Table structure for table `0_sys_types`
1857 DROP TABLE IF EXISTS `0_sys_types`;
1858 CREATE TABLE IF NOT EXISTS `0_sys_types` (
1859 `type_id` smallint(6) NOT NULL default '0',
1860 `type_no` int(11) NOT NULL default '1',
1861 `next_reference` varchar(100) NOT NULL default '',
1862 PRIMARY KEY (`type_id`)
1866 -- Dumping data for table `0_sys_types`
1869 INSERT INTO `0_sys_types` VALUES(0, 17, '1');
1870 INSERT INTO `0_sys_types` VALUES(1, 7, '1');
1871 INSERT INTO `0_sys_types` VALUES(2, 4, '1');
1872 INSERT INTO `0_sys_types` VALUES(4, 3, '1');
1873 INSERT INTO `0_sys_types` VALUES(10, 16, '1');
1874 INSERT INTO `0_sys_types` VALUES(11, 2, '1');
1875 INSERT INTO `0_sys_types` VALUES(12, 6, '1');
1876 INSERT INTO `0_sys_types` VALUES(13, 1, '1');
1877 INSERT INTO `0_sys_types` VALUES(16, 2, '1');
1878 INSERT INTO `0_sys_types` VALUES(17, 2, '1');
1879 INSERT INTO `0_sys_types` VALUES(18, 1, '1');
1880 INSERT INTO `0_sys_types` VALUES(20, 6, '1');
1881 INSERT INTO `0_sys_types` VALUES(21, 1, '1');
1882 INSERT INTO `0_sys_types` VALUES(22, 3, '1');
1883 INSERT INTO `0_sys_types` VALUES(25, 1, '1');
1884 INSERT INTO `0_sys_types` VALUES(26, 1, '1');
1885 INSERT INTO `0_sys_types` VALUES(28, 1, '1');
1886 INSERT INTO `0_sys_types` VALUES(29, 1, '1');
1887 INSERT INTO `0_sys_types` VALUES(30, 0, '1');
1888 INSERT INTO `0_sys_types` VALUES(32, 0, '1');
1889 INSERT INTO `0_sys_types` VALUES(35, 1, '1');
1890 INSERT INTO `0_sys_types` VALUES(40, 1, '1');
1892 -- --------------------------------------------------------
1895 -- Table structure for table `0_tags`
1898 DROP TABLE IF EXISTS `0_tags`;
1899 CREATE TABLE IF NOT EXISTS `0_tags` (
1900 `id` int(11) NOT NULL auto_increment,
1901 `type` smallint(6) NOT NULL,
1902 `name` varchar(30) NOT NULL,
1903 `description` varchar(60) default NULL,
1904 `inactive` tinyint(1) NOT NULL default '0',
1906 UNIQUE KEY `type` (`type`,`name`)
1907 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1910 -- Dumping data for table `0_tags`
1914 -- --------------------------------------------------------
1917 -- Table structure for table `0_tag_associations`
1920 DROP TABLE IF EXISTS `0_tag_associations`;
1921 CREATE TABLE IF NOT EXISTS `0_tag_associations` (
1922 `record_id` varchar(15) NOT NULL,
1923 `tag_id` int(11) NOT NULL,
1924 UNIQUE KEY `record_id` (`record_id`,`tag_id`)
1928 -- Dumping data for table `0_tag_associations`
1932 -- --------------------------------------------------------
1935 -- Table structure for table `0_tax_groups`
1938 DROP TABLE IF EXISTS `0_tax_groups`;
1939 CREATE TABLE IF NOT EXISTS `0_tax_groups` (
1940 `id` int(11) NOT NULL auto_increment,
1941 `name` varchar(60) NOT NULL default '',
1942 `inactive` tinyint(1) NOT NULL default '0',
1944 UNIQUE KEY `name` (`name`)
1945 ) ENGINE=InnoDB AUTO_INCREMENT=3 ;
1948 -- Dumping data for table `0_tax_groups`
1951 INSERT INTO `0_tax_groups` VALUES(1, 'Tax', 0);
1952 INSERT INTO `0_tax_groups` VALUES(2, 'Tax Exempt', 0);
1954 -- --------------------------------------------------------
1957 -- Table structure for table `0_tax_group_items`
1960 DROP TABLE IF EXISTS `0_tax_group_items`;
1961 CREATE TABLE IF NOT EXISTS `0_tax_group_items` (
1962 `tax_group_id` int(11) NOT NULL default '0',
1963 `tax_type_id` int(11) NOT NULL default '0',
1964 `tax_shipping` tinyint(1) NOT NULL default '0',
1965 PRIMARY KEY (`tax_group_id`,`tax_type_id`)
1969 -- Dumping data for table `0_tax_group_items`
1972 INSERT INTO `0_tax_group_items` VALUES(1, 1, 1);
1974 -- --------------------------------------------------------
1977 -- Table structure for table `0_tax_types`
1980 DROP TABLE IF EXISTS `0_tax_types`;
1981 CREATE TABLE IF NOT EXISTS `0_tax_types` (
1982 `id` int(11) NOT NULL auto_increment,
1983 `rate` double NOT NULL default '0',
1984 `sales_gl_code` varchar(15) NOT NULL default '',
1985 `purchasing_gl_code` varchar(15) NOT NULL default '',
1986 `name` varchar(60) NOT NULL default '',
1987 `inactive` tinyint(1) NOT NULL default '0',
1989 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
1992 -- Dumping data for table `0_tax_types`
1995 INSERT INTO `0_tax_types` VALUES(1, 5, '2150', '2150', 'Tax', 0);
1997 -- --------------------------------------------------------
2000 -- Table structure for table `0_trans_tax_details`
2003 DROP TABLE IF EXISTS `0_trans_tax_details`;
2004 CREATE TABLE IF NOT EXISTS `0_trans_tax_details` (
2005 `id` int(11) NOT NULL auto_increment,
2006 `trans_type` smallint(6) default NULL,
2007 `trans_no` int(11) default NULL,
2008 `tran_date` date NOT NULL,
2009 `tax_type_id` int(11) NOT NULL default '0',
2010 `rate` double NOT NULL default '0',
2011 `ex_rate` double NOT NULL default '1',
2012 `included_in_price` tinyint(1) NOT NULL default '0',
2013 `net_amount` double NOT NULL default '0',
2014 `amount` double NOT NULL default '0',
2017 KEY `Type_and_Number` (`trans_type`,`trans_no`),
2018 KEY `tran_date` (`tran_date`)
2019 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2022 -- Dumping data for table `0_trans_tax_details`
2026 -- --------------------------------------------------------
2029 -- Table structure for table `0_useronline`
2032 DROP TABLE IF EXISTS `0_useronline`;
2033 CREATE TABLE IF NOT EXISTS `0_useronline` (
2034 `id` int(11) NOT NULL auto_increment,
2035 `timestamp` int(15) NOT NULL default '0',
2036 `ip` varchar(40) NOT NULL default '',
2037 `file` varchar(100) NOT NULL default '',
2039 KEY `timestamp` (`timestamp`),
2041 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2044 -- Dumping data for table `0_useronline`
2048 -- --------------------------------------------------------
2051 -- Table structure for table `0_users`
2054 DROP TABLE IF EXISTS `0_users`;
2055 CREATE TABLE IF NOT EXISTS `0_users` (
2056 `id` smallint(6) NOT NULL auto_increment,
2057 `user_id` varchar(60) NOT NULL default '',
2058 `password` varchar(100) NOT NULL default '',
2059 `real_name` varchar(100) NOT NULL default '',
2060 `role_id` int(11) NOT NULL default '1',
2061 `phone` varchar(30) NOT NULL default '',
2062 `email` varchar(100) default NULL,
2063 `language` varchar(20) default NULL,
2064 `date_format` tinyint(1) NOT NULL default '0',
2065 `date_sep` tinyint(1) NOT NULL default '0',
2066 `tho_sep` tinyint(1) NOT NULL default '0',
2067 `dec_sep` tinyint(1) NOT NULL default '0',
2068 `theme` varchar(20) NOT NULL default 'default',
2069 `page_size` varchar(20) NOT NULL default 'A4',
2070 `prices_dec` smallint(6) NOT NULL default '2',
2071 `qty_dec` smallint(6) NOT NULL default '2',
2072 `rates_dec` smallint(6) NOT NULL default '4',
2073 `percent_dec` smallint(6) NOT NULL default '1',
2074 `show_gl` tinyint(1) NOT NULL default '1',
2075 `show_codes` tinyint(1) NOT NULL default '0',
2076 `show_hints` tinyint(1) NOT NULL default '0',
2077 `last_visit_date` datetime default NULL,
2078 `query_size` tinyint(1) unsigned default '10',
2079 `graphic_links` tinyint(1) default '1',
2080 `pos` smallint(6) default '1',
2081 `print_profile` varchar(30) NOT NULL default '1',
2082 `rep_popup` tinyint(1) default '1',
2083 `sticky_doc_date` tinyint(1) default '0',
2084 `startup_tab` varchar(20) NOT NULL default '',
2085 `transaction_days` smallint(6) NOT NULL default '30',
2086 `inactive` tinyint(1) NOT NULL default '0',
2088 UNIQUE KEY `user_id` (`user_id`)
2089 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
2092 -- Dumping data for table `0_users`
2095 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);
2097 -- --------------------------------------------------------
2100 -- Table structure for table `0_voided`
2103 DROP TABLE IF EXISTS `0_voided`;
2104 CREATE TABLE IF NOT EXISTS `0_voided` (
2105 `type` int(11) NOT NULL default '0',
2106 `id` int(11) NOT NULL default '0',
2107 `date_` date NOT NULL default '0000-00-00',
2108 `memo_` tinytext NOT NULL,
2109 UNIQUE KEY `id` (`type`,`id`)
2113 -- Dumping data for table `0_voided`
2117 -- --------------------------------------------------------
2120 -- Table structure for table `0_workcentres`
2123 DROP TABLE IF EXISTS `0_workcentres`;
2124 CREATE TABLE IF NOT EXISTS `0_workcentres` (
2125 `id` int(11) NOT NULL auto_increment,
2126 `name` char(40) NOT NULL default '',
2127 `description` char(50) NOT NULL default '',
2128 `inactive` tinyint(1) NOT NULL default '0',
2130 UNIQUE KEY `name` (`name`)
2131 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2134 -- Dumping data for table `0_workcentres`
2138 -- --------------------------------------------------------
2141 -- Table structure for table `0_workorders`
2144 DROP TABLE IF EXISTS `0_workorders`;
2145 CREATE TABLE IF NOT EXISTS `0_workorders` (
2146 `id` int(11) NOT NULL auto_increment,
2147 `wo_ref` varchar(60) NOT NULL default '',
2148 `loc_code` varchar(5) NOT NULL default '',
2149 `units_reqd` double NOT NULL default '1',
2150 `stock_id` varchar(20) NOT NULL default '',
2151 `date_` date NOT NULL default '0000-00-00',
2152 `type` tinyint(4) NOT NULL default '0',
2153 `required_by` date NOT NULL default '0000-00-00',
2154 `released_date` date NOT NULL default '0000-00-00',
2155 `units_issued` double NOT NULL default '0',
2156 `closed` tinyint(1) NOT NULL default '0',
2157 `released` tinyint(1) NOT NULL default '0',
2158 `additional_costs` double NOT NULL default '0',
2160 UNIQUE KEY `wo_ref` (`wo_ref`)
2161 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2164 -- Dumping data for table `0_workorders`
2168 -- --------------------------------------------------------
2171 -- Table structure for table `0_wo_costing`
2174 DROP TABLE IF EXISTS `0_wo_costing`;
2175 CREATE TABLE `0_wo_costing` (
2176 `id` int(11) NOT NULL auto_increment,
2177 `workorder_id` int(11) NOT NULL default '0',
2178 `cost_type` tinyint(1) NOT NULL default '0',
2179 `trans_type` int(11) NOT NULL default '0',
2180 `trans_no` int(11) NOT NULL default '0',
2181 `factor` double NOT NULL default '1',
2186 -- Dumping data for table `0_wo_costing`
2190 -- --------------------------------------------------------
2193 -- Table structure for table `0_wo_issues`
2196 DROP TABLE IF EXISTS `0_wo_issues`;
2197 CREATE TABLE IF NOT EXISTS `0_wo_issues` (
2198 `issue_no` int(11) NOT NULL auto_increment,
2199 `workorder_id` int(11) NOT NULL default '0',
2200 `reference` varchar(100) default NULL,
2201 `issue_date` date default NULL,
2202 `loc_code` varchar(5) default NULL,
2203 `workcentre_id` int(11) default NULL,
2204 PRIMARY KEY (`issue_no`),
2205 KEY `workorder_id` (`workorder_id`)
2206 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2209 -- Dumping data for table `0_wo_issues`
2213 -- --------------------------------------------------------
2216 -- Table structure for table `0_wo_issue_items`
2219 DROP TABLE IF EXISTS `0_wo_issue_items`;
2220 CREATE TABLE IF NOT EXISTS `0_wo_issue_items` (
2221 `id` int(11) NOT NULL auto_increment,
2222 `stock_id` varchar(40) default NULL,
2223 `issue_id` int(11) default NULL,
2224 `qty_issued` double default NULL,
2226 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2229 -- Dumping data for table `0_wo_issue_items`
2233 -- --------------------------------------------------------
2236 -- Table structure for table `0_wo_manufacture`
2239 DROP TABLE IF EXISTS `0_wo_manufacture`;
2240 CREATE TABLE IF NOT EXISTS `0_wo_manufacture` (
2241 `id` int(11) NOT NULL auto_increment,
2242 `reference` varchar(100) default NULL,
2243 `workorder_id` int(11) NOT NULL default '0',
2244 `quantity` double NOT NULL default '0',
2245 `date_` date NOT NULL default '0000-00-00',
2247 KEY `workorder_id` (`workorder_id`)
2248 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2251 -- Dumping data for table `0_wo_manufacture`
2255 -- --------------------------------------------------------
2258 -- Table structure for table `0_wo_requirements`
2261 DROP TABLE IF EXISTS `0_wo_requirements`;
2262 CREATE TABLE IF NOT EXISTS `0_wo_requirements` (
2263 `id` int(11) NOT NULL auto_increment,
2264 `workorder_id` int(11) NOT NULL default '0',
2265 `stock_id` char(20) NOT NULL default '',
2266 `workcentre` int(11) NOT NULL default '0',
2267 `units_req` double NOT NULL default '1',
2268 `std_cost` double NOT NULL default '0',
2269 `loc_code` char(5) NOT NULL default '',
2270 `units_issued` double NOT NULL default '0',
2272 KEY `workorder_id` (`workorder_id`)
2273 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2276 -- Dumping data for table `0_wo_requirements`