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 `counter` int(11) NOT NULL auto_increment,
190 `type` smallint(6) NOT NULL default '0',
191 `type_no` bigint(16) NOT NULL default '1',
192 `tran_date` date NOT NULL default '0000-00-00',
193 `account` varchar(15) NOT NULL default '',
194 `memo_` tinytext NOT NULL,
195 `amount` double NOT NULL default '0',
196 `dimension_id` int(11) default '0',
197 `dimension2_id` int(11) default '0',
198 `person_type_id` int(11) default NULL,
199 `person_id` tinyblob,
200 PRIMARY KEY (`counter`),
201 KEY `Type_and_Number` (`type`,`type_no`),
202 KEY `Account` (`account`,`tran_date`,`dimension_id`,`dimension2_id`)
203 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
206 -- Dumping data for table `0_budget_trans`
210 -- --------------------------------------------------------
213 -- Table structure for table `0_chart_class`
216 DROP TABLE IF EXISTS `0_chart_class`;
217 CREATE TABLE IF NOT EXISTS `0_chart_class` (
218 `cid` varchar(3) NOT NULL,
219 `class_name` varchar(60) NOT NULL default '',
220 `ctype` tinyint(1) NOT NULL default '0',
221 `inactive` tinyint(1) NOT NULL default '0',
226 -- Dumping data for table `0_chart_class`
229 INSERT INTO `0_chart_class` VALUES('1', 'Assets', 1, 0);
230 INSERT INTO `0_chart_class` VALUES('2', 'Liabilities', 2, 0);
231 INSERT INTO `0_chart_class` VALUES('3', 'Income', 4, 0);
232 INSERT INTO `0_chart_class` VALUES('4', 'Costs', 6, 0);
234 -- --------------------------------------------------------
237 -- Table structure for table `0_chart_master`
240 DROP TABLE IF EXISTS `0_chart_master`;
241 CREATE TABLE IF NOT EXISTS `0_chart_master` (
242 `account_code` varchar(15) NOT NULL default '',
243 `account_code2` varchar(15) NOT NULL default '',
244 `account_name` varchar(60) NOT NULL default '',
245 `account_type` varchar(10) NOT NULL default '0',
246 `inactive` tinyint(1) NOT NULL default '0',
247 PRIMARY KEY (`account_code`),
248 KEY `account_name` (`account_name`),
249 KEY `accounts_by_type` (`account_type`,`account_code`)
253 -- Dumping data for table `0_chart_master`
256 INSERT INTO `0_chart_master` VALUES('1060', '', 'Checking Account', '1', 0);
257 INSERT INTO `0_chart_master` VALUES('1065', '', 'Petty Cash', '1', 0);
258 INSERT INTO `0_chart_master` VALUES('1200', '', 'Accounts Receivables', '1', 0);
259 INSERT INTO `0_chart_master` VALUES('1205', '', 'Allowance for doubtful accounts', '1', 0);
260 INSERT INTO `0_chart_master` VALUES('1510', '', 'Inventory', '2', 0);
261 INSERT INTO `0_chart_master` VALUES('1520', '', 'Stocks of Raw Materials', '2', 0);
262 INSERT INTO `0_chart_master` VALUES('1530', '', 'Stocks of Work In Progress', '2', 0);
263 INSERT INTO `0_chart_master` VALUES('1540', '', 'Stocks of Finsihed Goods', '2', 0);
264 INSERT INTO `0_chart_master` VALUES('1550', '', 'Goods Received Clearing account', '2', 0);
265 INSERT INTO `0_chart_master` VALUES('1820', '', 'Office Furniture & Equipment', '3', 0);
266 INSERT INTO `0_chart_master` VALUES('1825', '', 'Accum. Amort. -Furn. & Equip.', '3', 0);
267 INSERT INTO `0_chart_master` VALUES('1840', '', 'Vehicle', '3', 0);
268 INSERT INTO `0_chart_master` VALUES('1845', '', 'Accum. Amort. -Vehicle', '3', 0);
269 INSERT INTO `0_chart_master` VALUES('2100', '', 'Accounts Payable', '4', 0);
270 INSERT INTO `0_chart_master` VALUES('2110', '', 'Accrued Income Tax - Federal', '4', 0);
271 INSERT INTO `0_chart_master` VALUES('2120', '', 'Accrued Income Tax - State', '4', 0);
272 INSERT INTO `0_chart_master` VALUES('2130', '', 'Accrued Franchise Tax', '4', 0);
273 INSERT INTO `0_chart_master` VALUES('2140', '', 'Accrued Real & Personal Prop Tax', '4', 0);
274 INSERT INTO `0_chart_master` VALUES('2150', '', 'Sales Tax', '4', 0);
275 INSERT INTO `0_chart_master` VALUES('2160', '', 'Accrued Use Tax Payable', '4', 0);
276 INSERT INTO `0_chart_master` VALUES('2210', '', 'Accrued Wages', '4', 0);
277 INSERT INTO `0_chart_master` VALUES('2220', '', 'Accrued Comp Time', '4', 0);
278 INSERT INTO `0_chart_master` VALUES('2230', '', 'Accrued Holiday Pay', '4', 0);
279 INSERT INTO `0_chart_master` VALUES('2240', '', 'Accrued Vacation Pay', '4', 0);
280 INSERT INTO `0_chart_master` VALUES('2310', '', 'Accr. Benefits - 401K', '4', 0);
281 INSERT INTO `0_chart_master` VALUES('2320', '', 'Accr. Benefits - Stock Purchase', '4', 0);
282 INSERT INTO `0_chart_master` VALUES('2330', '', 'Accr. Benefits - Med, Den', '4', 0);
283 INSERT INTO `0_chart_master` VALUES('2340', '', 'Accr. Benefits - Payroll Taxes', '4', 0);
284 INSERT INTO `0_chart_master` VALUES('2350', '', 'Accr. Benefits - Credit Union', '4', 0);
285 INSERT INTO `0_chart_master` VALUES('2360', '', 'Accr. Benefits - Savings Bond', '4', 0);
286 INSERT INTO `0_chart_master` VALUES('2370', '', 'Accr. Benefits - Garnish', '4', 0);
287 INSERT INTO `0_chart_master` VALUES('2380', '', 'Accr. Benefits - Charity Cont.', '4', 0);
288 INSERT INTO `0_chart_master` VALUES('2620', '', 'Bank Loans', '5', 0);
289 INSERT INTO `0_chart_master` VALUES('2680', '', 'Loans from Shareholders', '5', 0);
290 INSERT INTO `0_chart_master` VALUES('3350', '', 'Common Shares', '6', 0);
291 INSERT INTO `0_chart_master` VALUES('3590', '', 'Retained Earnings - prior years', '7', 0);
292 INSERT INTO `0_chart_master` VALUES('4010', '', 'Sales', '8', 0);
293 INSERT INTO `0_chart_master` VALUES('4430', '', 'Shipping & Handling', '9', 0);
294 INSERT INTO `0_chart_master` VALUES('4440', '', 'Interest', '9', 0);
295 INSERT INTO `0_chart_master` VALUES('4450', '', 'Foreign Exchange Gain', '9', 0);
296 INSERT INTO `0_chart_master` VALUES('4500', '', 'Prompt Payment Discounts', '9', 0);
297 INSERT INTO `0_chart_master` VALUES('4510', '', 'Discounts Given', '9', 0);
298 INSERT INTO `0_chart_master` VALUES('5010', '', 'Cost of Goods Sold - Retail', '10', 0);
299 INSERT INTO `0_chart_master` VALUES('5020', '', 'Material Usage Varaiance', '10', 0);
300 INSERT INTO `0_chart_master` VALUES('5030', '', 'Consumable Materials', '10', 0);
301 INSERT INTO `0_chart_master` VALUES('5040', '', 'Purchase price Variance', '10', 0);
302 INSERT INTO `0_chart_master` VALUES('5050', '', 'Purchases of materials', '10', 0);
303 INSERT INTO `0_chart_master` VALUES('5060', '', 'Discounts Received', '10', 0);
304 INSERT INTO `0_chart_master` VALUES('5100', '', 'Freight', '10', 0);
305 INSERT INTO `0_chart_master` VALUES('5410', '', 'Wages & Salaries', '11', 0);
306 INSERT INTO `0_chart_master` VALUES('5420', '', 'Wages - Overtime', '11', 0);
307 INSERT INTO `0_chart_master` VALUES('5430', '', 'Benefits - Comp Time', '11', 0);
308 INSERT INTO `0_chart_master` VALUES('5440', '', 'Benefits - Payroll Taxes', '11', 0);
309 INSERT INTO `0_chart_master` VALUES('5450', '', 'Benefits - Workers Comp', '11', 0);
310 INSERT INTO `0_chart_master` VALUES('5460', '', 'Benefits - Pension', '11', 0);
311 INSERT INTO `0_chart_master` VALUES('5470', '', 'Benefits - General Benefits', '11', 0);
312 INSERT INTO `0_chart_master` VALUES('5510', '', 'Inc Tax Exp - Federal', '11', 0);
313 INSERT INTO `0_chart_master` VALUES('5520', '', 'Inc Tax Exp - State', '11', 0);
314 INSERT INTO `0_chart_master` VALUES('5530', '', 'Taxes - Real Estate', '11', 0);
315 INSERT INTO `0_chart_master` VALUES('5540', '', 'Taxes - Personal Property', '11', 0);
316 INSERT INTO `0_chart_master` VALUES('5550', '', 'Taxes - Franchise', '11', 0);
317 INSERT INTO `0_chart_master` VALUES('5560', '', 'Taxes - Foreign Withholding', '11', 0);
318 INSERT INTO `0_chart_master` VALUES('5610', '', 'Accounting & Legal', '12', 0);
319 INSERT INTO `0_chart_master` VALUES('5615', '', 'Advertising & Promotions', '12', 0);
320 INSERT INTO `0_chart_master` VALUES('5620', '', 'Bad Debts', '12', 0);
321 INSERT INTO `0_chart_master` VALUES('5660', '', 'Amortization Expense', '12', 0);
322 INSERT INTO `0_chart_master` VALUES('5685', '', 'Insurance', '12', 0);
323 INSERT INTO `0_chart_master` VALUES('5690', '', 'Interest & Bank Charges', '12', 0);
324 INSERT INTO `0_chart_master` VALUES('5700', '', 'Office Supplies', '12', 0);
325 INSERT INTO `0_chart_master` VALUES('5760', '', 'Rent', '12', 0);
326 INSERT INTO `0_chart_master` VALUES('5765', '', 'Repair & Maintenance', '12', 0);
327 INSERT INTO `0_chart_master` VALUES('5780', '', 'Telephone', '12', 0);
328 INSERT INTO `0_chart_master` VALUES('5785', '', 'Travel & Entertainment', '12', 0);
329 INSERT INTO `0_chart_master` VALUES('5790', '', 'Utilities', '12', 0);
330 INSERT INTO `0_chart_master` VALUES('5795', '', 'Registrations', '12', 0);
331 INSERT INTO `0_chart_master` VALUES('5800', '', 'Licenses', '12', 0);
332 INSERT INTO `0_chart_master` VALUES('5810', '', 'Foreign Exchange Loss', '12', 0);
333 INSERT INTO `0_chart_master` VALUES('9990', '', 'Year Profit/Loss', '12', 0);
335 -- --------------------------------------------------------
338 -- Table structure for table `0_chart_types`
341 DROP TABLE IF EXISTS `0_chart_types`;
342 CREATE TABLE IF NOT EXISTS `0_chart_types` (
343 `id` varchar(10) NOT NULL,
344 `name` varchar(60) NOT NULL default '',
345 `class_id` varchar(3) NOT NULL default '',
346 `parent` varchar(10) NOT NULL default '-1',
347 `inactive` tinyint(1) NOT NULL default '0',
350 KEY `class_id` (`class_id`)
354 -- Dumping data for table `0_chart_types`
357 INSERT INTO `0_chart_types` VALUES('1', 'Current Assets', '1', '', 0);
358 INSERT INTO `0_chart_types` VALUES('2', 'Inventory Assets', '1', '', 0);
359 INSERT INTO `0_chart_types` VALUES('3', 'Capital Assets', '1', '', 0);
360 INSERT INTO `0_chart_types` VALUES('4', 'Current Liabilities', '2', '', 0);
361 INSERT INTO `0_chart_types` VALUES('5', 'Long Term Liabilities', '2', '', 0);
362 INSERT INTO `0_chart_types` VALUES('6', 'Share Capital', '2', '', 0);
363 INSERT INTO `0_chart_types` VALUES('7', 'Retained Earnings', '2', '', 0);
364 INSERT INTO `0_chart_types` VALUES('8', 'Sales Revenue', '3', '', 0);
365 INSERT INTO `0_chart_types` VALUES('9', 'Other Revenue', '3', '', 0);
366 INSERT INTO `0_chart_types` VALUES('10', 'Cost of Goods Sold', '4', '', 0);
367 INSERT INTO `0_chart_types` VALUES('11', 'Payroll Expenses', '4', '', 0);
368 INSERT INTO `0_chart_types` VALUES('12', 'General & Administrative expenses', '4', '', 0);
370 -- --------------------------------------------------------
373 -- Table structure for table `0_comments`
376 DROP TABLE IF EXISTS `0_comments`;
377 CREATE TABLE IF NOT EXISTS `0_comments` (
378 `type` int(11) NOT NULL default '0',
379 `id` int(11) NOT NULL default '0',
380 `date_` date default '0000-00-00',
382 KEY `type_and_id` (`type`,`id`)
386 -- Dumping data for table `0_comments`
390 -- --------------------------------------------------------
393 -- Table structure for table `0_credit_status`
396 DROP TABLE IF EXISTS `0_credit_status`;
397 CREATE TABLE IF NOT EXISTS `0_credit_status` (
398 `id` int(11) NOT NULL auto_increment,
399 `reason_description` char(100) NOT NULL default '',
400 `dissallow_invoices` tinyint(1) NOT NULL default '0',
401 `inactive` tinyint(1) NOT NULL default '0',
403 UNIQUE KEY `reason_description` (`reason_description`)
404 ) ENGINE=MyISAM AUTO_INCREMENT=5 ;
407 -- Dumping data for table `0_credit_status`
410 INSERT INTO `0_credit_status` VALUES(1, 'Good History', 0, 0);
411 INSERT INTO `0_credit_status` VALUES(3, 'No more work until payment received', 1, 0);
412 INSERT INTO `0_credit_status` VALUES(4, 'In liquidation', 1, 0);
414 -- --------------------------------------------------------
417 -- Table structure for table `0_crm_categories`
420 DROP TABLE IF EXISTS `0_crm_categories`;
421 CREATE TABLE IF NOT EXISTS `0_crm_categories` (
422 `id` int(11) NOT NULL auto_increment COMMENT 'pure technical key',
423 `type` varchar(20) NOT NULL COMMENT 'contact type e.g. customer',
424 `action` varchar(20) NOT NULL COMMENT 'detailed usage e.g. department',
425 `name` varchar(30) NOT NULL COMMENT 'for category selector',
426 `description` tinytext NOT NULL COMMENT 'usage description',
427 `system` tinyint(1) NOT NULL default '0' COMMENT 'nonzero for core system usage',
428 `inactive` tinyint(1) NOT NULL default '0',
430 UNIQUE KEY `type` (`type`,`action`),
431 UNIQUE KEY `type_2` (`type`,`name`)
432 ) ENGINE=InnoDB AUTO_INCREMENT=13 ;
435 -- Dumping data for table `0_crm_categories`
438 INSERT INTO `0_crm_categories` VALUES(1, 'cust_branch', 'general', 'General', 'General contact data for customer branch (overrides company setting)', 1, 0);
439 INSERT INTO `0_crm_categories` VALUES(2, 'cust_branch', 'invoice', 'Invoices', 'Invoice posting (overrides company setting)', 1, 0);
440 INSERT INTO `0_crm_categories` VALUES(3, 'cust_branch', 'order', 'Orders', 'Order confirmation (overrides company setting)', 1, 0);
441 INSERT INTO `0_crm_categories` VALUES(4, 'cust_branch', 'delivery', 'Deliveries', 'Delivery coordination (overrides company setting)', 1, 0);
442 INSERT INTO `0_crm_categories` VALUES(5, 'customer', 'general', 'General', 'General contact data for customer', 1, 0);
443 INSERT INTO `0_crm_categories` VALUES(6, 'customer', 'order', 'Orders', 'Order confirmation', 1, 0);
444 INSERT INTO `0_crm_categories` VALUES(7, 'customer', 'delivery', 'Deliveries', 'Delivery coordination', 1, 0);
445 INSERT INTO `0_crm_categories` VALUES(8, 'customer', 'invoice', 'Invoices', 'Invoice posting', 1, 0);
446 INSERT INTO `0_crm_categories` VALUES(9, 'supplier', 'general', 'General', 'General contact data for supplier', 1, 0);
447 INSERT INTO `0_crm_categories` VALUES(10, 'supplier', 'order', 'Orders', 'Order confirmation', 1, 0);
448 INSERT INTO `0_crm_categories` VALUES(11, 'supplier', 'delivery', 'Deliveries', 'Delivery coordination', 1, 0);
449 INSERT INTO `0_crm_categories` VALUES(12, 'supplier', 'invoice', 'Invoices', 'Invoice posting', 1, 0);
451 -- --------------------------------------------------------
454 -- Table structure for table `0_crm_contacts`
457 DROP TABLE IF EXISTS `0_crm_contacts`;
458 CREATE TABLE IF NOT EXISTS `0_crm_contacts` (
459 `id` int(11) NOT NULL auto_increment,
460 `person_id` int(11) NOT NULL default '0' COMMENT 'foreign key to crm_contacts',
461 `type` varchar(20) NOT NULL COMMENT 'foreign key to crm_categories',
462 `action` varchar(20) NOT NULL COMMENT 'foreign key to crm_categories',
463 `entity_id` varchar(11) default NULL COMMENT 'entity id in related class table',
465 KEY `type` (`type`,`action`)
466 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
469 -- Dumping data for table `0_crm_contacts`
472 -- --------------------------------------------------------
475 -- Table structure for table `0_crm_persons`
478 DROP TABLE IF EXISTS `0_crm_persons`;
479 CREATE TABLE IF NOT EXISTS `0_crm_persons` (
480 `id` int(11) NOT NULL auto_increment,
481 `ref` varchar(30) NOT NULL,
482 `name` varchar(60) NOT NULL,
483 `name2` varchar(60) default NULL,
485 `phone` varchar(30) default NULL,
486 `phone2` varchar(30) default NULL,
487 `fax` varchar(30) default NULL,
488 `email` varchar(100) default NULL,
489 `lang` char(5) default NULL,
490 `notes` tinytext NOT NULL,
491 `inactive` tinyint(1) NOT NULL default '0',
494 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
497 -- Dumping data for table `0_crm_persons`
501 -- --------------------------------------------------------
504 -- Table structure for table `0_currencies`
507 DROP TABLE IF EXISTS `0_currencies`;
508 CREATE TABLE IF NOT EXISTS `0_currencies` (
509 `currency` varchar(60) NOT NULL default '',
510 `curr_abrev` char(3) NOT NULL default '',
511 `curr_symbol` varchar(10) NOT NULL default '',
512 `country` varchar(100) NOT NULL default '',
513 `hundreds_name` varchar(15) NOT NULL default '',
514 `auto_update` tinyint(1) NOT NULL default '1',
515 `inactive` tinyint(1) NOT NULL default '0',
516 PRIMARY KEY (`curr_abrev`)
520 -- Dumping data for table `0_currencies`
523 INSERT INTO `0_currencies` VALUES('US Dollars', 'USD', '$', 'United States', 'Cents', 1, 0);
524 INSERT INTO `0_currencies` VALUES('CA Dollars', 'CAD', '$', 'Canada', 'Cents', 1, 0);
525 INSERT INTO `0_currencies` VALUES('Euro', 'EUR', '?', 'Europe', 'Cents', 1, 0);
526 INSERT INTO `0_currencies` VALUES('Pounds', 'GBP', '?', 'England', 'Pence', 1, 0);
528 -- --------------------------------------------------------
531 -- Table structure for table `0_cust_allocations`
534 DROP TABLE IF EXISTS `0_cust_allocations`;
535 CREATE TABLE IF NOT EXISTS `0_cust_allocations` (
536 `id` int(11) NOT NULL auto_increment,
537 `amt` double unsigned default NULL,
538 `date_alloc` date NOT NULL default '0000-00-00',
539 `trans_no_from` int(11) default NULL,
540 `trans_type_from` int(11) default NULL,
541 `trans_no_to` int(11) default NULL,
542 `trans_type_to` int(11) default NULL,
544 KEY `From` (`trans_type_from`,`trans_no_from`),
545 KEY `To` (`trans_type_to`,`trans_no_to`)
546 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
549 -- Dumping data for table `0_cust_allocations`
553 -- --------------------------------------------------------
556 -- Table structure for table `0_cust_branch`
559 DROP TABLE IF EXISTS `0_cust_branch`;
560 CREATE TABLE IF NOT EXISTS `0_cust_branch` (
561 `branch_code` int(11) NOT NULL auto_increment,
562 `debtor_no` int(11) NOT NULL default '0',
563 `br_name` varchar(60) NOT NULL default '',
564 `branch_ref` varchar(30) NOT NULL default '',
565 `br_address` tinytext NOT NULL,
566 `area` int(11) default NULL,
567 `salesman` int(11) NOT NULL default '0',
568 `contact_name` varchar(60) NOT NULL default '',
569 `default_location` varchar(5) NOT NULL default '',
570 `tax_group_id` int(11) default NULL,
571 `sales_account` varchar(15) NOT NULL default '',
572 `sales_discount_account` varchar(15) NOT NULL default '',
573 `receivables_account` varchar(15) NOT NULL default '',
574 `payment_discount_account` varchar(15) NOT NULL default '',
575 `default_ship_via` int(11) NOT NULL default '1',
576 `disable_trans` tinyint(4) NOT NULL default '0',
577 `br_post_address` tinytext NOT NULL,
578 `group_no` int(11) NOT NULL default '0',
579 `notes` tinytext NOT NULL,
580 `bank_account` varchar(60) DEFAULT NULL,
581 `inactive` tinyint(1) NOT NULL default '0',
582 PRIMARY KEY (`branch_code`,`debtor_no`),
583 KEY `branch_code` (`branch_code`),
584 KEY `branch_ref` (`branch_ref`),
585 KEY `group_no` (`group_no`)
586 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
589 -- Dumping data for table `0_cust_branch`
593 -- --------------------------------------------------------
596 -- Table structure for table `0_debtors_master`
599 DROP TABLE IF EXISTS `0_debtors_master`;
600 CREATE TABLE IF NOT EXISTS `0_debtors_master` (
601 `debtor_no` int(11) NOT NULL auto_increment,
602 `name` varchar(100) NOT NULL default '',
603 `debtor_ref` varchar(30) NOT NULL,
605 `tax_id` varchar(55) NOT NULL default '',
606 `curr_code` char(3) NOT NULL default '',
607 `sales_type` int(11) NOT NULL default '1',
608 `dimension_id` int(11) NOT NULL default '0',
609 `dimension2_id` int(11) NOT NULL default '0',
610 `credit_status` int(11) NOT NULL default '0',
611 `payment_terms` int(11) default NULL,
612 `discount` double NOT NULL default '0',
613 `pymt_discount` double NOT NULL default '0',
614 `credit_limit` float NOT NULL default '1000',
615 `notes` tinytext NOT NULL,
616 `inactive` tinyint(1) NOT NULL default '0',
617 PRIMARY KEY (`debtor_no`),
619 UNIQUE KEY `debtor_ref` (`debtor_ref`)
620 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
623 -- Dumping data for table `0_debtors_master`
627 -- --------------------------------------------------------
630 -- Table structure for table `0_debtor_trans`
633 DROP TABLE IF EXISTS `0_debtor_trans`;
634 CREATE TABLE IF NOT EXISTS `0_debtor_trans` (
635 `trans_no` int(11) unsigned NOT NULL default '0',
636 `type` smallint(6) unsigned NOT NULL default '0',
637 `version` tinyint(1) unsigned NOT NULL default '0',
638 `debtor_no` int(11) unsigned default NULL,
639 `branch_code` int(11) NOT NULL default '-1',
640 `tran_date` date NOT NULL default '0000-00-00',
641 `due_date` date NOT NULL default '0000-00-00',
642 `reference` varchar(60) NOT NULL default '',
643 `tpe` int(11) NOT NULL default '0',
644 `order_` int(11) NOT NULL default '0',
645 `ov_amount` double NOT NULL default '0',
646 `ov_gst` double NOT NULL default '0',
647 `ov_freight` double NOT NULL default '0',
648 `ov_freight_tax` double NOT NULL default '0',
649 `ov_discount` double NOT NULL default '0',
650 `alloc` double NOT NULL default '0',
651 `rate` double NOT NULL default '1',
652 `ship_via` int(11) default NULL,
653 `dimension_id` int(11) NOT NULL default '0',
654 `dimension2_id` int(11) NOT NULL default '0',
655 `payment_terms` int(11) default NULL,
656 `tax_included` tinyint(1) unsigned NOT NULL default '0',
657 PRIMARY KEY (`type`,`trans_no`),
658 KEY `debtor_no` (`debtor_no`,`branch_code`),
659 KEY `tran_date` (`tran_date`)
663 -- Dumping data for table `0_debtor_trans`
667 -- --------------------------------------------------------
670 -- Table structure for table `0_debtor_trans_details`
673 DROP TABLE IF EXISTS `0_debtor_trans_details`;
674 CREATE TABLE IF NOT EXISTS `0_debtor_trans_details` (
675 `id` int(11) NOT NULL auto_increment,
676 `debtor_trans_no` int(11) default NULL,
677 `debtor_trans_type` int(11) default NULL,
678 `stock_id` varchar(20) NOT NULL default '',
679 `description` tinytext,
680 `unit_price` double NOT NULL default '0',
681 `unit_tax` double NOT NULL default '0',
682 `quantity` double NOT NULL default '0',
683 `discount_percent` double NOT NULL default '0',
684 `standard_cost` double NOT NULL default '0',
685 `qty_done` double NOT NULL default '0',
686 `src_id` int(11) NOT NULL,
688 KEY `Transaction` (`debtor_trans_type`,`debtor_trans_no`),
690 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
693 -- Dumping data for table `0_debtor_trans_details`
697 -- --------------------------------------------------------
700 -- Table structure for table `0_dimensions`
703 DROP TABLE IF EXISTS `0_dimensions`;
704 CREATE TABLE IF NOT EXISTS `0_dimensions` (
705 `id` int(11) NOT NULL auto_increment,
706 `reference` varchar(60) NOT NULL default '',
707 `name` varchar(60) NOT NULL default '',
708 `type_` tinyint(1) NOT NULL default '1',
709 `closed` tinyint(1) NOT NULL default '0',
710 `date_` date NOT NULL default '0000-00-00',
711 `due_date` date NOT NULL default '0000-00-00',
713 UNIQUE KEY `reference` (`reference`),
714 KEY `date_` (`date_`),
715 KEY `due_date` (`due_date`),
716 KEY `type_` (`type_`)
717 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
720 -- Dumping data for table `0_dimensions`
724 -- --------------------------------------------------------
727 -- Table structure for table `0_exchange_rates`
730 DROP TABLE IF EXISTS `0_exchange_rates`;
731 CREATE TABLE IF NOT EXISTS `0_exchange_rates` (
732 `id` int(11) NOT NULL auto_increment,
733 `curr_code` char(3) NOT NULL default '',
734 `rate_buy` double NOT NULL default '0',
735 `rate_sell` double NOT NULL default '0',
736 `date_` date NOT NULL default '0000-00-00',
738 UNIQUE KEY `curr_code` (`curr_code`,`date_`)
739 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
742 -- Dumping data for table `0_exchange_rates`
746 -- --------------------------------------------------------
749 -- Table structure for table `0_fiscal_year`
752 DROP TABLE IF EXISTS `0_fiscal_year`;
753 CREATE TABLE IF NOT EXISTS `0_fiscal_year` (
754 `id` int(11) NOT NULL auto_increment,
755 `begin` date default '0000-00-00',
756 `end` date default '0000-00-00',
757 `closed` tinyint(1) NOT NULL default '0',
759 UNIQUE KEY `begin` (`begin`),
760 UNIQUE KEY `end` (`end`)
761 ) ENGINE=InnoDB AUTO_INCREMENT=4 ;
764 -- Dumping data for table `0_fiscal_year`
767 INSERT INTO `0_fiscal_year` VALUES(1, '2008-01-01', '2008-12-31', 0);
768 INSERT INTO `0_fiscal_year` VALUES(2, '2009-01-01', '2009-12-31', 0);
769 INSERT INTO `0_fiscal_year` VALUES(3, '2010-01-01', '2010-12-31', 0);
770 INSERT INTO `0_fiscal_year` VALUES(4, '2011-01-01', '2011-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,
817 KEY `delivery_date` (`delivery_date`),
818 KEY `purch_order_no` (`purch_order_no`)
819 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
822 -- Dumping data for table `0_grn_batch`
826 -- --------------------------------------------------------
829 -- Table structure for table `0_grn_items`
832 DROP TABLE IF EXISTS `0_grn_items`;
833 CREATE TABLE IF NOT EXISTS `0_grn_items` (
834 `id` int(11) NOT NULL auto_increment,
835 `grn_batch_id` int(11) default NULL,
836 `po_detail_item` int(11) NOT NULL default '0',
837 `item_code` varchar(20) NOT NULL default '',
838 `description` tinytext,
839 `qty_recd` double NOT NULL default '0',
840 `quantity_inv` double NOT NULL default '0',
842 KEY `grn_batch_id` (`grn_batch_id`)
843 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
846 -- Dumping data for table `0_grn_items`
850 -- --------------------------------------------------------
853 -- Table structure for table `0_groups`
856 DROP TABLE IF EXISTS `0_groups`;
857 CREATE TABLE IF NOT EXISTS `0_groups` (
858 `id` smallint(6) unsigned NOT NULL auto_increment,
859 `description` varchar(60) NOT NULL default '',
860 `inactive` tinyint(1) NOT NULL default '0',
862 UNIQUE KEY `description` (`description`)
863 ) ENGINE=MyISAM AUTO_INCREMENT=4 ;
866 -- Dumping data for table `0_groups`
869 INSERT INTO `0_groups` VALUES(1, 'Small', 0);
870 INSERT INTO `0_groups` VALUES(2, 'Medium', 0);
871 INSERT INTO `0_groups` VALUES(3, 'Large', 0);
873 -- --------------------------------------------------------
876 -- Table structure for table `0_item_codes`
879 DROP TABLE IF EXISTS `0_item_codes`;
880 CREATE TABLE IF NOT EXISTS `0_item_codes` (
881 `id` int(11) unsigned NOT NULL auto_increment,
882 `item_code` varchar(20) NOT NULL,
883 `stock_id` varchar(20) NOT NULL,
884 `description` varchar(200) NOT NULL default '',
885 `category_id` smallint(6) unsigned NOT NULL,
886 `quantity` double NOT NULL default '1',
887 `is_foreign` tinyint(1) NOT NULL default '0',
888 `inactive` tinyint(1) NOT NULL default '0',
890 UNIQUE KEY `stock_id` (`stock_id`,`item_code`),
891 KEY `item_code` (`item_code`)
892 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
895 -- Dumping data for table `0_item_codes`
899 -- --------------------------------------------------------
902 -- Table structure for table `0_item_tax_types`
905 DROP TABLE IF EXISTS `0_item_tax_types`;
906 CREATE TABLE IF NOT EXISTS `0_item_tax_types` (
907 `id` int(11) NOT NULL auto_increment,
908 `name` varchar(60) NOT NULL default '',
909 `exempt` tinyint(1) NOT NULL default '0',
910 `inactive` tinyint(1) NOT NULL default '0',
912 UNIQUE KEY `name` (`name`)
913 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
916 -- Dumping data for table `0_item_tax_types`
919 INSERT INTO `0_item_tax_types` VALUES(1, 'Regular', 0, 0);
921 -- --------------------------------------------------------
924 -- Table structure for table `0_item_tax_type_exemptions`
927 DROP TABLE IF EXISTS `0_item_tax_type_exemptions`;
928 CREATE TABLE IF NOT EXISTS `0_item_tax_type_exemptions` (
929 `item_tax_type_id` int(11) NOT NULL default '0',
930 `tax_type_id` int(11) NOT NULL default '0',
931 PRIMARY KEY (`item_tax_type_id`,`tax_type_id`)
935 -- Dumping data for table `0_item_tax_type_exemptions`
939 -- --------------------------------------------------------
942 -- Table structure for table `0_item_units`
945 DROP TABLE IF EXISTS `0_item_units`;
946 CREATE TABLE IF NOT EXISTS `0_item_units` (
947 `abbr` varchar(20) NOT NULL,
948 `name` varchar(40) NOT NULL,
949 `decimals` tinyint(2) NOT NULL,
950 `inactive` tinyint(1) NOT NULL default '0',
951 PRIMARY KEY (`abbr`),
952 UNIQUE KEY `name` (`name`)
956 -- Dumping data for table `0_item_units`
959 INSERT INTO `0_item_units` VALUES('ea.', 'Each', 0, 0);
961 -- --------------------------------------------------------
964 -- Table structure for table `0_locations`
967 DROP TABLE IF EXISTS `0_locations`;
968 CREATE TABLE IF NOT EXISTS `0_locations` (
969 `loc_code` varchar(5) NOT NULL default '',
970 `location_name` varchar(60) NOT NULL default '',
971 `delivery_address` tinytext NOT NULL,
972 `phone` varchar(30) NOT NULL default '',
973 `phone2` varchar(30) NOT NULL default '',
974 `fax` varchar(30) NOT NULL default '',
975 `email` varchar(100) NOT NULL default '',
976 `contact` varchar(30) NOT NULL default '',
977 `inactive` tinyint(1) NOT NULL default '0',
978 PRIMARY KEY (`loc_code`)
982 -- Dumping data for table `0_locations`
985 INSERT INTO `0_locations` VALUES('DEF', 'Default', 'N/A', '', '', '', '', '', 0);
987 -- --------------------------------------------------------
990 -- Table structure for table `0_loc_stock`
993 DROP TABLE IF EXISTS `0_loc_stock`;
994 CREATE TABLE IF NOT EXISTS `0_loc_stock` (
995 `loc_code` char(5) NOT NULL default '',
996 `stock_id` char(20) NOT NULL default '',
997 `reorder_level` bigint(20) NOT NULL default '0',
998 PRIMARY KEY (`loc_code`,`stock_id`),
999 KEY `stock_id` (`stock_id`)
1003 -- Dumping data for table `0_loc_stock`
1007 -- --------------------------------------------------------
1010 -- Table structure for table `0_movement_types`
1013 DROP TABLE IF EXISTS `0_movement_types`;
1014 CREATE TABLE IF NOT EXISTS `0_movement_types` (
1015 `id` int(11) NOT NULL auto_increment,
1016 `name` varchar(60) NOT NULL default '',
1017 `inactive` tinyint(1) NOT NULL default '0',
1019 UNIQUE KEY `name` (`name`)
1020 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
1023 -- Dumping data for table `0_movement_types`
1026 INSERT INTO `0_movement_types` VALUES(1, 'Adjustment', 0);
1028 -- --------------------------------------------------------
1031 -- Table structure for table `0_payment_terms`
1034 DROP TABLE IF EXISTS `0_payment_terms`;
1035 CREATE TABLE IF NOT EXISTS `0_payment_terms` (
1036 `terms_indicator` int(11) NOT NULL auto_increment,
1037 `terms` char(80) NOT NULL default '',
1038 `days_before_due` smallint(6) NOT NULL default '0',
1039 `day_in_following_month` smallint(6) NOT NULL default '0',
1040 `inactive` tinyint(1) NOT NULL default '0',
1041 PRIMARY KEY (`terms_indicator`),
1042 UNIQUE KEY `terms` (`terms`)
1043 ) ENGINE=MyISAM AUTO_INCREMENT=5 ;
1046 -- Dumping data for table `0_payment_terms`
1049 INSERT INTO `0_payment_terms` VALUES(1, 'Due 15th Of the Following Month', 0, 17, 0);
1050 INSERT INTO `0_payment_terms` VALUES(2, 'Due By End Of The Following Month', 0, 30, 0);
1051 INSERT INTO `0_payment_terms` VALUES(3, 'Payment due within 10 days', 10, 0, 0);
1052 INSERT INTO `0_payment_terms` VALUES(4, 'Cash Only', 0, 0, 0);
1054 -- --------------------------------------------------------
1057 -- Table structure for table `0_prices`
1060 DROP TABLE IF EXISTS `0_prices`;
1061 CREATE TABLE IF NOT EXISTS `0_prices` (
1062 `id` int(11) NOT NULL auto_increment,
1063 `stock_id` varchar(20) NOT NULL default '',
1064 `sales_type_id` int(11) NOT NULL default '0',
1065 `curr_abrev` char(3) NOT NULL default '',
1066 `price` double NOT NULL default '0',
1068 UNIQUE KEY `price` (`stock_id`,`sales_type_id`,`curr_abrev`)
1069 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1072 -- Dumping data for table `0_prices`
1076 -- --------------------------------------------------------
1079 -- Table structure for table `0_printers`
1082 DROP TABLE IF EXISTS `0_printers`;
1083 CREATE TABLE IF NOT EXISTS `0_printers` (
1084 `id` tinyint(3) unsigned NOT NULL auto_increment,
1085 `name` varchar(20) NOT NULL,
1086 `description` varchar(60) NOT NULL,
1087 `queue` varchar(20) NOT NULL,
1088 `host` varchar(40) NOT NULL,
1089 `port` smallint(11) unsigned NOT NULL,
1090 `timeout` tinyint(3) unsigned NOT NULL,
1092 UNIQUE KEY `name` (`name`)
1093 ) ENGINE=MyISAM AUTO_INCREMENT=4 ;
1096 -- Dumping data for table `0_printers`
1099 INSERT INTO `0_printers` VALUES(1, 'QL500', 'Label printer', 'QL500', 'server', 127, 20);
1100 INSERT INTO `0_printers` VALUES(2, 'Samsung', 'Main network printer', 'scx4521F', 'server', 515, 5);
1101 INSERT INTO `0_printers` VALUES(3, 'Local', 'Local print server at user IP', 'lp', '', 515, 10);
1103 -- --------------------------------------------------------
1106 -- Table structure for table `0_print_profiles`
1109 DROP TABLE IF EXISTS `0_print_profiles`;
1110 CREATE TABLE IF NOT EXISTS `0_print_profiles` (
1111 `id` smallint(6) unsigned NOT NULL auto_increment,
1112 `profile` varchar(30) NOT NULL,
1113 `report` varchar(5) default NULL,
1114 `printer` tinyint(3) unsigned default NULL,
1116 UNIQUE KEY `profile` (`profile`,`report`)
1117 ) ENGINE=MyISAM AUTO_INCREMENT=10 ;
1120 -- Dumping data for table `0_print_profiles`
1123 INSERT INTO `0_print_profiles` VALUES(1, 'Out of office', '', 0);
1124 INSERT INTO `0_print_profiles` VALUES(2, 'Sales Department', '', 0);
1125 INSERT INTO `0_print_profiles` VALUES(3, 'Central', '', 2);
1126 INSERT INTO `0_print_profiles` VALUES(4, 'Sales Department', '104', 2);
1127 INSERT INTO `0_print_profiles` VALUES(5, 'Sales Department', '105', 2);
1128 INSERT INTO `0_print_profiles` VALUES(6, 'Sales Department', '107', 2);
1129 INSERT INTO `0_print_profiles` VALUES(7, 'Sales Department', '109', 2);
1130 INSERT INTO `0_print_profiles` VALUES(8, 'Sales Department', '110', 2);
1131 INSERT INTO `0_print_profiles` VALUES(9, 'Sales Department', '201', 2);
1133 -- --------------------------------------------------------
1136 -- Table structure for table `0_purch_data`
1139 DROP TABLE IF EXISTS `0_purch_data`;
1140 CREATE TABLE IF NOT EXISTS `0_purch_data` (
1141 `supplier_id` int(11) NOT NULL default '0',
1142 `stock_id` char(20) NOT NULL default '',
1143 `price` double NOT NULL default '0',
1144 `suppliers_uom` char(50) NOT NULL default '',
1145 `conversion_factor` double NOT NULL default '1',
1146 `supplier_description` char(50) NOT NULL default '',
1147 PRIMARY KEY (`supplier_id`,`stock_id`)
1151 -- Dumping data for table `0_purch_data`
1155 -- --------------------------------------------------------
1158 -- Table structure for table `0_purch_orders`
1161 DROP TABLE IF EXISTS `0_purch_orders`;
1162 CREATE TABLE IF NOT EXISTS `0_purch_orders` (
1163 `order_no` int(11) NOT NULL auto_increment,
1164 `supplier_id` int(11) NOT NULL default '0',
1165 `comments` tinytext,
1166 `ord_date` date NOT NULL default '0000-00-00',
1167 `reference` tinytext NOT NULL,
1168 `requisition_no` tinytext,
1169 `into_stock_location` varchar(5) NOT NULL default '',
1170 `delivery_address` tinytext NOT NULL,
1171 `total` double NOT NULL default '0',
1172 `tax_included` tinyint(1) NOT NULL default '0',
1173 PRIMARY KEY (`order_no`),
1174 KEY `ord_date` (`ord_date`)
1175 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1178 -- Dumping data for table `0_purch_orders`
1182 -- --------------------------------------------------------
1185 -- Table structure for table `0_purch_order_details`
1188 DROP TABLE IF EXISTS `0_purch_order_details`;
1189 CREATE TABLE IF NOT EXISTS `0_purch_order_details` (
1190 `po_detail_item` int(11) NOT NULL auto_increment,
1191 `order_no` int(11) NOT NULL default '0',
1192 `item_code` varchar(20) NOT NULL default '',
1193 `description` tinytext,
1194 `delivery_date` date NOT NULL default '0000-00-00',
1195 `qty_invoiced` double NOT NULL default '0',
1196 `unit_price` double NOT NULL default '0',
1197 `act_price` double NOT NULL default '0',
1198 `std_cost_unit` double NOT NULL default '0',
1199 `quantity_ordered` double NOT NULL default '0',
1200 `quantity_received` double NOT NULL default '0',
1201 PRIMARY KEY (`po_detail_item`),
1202 KEY `order` (`order_no`,`po_detail_item`),
1203 KEY `itemcode` (`item_code`)
1204 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1207 -- Dumping data for table `0_purch_order_details`
1211 -- --------------------------------------------------------
1214 -- Table structure for table `0_quick_entries`
1217 DROP TABLE IF EXISTS `0_quick_entries`;
1218 CREATE TABLE IF NOT EXISTS `0_quick_entries` (
1219 `id` smallint(6) unsigned NOT NULL auto_increment,
1220 `type` tinyint(1) NOT NULL default '0',
1221 `description` varchar(60) NOT NULL,
1222 `base_amount` double NOT NULL default '0',
1223 `base_desc` varchar(60) default NULL,
1224 `bal_type` tinyint(1) NOT NULL default '0',
1226 KEY `description` (`description`)
1227 ) ENGINE=MyISAM AUTO_INCREMENT=4 ;
1230 -- Dumping data for table `0_quick_entries`
1233 INSERT INTO `0_quick_entries` VALUES(1, 1, 'Maintenance', 0, 'Amount', 0);
1234 INSERT INTO `0_quick_entries` VALUES(2, 4, 'Phone', 0, 'Amount', 0);
1235 INSERT INTO `0_quick_entries` VALUES(3, 2, 'Cash Sales', 0, 'Amount', 0);
1237 -- --------------------------------------------------------
1240 -- Table structure for table `0_quick_entry_lines`
1243 DROP TABLE IF EXISTS `0_quick_entry_lines`;
1244 CREATE TABLE IF NOT EXISTS `0_quick_entry_lines` (
1245 `id` smallint(6) unsigned NOT NULL auto_increment,
1246 `qid` smallint(6) unsigned NOT NULL,
1247 `amount` double default '0',
1248 `action` varchar(2) NOT NULL,
1249 `dest_id` varchar(15) NOT NULL default '',
1250 `dimension_id` smallint(6) unsigned default NULL,
1251 `dimension2_id` smallint(6) unsigned default NULL,
1254 ) ENGINE=MyISAM AUTO_INCREMENT=7 ;
1257 -- Dumping data for table `0_quick_entry_lines`
1260 INSERT INTO `0_quick_entry_lines` VALUES(1, 1, 0, 't-', '1', 0, 0);
1261 INSERT INTO `0_quick_entry_lines` VALUES(2, 2, 0, 't-', '1', 0, 0);
1262 INSERT INTO `0_quick_entry_lines` VALUES(3, 3, 0, 't-', '1', 0, 0);
1263 INSERT INTO `0_quick_entry_lines` VALUES(4, 3, 0, '=', '4010', 0, 0);
1264 INSERT INTO `0_quick_entry_lines` VALUES(5, 1, 0, '=', '5765', 0, 0);
1265 INSERT INTO `0_quick_entry_lines` VALUES(6, 2, 0, '=', '5780', 0, 0);
1267 -- --------------------------------------------------------
1270 -- Table structure for table `0_recurrent_invoices`
1273 DROP TABLE IF EXISTS `0_recurrent_invoices`;
1274 CREATE TABLE IF NOT EXISTS `0_recurrent_invoices` (
1275 `id` smallint(6) unsigned NOT NULL auto_increment,
1276 `description` varchar(60) NOT NULL default '',
1277 `order_no` int(11) unsigned NOT NULL,
1278 `debtor_no` int(11) unsigned default NULL,
1279 `group_no` smallint(6) unsigned default NULL,
1280 `days` int(11) NOT NULL default '0',
1281 `monthly` int(11) NOT NULL default '0',
1282 `begin` date NOT NULL default '0000-00-00',
1283 `end` date NOT NULL default '0000-00-00',
1284 `last_sent` date NOT NULL default '0000-00-00',
1286 UNIQUE KEY `description` (`description`)
1287 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1290 -- Dumping data for table `0_recurrent_invoices`
1294 -- --------------------------------------------------------
1297 -- Table structure for table `0_refs`
1300 DROP TABLE IF EXISTS `0_refs`;
1301 CREATE TABLE IF NOT EXISTS `0_refs` (
1302 `id` int(11) NOT NULL default '0',
1303 `type` int(11) NOT NULL default '0',
1304 `reference` varchar(100) NOT NULL default '',
1305 PRIMARY KEY (`id`,`type`),
1306 KEY `Type_and_Reference` (`type`,`reference`)
1310 -- Dumping data for table `0_refs`
1314 -- --------------------------------------------------------
1317 -- Table structure for table `0_salesman`
1320 DROP TABLE IF EXISTS `0_salesman`;
1321 CREATE TABLE IF NOT EXISTS `0_salesman` (
1322 `salesman_code` int(11) NOT NULL auto_increment,
1323 `salesman_name` char(60) NOT NULL default '',
1324 `salesman_phone` char(30) NOT NULL default '',
1325 `salesman_fax` char(30) NOT NULL default '',
1326 `salesman_email` varchar(100) NOT NULL default '',
1327 `provision` double NOT NULL default '0',
1328 `break_pt` double NOT NULL default '0',
1329 `provision2` double NOT NULL default '0',
1330 `inactive` tinyint(1) NOT NULL default '0',
1331 PRIMARY KEY (`salesman_code`),
1332 UNIQUE KEY `salesman_name` (`salesman_name`)
1333 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
1336 -- Dumping data for table `0_salesman`
1339 INSERT INTO `0_salesman` VALUES(1, 'Sales Person', '', '', '', 5, 1000, 4, 0);
1341 -- --------------------------------------------------------
1344 -- Table structure for table `0_sales_orders`
1347 DROP TABLE IF EXISTS `0_sales_orders`;
1348 CREATE TABLE IF NOT EXISTS `0_sales_orders` (
1349 `order_no` int(11) NOT NULL,
1350 `trans_type` smallint(6) NOT NULL default '30',
1351 `version` tinyint(1) unsigned NOT NULL default '0',
1352 `type` tinyint(1) NOT NULL default '0',
1353 `debtor_no` int(11) NOT NULL default '0',
1354 `branch_code` int(11) NOT NULL default '0',
1355 `reference` varchar(100) NOT NULL default '',
1356 `customer_ref` tinytext NOT NULL,
1357 `comments` tinytext,
1358 `ord_date` date NOT NULL default '0000-00-00',
1359 `order_type` int(11) NOT NULL default '0',
1360 `ship_via` int(11) NOT NULL default '0',
1361 `delivery_address` tinytext NOT NULL,
1362 `contact_phone` varchar(30) default NULL,
1363 `contact_email` varchar(100) default NULL,
1364 `deliver_to` tinytext NOT NULL,
1365 `freight_cost` double NOT NULL default '0',
1366 `from_stk_loc` varchar(5) NOT NULL default '',
1367 `delivery_date` date NOT NULL default '0000-00-00',
1368 `payment_terms` int(11) default NULL,
1369 `total` double NOT NULL default '0',
1370 PRIMARY KEY (`trans_type`,`order_no`)
1374 -- Dumping data for table `0_sales_orders`
1378 -- --------------------------------------------------------
1381 -- Table structure for table `0_sales_order_details`
1384 DROP TABLE IF EXISTS `0_sales_order_details`;
1385 CREATE TABLE IF NOT EXISTS `0_sales_order_details` (
1386 `id` int(11) NOT NULL auto_increment,
1387 `order_no` int(11) NOT NULL default '0',
1388 `trans_type` smallint(6) NOT NULL default '30',
1389 `stk_code` varchar(20) NOT NULL default '',
1390 `description` tinytext,
1391 `qty_sent` double NOT NULL default '0',
1392 `unit_price` double NOT NULL default '0',
1393 `quantity` double NOT NULL default '0',
1394 `discount_percent` double NOT NULL default '0',
1396 KEY `sorder` (`trans_type`,`order_no`),
1397 KEY `stkcode` (`stk_code`)
1398 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1401 -- Dumping data for table `0_sales_order_details`
1405 -- --------------------------------------------------------
1408 -- Table structure for table `0_sales_pos`
1411 DROP TABLE IF EXISTS `0_sales_pos`;
1412 CREATE TABLE IF NOT EXISTS `0_sales_pos` (
1413 `id` smallint(6) unsigned NOT NULL auto_increment,
1414 `pos_name` varchar(30) NOT NULL,
1415 `cash_sale` tinyint(1) NOT NULL,
1416 `credit_sale` tinyint(1) NOT NULL,
1417 `pos_location` varchar(5) NOT NULL,
1418 `pos_account` smallint(6) unsigned NOT NULL,
1419 `inactive` tinyint(1) NOT NULL default '0',
1421 UNIQUE KEY `pos_name` (`pos_name`)
1422 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
1425 -- Dumping data for table `0_sales_pos`
1428 INSERT INTO `0_sales_pos` VALUES(1, 'Default', 1, 1, 'DEF', 2, 0);
1430 -- --------------------------------------------------------
1433 -- Table structure for table `0_sales_types`
1436 DROP TABLE IF EXISTS `0_sales_types`;
1437 CREATE TABLE IF NOT EXISTS `0_sales_types` (
1438 `id` int(11) NOT NULL auto_increment,
1439 `sales_type` char(50) NOT NULL default '',
1440 `tax_included` int(1) NOT NULL default '0',
1441 `factor` double NOT NULL default '1',
1442 `inactive` tinyint(1) NOT NULL default '0',
1444 UNIQUE KEY `sales_type` (`sales_type`)
1445 ) ENGINE=MyISAM AUTO_INCREMENT=3 ;
1448 -- Dumping data for table `0_sales_types`
1451 INSERT INTO `0_sales_types` VALUES(1, 'Retail', 1, 1, 0);
1452 INSERT INTO `0_sales_types` VALUES(2, 'Wholesale', 0, 0.7, 0);
1454 -- --------------------------------------------------------
1457 -- Table structure for table `0_security_roles`
1460 DROP TABLE IF EXISTS `0_security_roles`;
1461 CREATE TABLE IF NOT EXISTS `0_security_roles` (
1462 `id` int(11) NOT NULL auto_increment,
1463 `role` varchar(30) NOT NULL,
1464 `description` varchar(50) default NULL,
1467 `inactive` tinyint(1) NOT NULL default '0',
1469 UNIQUE KEY `role` (`role`)
1470 ) ENGINE=MyISAM AUTO_INCREMENT=11 ;
1473 -- Dumping data for table `0_security_roles`
1476 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', 0);
1477 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', 0);
1478 INSERT INTO `0_security_roles` VALUES(3, 'Salesman', 'Salesman', '768;3072;5632;8192;15872', '773;774;3073;3075;3081;5633;8194;15873', 0);
1479 INSERT INTO `0_security_roles` VALUES(4, 'Stock Manager', 'Stock Manager', '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', 0);
1480 INSERT INTO `0_security_roles` VALUES(5, 'Production Manager', 'Production Manager', '512;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', 0);
1481 INSERT INTO `0_security_roles` VALUES(6, 'Purchase Officer', 'Purchase Officer', '512;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', 0);
1482 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', 0);
1483 INSERT INTO `0_security_roles` VALUES(8, 'AP Officer', 'AP Officer', '512;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', 0);
1484 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', 0);
1485 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', 0);
1487 -- --------------------------------------------------------
1490 -- Table structure for table `0_shippers`
1493 DROP TABLE IF EXISTS `0_shippers`;
1494 CREATE TABLE IF NOT EXISTS `0_shippers` (
1495 `shipper_id` int(11) NOT NULL auto_increment,
1496 `shipper_name` varchar(60) NOT NULL default '',
1497 `phone` varchar(30) NOT NULL default '',
1498 `phone2` varchar(30) NOT NULL default '',
1499 `contact` tinytext NOT NULL,
1500 `address` tinytext NOT NULL,
1501 `inactive` tinyint(1) NOT NULL default '0',
1502 PRIMARY KEY (`shipper_id`),
1503 UNIQUE KEY `name` (`shipper_name`)
1504 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
1507 -- Dumping data for table `0_shippers`
1510 INSERT INTO `0_shippers` VALUES(1, 'Default', '', '', '', '', 0);
1512 -- --------------------------------------------------------
1515 -- Table structure for table `0_sql_trail`
1518 DROP TABLE IF EXISTS `0_sql_trail`;
1519 CREATE TABLE IF NOT EXISTS `0_sql_trail` (
1520 `id` int(11) unsigned NOT NULL auto_increment,
1521 `sql` text NOT NULL,
1522 `result` tinyint(1) NOT NULL,
1523 `msg` varchar(255) NOT NULL,
1525 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1528 -- Dumping data for table `0_sql_trail`
1532 -- --------------------------------------------------------
1535 -- Table structure for table `0_stock_category`
1538 DROP TABLE IF EXISTS `0_stock_category`;
1539 CREATE TABLE IF NOT EXISTS `0_stock_category` (
1540 `category_id` int(11) NOT NULL auto_increment,
1541 `description` varchar(60) NOT NULL default '',
1542 `dflt_tax_type` int(11) NOT NULL default '1',
1543 `dflt_units` varchar(20) NOT NULL default 'each',
1544 `dflt_mb_flag` char(1) NOT NULL default 'B',
1545 `dflt_sales_act` varchar(15) NOT NULL default '',
1546 `dflt_cogs_act` varchar(15) NOT NULL default '',
1547 `dflt_inventory_act` varchar(15) NOT NULL default '',
1548 `dflt_adjustment_act` varchar(15) NOT NULL default '',
1549 `dflt_assembly_act` varchar(15) NOT NULL default '',
1550 `dflt_dim1` int(11) default NULL,
1551 `dflt_dim2` int(11) default NULL,
1552 `inactive` tinyint(1) NOT NULL default '0',
1553 `dflt_no_sale` tinyint(1) NOT NULL default '0',
1554 PRIMARY KEY (`category_id`),
1555 UNIQUE KEY `description` (`description`)
1556 ) ENGINE=MyISAM AUTO_INCREMENT=5 ;
1559 -- Dumping data for table `0_stock_category`
1562 INSERT INTO `0_stock_category` VALUES(1, 'Components', 1, 'each', 'B', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0);
1563 INSERT INTO `0_stock_category` VALUES(2, 'Charges', 1, 'each', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0);
1564 INSERT INTO `0_stock_category` VALUES(3, 'Systems', 1, 'each', 'M', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0);
1565 INSERT INTO `0_stock_category` VALUES(4, 'Services', 1, 'hrs', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0);
1567 -- --------------------------------------------------------
1570 -- Table structure for table `0_stock_master`
1573 DROP TABLE IF EXISTS `0_stock_master`;
1574 CREATE TABLE IF NOT EXISTS `0_stock_master` (
1575 `stock_id` varchar(20) NOT NULL default '',
1576 `category_id` int(11) NOT NULL default '0',
1577 `tax_type_id` int(11) NOT NULL default '0',
1578 `description` varchar(200) NOT NULL default '',
1579 `long_description` tinytext NOT NULL,
1580 `units` varchar(20) NOT NULL default 'each',
1581 `mb_flag` char(1) NOT NULL default 'B',
1582 `sales_account` varchar(15) NOT NULL default '',
1583 `cogs_account` varchar(15) NOT NULL default '',
1584 `inventory_account` varchar(15) NOT NULL default '',
1585 `adjustment_account` varchar(15) NOT NULL default '',
1586 `assembly_account` varchar(15) NOT NULL default '',
1587 `dimension_id` int(11) default NULL,
1588 `dimension2_id` int(11) default NULL,
1589 `actual_cost` double NOT NULL default '0',
1590 `last_cost` double NOT NULL default '0',
1591 `material_cost` double NOT NULL default '0',
1592 `labour_cost` double NOT NULL default '0',
1593 `overhead_cost` double NOT NULL default '0',
1594 `inactive` tinyint(1) NOT NULL default '0',
1595 `no_sale` tinyint(1) NOT NULL default '0',
1596 `editable` tinyint(1) NOT NULL default '0',
1597 PRIMARY KEY (`stock_id`)
1601 -- Dumping data for table `0_stock_master`
1605 -- --------------------------------------------------------
1608 -- Table structure for table `0_stock_moves`
1611 DROP TABLE IF EXISTS `0_stock_moves`;
1612 CREATE TABLE IF NOT EXISTS `0_stock_moves` (
1613 `trans_id` int(11) NOT NULL auto_increment,
1614 `trans_no` int(11) NOT NULL default '0',
1615 `stock_id` char(20) NOT NULL default '',
1616 `type` smallint(6) NOT NULL default '0',
1617 `loc_code` char(5) NOT NULL default '',
1618 `tran_date` date NOT NULL default '0000-00-00',
1619 `person_id` int(11) default NULL,
1620 `price` double NOT NULL default '0',
1621 `reference` char(40) NOT NULL default '',
1622 `qty` double NOT NULL default '1',
1623 `discount_percent` double NOT NULL default '0',
1624 `standard_cost` double NOT NULL default '0',
1625 `visible` tinyint(1) NOT NULL default '1',
1626 PRIMARY KEY (`trans_id`),
1627 KEY `type` (`type`,`trans_no`),
1628 KEY `Move` (`stock_id`,`loc_code`,`tran_date`)
1629 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1632 -- Dumping data for table `0_stock_moves`
1636 -- --------------------------------------------------------
1639 -- Table structure for table `0_suppliers`
1642 DROP TABLE IF EXISTS `0_suppliers`;
1643 CREATE TABLE IF NOT EXISTS `0_suppliers` (
1644 `supplier_id` int(11) NOT NULL auto_increment,
1645 `supp_name` varchar(60) NOT NULL default '',
1646 `supp_ref` varchar(30) NOT NULL default '',
1647 `address` tinytext NOT NULL,
1648 `supp_address` tinytext NOT NULL,
1649 `gst_no` varchar(25) NOT NULL default '',
1650 `contact` varchar(60) NOT NULL default '',
1651 `supp_account_no` varchar(40) NOT NULL default '',
1652 `website` varchar(100) NOT NULL default '',
1653 `bank_account` varchar(60) NOT NULL default '',
1654 `curr_code` char(3) default NULL,
1655 `payment_terms` int(11) default NULL,
1656 `tax_included` tinyint(1) NOT NULL default '0',
1657 `tax_algorithm` tinyint(1) NOT NULL default '1',
1658 `dimension_id` int(11) default '0',
1659 `dimension2_id` int(11) default '0',
1660 `tax_group_id` int(11) default NULL,
1661 `credit_limit` double NOT NULL default '0',
1662 `purchase_account` varchar(15) NOT NULL default '',
1663 `payable_account` varchar(15) NOT NULL default '',
1664 `payment_discount_account` varchar(15) NOT NULL default '',
1665 `notes` tinytext NOT NULL,
1666 `inactive` tinyint(1) NOT NULL default '0',
1667 PRIMARY KEY (`supplier_id`),
1668 KEY `supp_ref` (`supp_ref`)
1669 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1672 -- Dumping data for table `0_suppliers`
1676 -- --------------------------------------------------------
1679 -- Table structure for table `0_supp_allocations`
1682 DROP TABLE IF EXISTS `0_supp_allocations`;
1683 CREATE TABLE IF NOT EXISTS `0_supp_allocations` (
1684 `id` int(11) NOT NULL auto_increment,
1685 `amt` double unsigned default NULL,
1686 `date_alloc` date NOT NULL default '0000-00-00',
1687 `trans_no_from` int(11) default NULL,
1688 `trans_type_from` int(11) default NULL,
1689 `trans_no_to` int(11) default NULL,
1690 `trans_type_to` int(11) default NULL,
1692 KEY `From` (`trans_type_from`,`trans_no_from`),
1693 KEY `To` (`trans_type_to`,`trans_no_to`)
1694 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1697 -- Dumping data for table `0_supp_allocations`
1701 -- --------------------------------------------------------
1704 -- Table structure for table `0_supp_invoice_items`
1707 DROP TABLE IF EXISTS `0_supp_invoice_items`;
1708 CREATE TABLE IF NOT EXISTS `0_supp_invoice_items` (
1709 `id` int(11) NOT NULL auto_increment,
1710 `supp_trans_no` int(11) default NULL,
1711 `supp_trans_type` int(11) default NULL,
1712 `gl_code` varchar(15) NOT NULL default '',
1713 `grn_item_id` int(11) default NULL,
1714 `po_detail_item_id` int(11) default NULL,
1715 `stock_id` varchar(20) NOT NULL default '',
1716 `description` tinytext,
1717 `quantity` double NOT NULL default '0',
1718 `unit_price` double NOT NULL default '0',
1719 `unit_tax` double NOT NULL default '0',
1722 KEY `Transaction` (`supp_trans_type`,`supp_trans_no`,`stock_id`)
1723 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1726 -- Dumping data for table `0_supp_invoice_items`
1730 -- --------------------------------------------------------
1733 -- Table structure for table `0_supp_trans`
1736 DROP TABLE IF EXISTS `0_supp_trans`;
1737 CREATE TABLE IF NOT EXISTS `0_supp_trans` (
1738 `trans_no` int(11) unsigned NOT NULL default '0',
1739 `type` smallint(6) unsigned NOT NULL default '0',
1740 `supplier_id` int(11) unsigned default NULL,
1741 `reference` tinytext NOT NULL,
1742 `supp_reference` varchar(60) NOT NULL default '',
1743 `tran_date` date NOT NULL default '0000-00-00',
1744 `due_date` date NOT NULL default '0000-00-00',
1745 `ov_amount` double NOT NULL default '0',
1746 `ov_discount` double NOT NULL default '0',
1747 `ov_gst` double NOT NULL default '0',
1748 `rate` double NOT NULL default '1',
1749 `alloc` double NOT NULL default '0',
1750 `tax_included` tinyint(1) NOT NULL default '0',
1751 `tax_algorihm` tinyint(1) NOT NULL default '1',
1752 PRIMARY KEY (`type`,`trans_no`),
1753 KEY `supplier_id` (`supplier_id`),
1754 KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
1755 KEY `type` (`type`),
1756 KEY `tran_date` (`tran_date`)
1760 -- Dumping data for table `0_supp_trans`
1764 -- --------------------------------------------------------
1767 -- Table structure for table `0_sys_prefs`
1770 DROP TABLE IF EXISTS `0_sys_prefs`;
1771 CREATE TABLE IF NOT EXISTS `0_sys_prefs` (
1772 `name` varchar(35) NOT NULL default '',
1773 `category` varchar(30) default NULL,
1774 `type` varchar(20) NOT NULL default '',
1775 `length` smallint(6) default NULL,
1777 PRIMARY KEY (`name`),
1778 KEY `category` (`category`)
1782 -- Dumping data for table `0_sys_prefs`
1785 INSERT INTO `0_sys_prefs` VALUES('coy_name', 'setup.company', 'varchar', 60, 'Company name');
1786 INSERT INTO `0_sys_prefs` VALUES('gst_no', 'setup.company', 'varchar', 25, '');
1787 INSERT INTO `0_sys_prefs` VALUES('coy_no', 'setup.company', 'varchar', 25, '');
1788 INSERT INTO `0_sys_prefs` VALUES('tax_prd', 'setup.company', 'int', 11, '1');
1789 INSERT INTO `0_sys_prefs` VALUES('tax_last', 'setup.company', 'int', 11, '1');
1790 INSERT INTO `0_sys_prefs` VALUES('postal_address', 'setup.company', 'tinytext', 0, 'N/A');
1791 INSERT INTO `0_sys_prefs` VALUES('phone', 'setup.company', 'varchar', 30, '');
1792 INSERT INTO `0_sys_prefs` VALUES('fax', 'setup.company', 'varchar', 30, '');
1793 INSERT INTO `0_sys_prefs` VALUES('email', 'setup.company', 'varchar', 100, '');
1794 INSERT INTO `0_sys_prefs` VALUES('coy_logo', 'setup.company', 'varchar', 100, '');
1795 INSERT INTO `0_sys_prefs` VALUES('domicile', 'setup.company', 'varchar', 55, '');
1796 INSERT INTO `0_sys_prefs` VALUES('curr_default', 'setup.company', 'char', 3, 'USD');
1797 INSERT INTO `0_sys_prefs` VALUES('use_dimension', 'setup.company', 'tinyint', 1, '1');
1798 INSERT INTO `0_sys_prefs` VALUES('f_year', 'setup.company', 'int', 11, '3');
1799 INSERT INTO `0_sys_prefs` VALUES('no_item_list', 'setup.company', 'tinyint', 1, '0');
1800 INSERT INTO `0_sys_prefs` VALUES('no_customer_list', 'setup.company', 'tinyint', 1, '0');
1801 INSERT INTO `0_sys_prefs` VALUES('no_supplier_list', 'setup.company', 'tinyint', 1, '0');
1802 INSERT INTO `0_sys_prefs` VALUES('base_sales', 'setup.company', 'int', 11, '1');
1803 INSERT INTO `0_sys_prefs` VALUES('time_zone', 'setup.company', 'tinyint', 1, '0');
1804 INSERT INTO `0_sys_prefs` VALUES('add_pct', 'setup.company', 'int', 5, '-1');
1805 INSERT INTO `0_sys_prefs` VALUES('round_to', 'setup.company', 'int', 5, '1');
1806 INSERT INTO `0_sys_prefs` VALUES('login_tout', 'setup.company', 'smallint', 6, '600');
1807 INSERT INTO `0_sys_prefs` VALUES('past_due_days', 'glsetup.general', 'int', 11, '30');
1808 INSERT INTO `0_sys_prefs` VALUES('profit_loss_year_act', 'glsetup.general', 'varchar', 15, '9990');
1809 INSERT INTO `0_sys_prefs` VALUES('retained_earnings_act', 'glsetup.general', 'varchar', 15, '3590');
1810 INSERT INTO `0_sys_prefs` VALUES('bank_charge_act', 'glsetup.general', 'varchar', 15, '5690');
1811 INSERT INTO `0_sys_prefs` VALUES('exchange_diff_act', 'glsetup.general', 'varchar', 15, '4450');
1812 INSERT INTO `0_sys_prefs` VALUES('tax_algorithm', 'glsetup.general', 'tinyint', 1, '1');
1813 INSERT INTO `0_sys_prefs` VALUES('default_credit_limit', 'glsetup.customer', 'int', 11, '1000');
1814 INSERT INTO `0_sys_prefs` VALUES('accumulate_shipping', 'glsetup.customer', 'tinyint', 1, '0');
1815 INSERT INTO `0_sys_prefs` VALUES('legal_text', 'glsetup.customer', 'tinytext', 0, '');
1816 INSERT INTO `0_sys_prefs` VALUES('freight_act', 'glsetup.customer', 'varchar', 15, '4430');
1817 INSERT INTO `0_sys_prefs` VALUES('debtors_act', 'glsetup.sales', 'varchar', 15, '1200');
1818 INSERT INTO `0_sys_prefs` VALUES('default_sales_act', 'glsetup.sales', 'varchar', 15, '4010');
1819 INSERT INTO `0_sys_prefs` VALUES('default_sales_discount_act', 'glsetup.sales', 'varchar', 15, '4510');
1820 INSERT INTO `0_sys_prefs` VALUES('default_prompt_payment_act', 'glsetup.sales', 'varchar', 15, '4500');
1821 INSERT INTO `0_sys_prefs` VALUES('default_delivery_required', 'glsetup.sales', 'smallint', 6, '1');
1822 INSERT INTO `0_sys_prefs` VALUES('default_receival_required', 'glsetup.purchase', 'smallint', 6, '10');
1823 INSERT INTO `0_sys_prefs` VALUES('default_dim_required', 'glsetup.dims', 'int', 11, '20');
1824 INSERT INTO `0_sys_prefs` VALUES('pyt_discount_act', 'glsetup.purchase', 'varchar', 15, '5060');
1825 INSERT INTO `0_sys_prefs` VALUES('creditors_act', 'glsetup.purchase', 'varchar', 15, '2100');
1826 INSERT INTO `0_sys_prefs` VALUES('po_over_receive', 'glsetup.purchase', 'int', 11, '10');
1827 INSERT INTO `0_sys_prefs` VALUES('po_over_charge', 'glsetup.purchase', 'int', 11, '10');
1828 INSERT INTO `0_sys_prefs` VALUES('allow_negative_stock', 'glsetup.inventory', 'tinyint', 1, '0');
1829 INSERT INTO `0_sys_prefs` VALUES('default_inventory_act', 'glsetup.items', 'varchar', 15, '1510');
1830 INSERT INTO `0_sys_prefs` VALUES('default_cogs_act', 'glsetup.items', 'varchar', 15, '5010');
1831 INSERT INTO `0_sys_prefs` VALUES('default_adj_act', 'glsetup.items', 'varchar', 15, '5040');
1832 INSERT INTO `0_sys_prefs` VALUES('default_inv_sales_act', 'glsetup.items', 'varchar', 15, '4010');
1833 INSERT INTO `0_sys_prefs` VALUES('default_assembly_act', 'glsetup.items', 'varchar', 15, '1530');
1834 INSERT INTO `0_sys_prefs` VALUES('default_workorder_required', 'glsetup.manuf', 'int', 11, '20');
1835 INSERT INTO `0_sys_prefs` VALUES('version_id', 'system', 'varchar', 11, '2.3rc');
1836 INSERT INTO `0_sys_prefs` VALUES('auto_curr_reval', 'setup.company', 'smallint', 6, '1');
1837 INSERT INTO `0_sys_prefs` VALUES('grn_clearing_act', 'glsetup.purchase', 'varchar', 15, '1550');
1839 -- --------------------------------------------------------
1842 -- Table structure for table `0_sys_types`
1845 DROP TABLE IF EXISTS `0_sys_types`;
1846 CREATE TABLE IF NOT EXISTS `0_sys_types` (
1847 `type_id` smallint(6) NOT NULL default '0',
1848 `type_no` int(11) NOT NULL default '1',
1849 `next_reference` varchar(100) NOT NULL default '',
1850 PRIMARY KEY (`type_id`)
1854 -- Dumping data for table `0_sys_types`
1857 INSERT INTO `0_sys_types` VALUES(0, 17, '1');
1858 INSERT INTO `0_sys_types` VALUES(1, 7, '1');
1859 INSERT INTO `0_sys_types` VALUES(2, 4, '1');
1860 INSERT INTO `0_sys_types` VALUES(4, 3, '1');
1861 INSERT INTO `0_sys_types` VALUES(10, 16, '1');
1862 INSERT INTO `0_sys_types` VALUES(11, 2, '1');
1863 INSERT INTO `0_sys_types` VALUES(12, 6, '1');
1864 INSERT INTO `0_sys_types` VALUES(13, 1, '1');
1865 INSERT INTO `0_sys_types` VALUES(16, 2, '1');
1866 INSERT INTO `0_sys_types` VALUES(17, 2, '1');
1867 INSERT INTO `0_sys_types` VALUES(18, 1, '1');
1868 INSERT INTO `0_sys_types` VALUES(20, 6, '1');
1869 INSERT INTO `0_sys_types` VALUES(21, 1, '1');
1870 INSERT INTO `0_sys_types` VALUES(22, 3, '1');
1871 INSERT INTO `0_sys_types` VALUES(25, 1, '1');
1872 INSERT INTO `0_sys_types` VALUES(26, 1, '1');
1873 INSERT INTO `0_sys_types` VALUES(28, 1, '1');
1874 INSERT INTO `0_sys_types` VALUES(29, 1, '1');
1875 INSERT INTO `0_sys_types` VALUES(30, 0, '1');
1876 INSERT INTO `0_sys_types` VALUES(32, 0, '1');
1877 INSERT INTO `0_sys_types` VALUES(35, 1, '1');
1878 INSERT INTO `0_sys_types` VALUES(40, 1, '1');
1880 -- --------------------------------------------------------
1883 -- Table structure for table `0_tags`
1886 DROP TABLE IF EXISTS `0_tags`;
1887 CREATE TABLE IF NOT EXISTS `0_tags` (
1888 `id` int(11) NOT NULL auto_increment,
1889 `type` smallint(6) NOT NULL,
1890 `name` varchar(30) NOT NULL,
1891 `description` varchar(60) default NULL,
1892 `inactive` tinyint(1) NOT NULL default '0',
1894 UNIQUE KEY `type` (`type`,`name`)
1895 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1898 -- Dumping data for table `0_tags`
1902 -- --------------------------------------------------------
1905 -- Table structure for table `0_tag_associations`
1908 DROP TABLE IF EXISTS `0_tag_associations`;
1909 CREATE TABLE IF NOT EXISTS `0_tag_associations` (
1910 `record_id` varchar(15) NOT NULL,
1911 `tag_id` int(11) NOT NULL,
1912 UNIQUE KEY `record_id` (`record_id`,`tag_id`)
1916 -- Dumping data for table `0_tag_associations`
1920 -- --------------------------------------------------------
1923 -- Table structure for table `0_tax_groups`
1926 DROP TABLE IF EXISTS `0_tax_groups`;
1927 CREATE TABLE IF NOT EXISTS `0_tax_groups` (
1928 `id` int(11) NOT NULL auto_increment,
1929 `name` varchar(60) NOT NULL default '',
1930 `inactive` tinyint(1) NOT NULL default '0',
1932 UNIQUE KEY `name` (`name`)
1933 ) ENGINE=InnoDB AUTO_INCREMENT=3 ;
1936 -- Dumping data for table `0_tax_groups`
1939 INSERT INTO `0_tax_groups` VALUES(1, 'Tax', 0);
1940 INSERT INTO `0_tax_groups` VALUES(2, 'Tax Exempt', 0);
1942 -- --------------------------------------------------------
1945 -- Table structure for table `0_tax_group_items`
1948 DROP TABLE IF EXISTS `0_tax_group_items`;
1949 CREATE TABLE IF NOT EXISTS `0_tax_group_items` (
1950 `tax_group_id` int(11) NOT NULL default '0',
1951 `tax_type_id` int(11) NOT NULL default '0',
1952 `tax_shipping` tinyint(1) NOT NULL default '0',
1953 PRIMARY KEY (`tax_group_id`,`tax_type_id`)
1957 -- Dumping data for table `0_tax_group_items`
1960 INSERT INTO `0_tax_group_items` VALUES(1, 1, 5, 1);
1962 -- --------------------------------------------------------
1965 -- Table structure for table `0_tax_types`
1968 DROP TABLE IF EXISTS `0_tax_types`;
1969 CREATE TABLE IF NOT EXISTS `0_tax_types` (
1970 `id` int(11) NOT NULL auto_increment,
1971 `rate` double NOT NULL default '0',
1972 `sales_gl_code` varchar(15) NOT NULL default '',
1973 `purchasing_gl_code` varchar(15) NOT NULL default '',
1974 `name` varchar(60) NOT NULL default '',
1975 `inactive` tinyint(1) NOT NULL default '0',
1977 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
1980 -- Dumping data for table `0_tax_types`
1983 INSERT INTO `0_tax_types` VALUES(1, 5, '2150', '2150', 'Tax', 0);
1985 -- --------------------------------------------------------
1988 -- Table structure for table `0_trans_tax_details`
1991 DROP TABLE IF EXISTS `0_trans_tax_details`;
1992 CREATE TABLE IF NOT EXISTS `0_trans_tax_details` (
1993 `id` int(11) NOT NULL auto_increment,
1994 `trans_type` smallint(6) default NULL,
1995 `trans_no` int(11) default NULL,
1996 `tran_date` date NOT NULL,
1997 `tax_type_id` int(11) NOT NULL default '0',
1998 `rate` double NOT NULL default '0',
1999 `ex_rate` double NOT NULL default '1',
2000 `included_in_price` tinyint(1) NOT NULL default '0',
2001 `net_amount` double NOT NULL default '0',
2002 `amount` double NOT NULL default '0',
2005 KEY `Type_and_Number` (`trans_type`,`trans_no`),
2006 KEY `tran_date` (`tran_date`)
2007 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2010 -- Dumping data for table `0_trans_tax_details`
2014 -- --------------------------------------------------------
2017 -- Table structure for table `0_useronline`
2020 DROP TABLE IF EXISTS `0_useronline`;
2021 CREATE TABLE IF NOT EXISTS `0_useronline` (
2022 `id` int(11) NOT NULL auto_increment,
2023 `timestamp` int(15) NOT NULL default '0',
2024 `ip` varchar(40) NOT NULL default '',
2025 `file` varchar(100) NOT NULL default '',
2027 KEY `timestamp` (`timestamp`),
2029 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2032 -- Dumping data for table `0_useronline`
2036 -- --------------------------------------------------------
2039 -- Table structure for table `0_users`
2042 DROP TABLE IF EXISTS `0_users`;
2043 CREATE TABLE IF NOT EXISTS `0_users` (
2044 `id` smallint(6) NOT NULL auto_increment,
2045 `user_id` varchar(60) NOT NULL default '',
2046 `password` varchar(100) NOT NULL default '',
2047 `real_name` varchar(100) NOT NULL default '',
2048 `role_id` int(11) NOT NULL default '1',
2049 `phone` varchar(30) NOT NULL default '',
2050 `email` varchar(100) default NULL,
2051 `language` varchar(20) default NULL,
2052 `date_format` tinyint(1) NOT NULL default '0',
2053 `date_sep` tinyint(1) NOT NULL default '0',
2054 `tho_sep` tinyint(1) NOT NULL default '0',
2055 `dec_sep` tinyint(1) NOT NULL default '0',
2056 `theme` varchar(20) NOT NULL default 'default',
2057 `page_size` varchar(20) NOT NULL default 'A4',
2058 `prices_dec` smallint(6) NOT NULL default '2',
2059 `qty_dec` smallint(6) NOT NULL default '2',
2060 `rates_dec` smallint(6) NOT NULL default '4',
2061 `percent_dec` smallint(6) NOT NULL default '1',
2062 `show_gl` tinyint(1) NOT NULL default '1',
2063 `show_codes` tinyint(1) NOT NULL default '0',
2064 `show_hints` tinyint(1) NOT NULL default '0',
2065 `last_visit_date` datetime default NULL,
2066 `query_size` tinyint(1) default '10',
2067 `graphic_links` tinyint(1) default '1',
2068 `pos` smallint(6) default '1',
2069 `print_profile` varchar(30) NOT NULL default '1',
2070 `rep_popup` tinyint(1) default '1',
2071 `sticky_doc_date` tinyint(1) default '0',
2072 `startup_tab` varchar(20) NOT NULL default '',
2073 `transaction_days` smallint(6) NOT NULL default '0',
2074 `inactive` tinyint(1) NOT NULL default '0',
2076 UNIQUE KEY `user_id` (`user_id`)
2077 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
2080 -- Dumping data for table `0_users`
2083 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', 0);
2085 -- --------------------------------------------------------
2088 -- Table structure for table `0_voided`
2091 DROP TABLE IF EXISTS `0_voided`;
2092 CREATE TABLE IF NOT EXISTS `0_voided` (
2093 `type` int(11) NOT NULL default '0',
2094 `id` int(11) NOT NULL default '0',
2095 `date_` date NOT NULL default '0000-00-00',
2096 `memo_` tinytext NOT NULL,
2097 UNIQUE KEY `id` (`type`,`id`)
2101 -- Dumping data for table `0_voided`
2105 -- --------------------------------------------------------
2108 -- Table structure for table `0_workcentres`
2111 DROP TABLE IF EXISTS `0_workcentres`;
2112 CREATE TABLE IF NOT EXISTS `0_workcentres` (
2113 `id` int(11) NOT NULL auto_increment,
2114 `name` char(40) NOT NULL default '',
2115 `description` char(50) NOT NULL default '',
2116 `inactive` tinyint(1) NOT NULL default '0',
2118 UNIQUE KEY `name` (`name`)
2119 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2122 -- Dumping data for table `0_workcentres`
2126 -- --------------------------------------------------------
2129 -- Table structure for table `0_workorders`
2132 DROP TABLE IF EXISTS `0_workorders`;
2133 CREATE TABLE IF NOT EXISTS `0_workorders` (
2134 `id` int(11) NOT NULL auto_increment,
2135 `wo_ref` varchar(60) NOT NULL default '',
2136 `loc_code` varchar(5) NOT NULL default '',
2137 `units_reqd` double NOT NULL default '1',
2138 `stock_id` varchar(20) NOT NULL default '',
2139 `date_` date NOT NULL default '0000-00-00',
2140 `type` tinyint(4) NOT NULL default '0',
2141 `required_by` date NOT NULL default '0000-00-00',
2142 `released_date` date NOT NULL default '0000-00-00',
2143 `units_issued` double NOT NULL default '0',
2144 `closed` tinyint(1) NOT NULL default '0',
2145 `released` tinyint(1) NOT NULL default '0',
2146 `additional_costs` double NOT NULL default '0',
2148 UNIQUE KEY `wo_ref` (`wo_ref`)
2149 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2152 -- Dumping data for table `0_workorders`
2156 -- --------------------------------------------------------
2159 -- Table structure for table `0_wo_issues`
2162 DROP TABLE IF EXISTS `0_wo_issues`;
2163 CREATE TABLE IF NOT EXISTS `0_wo_issues` (
2164 `issue_no` int(11) NOT NULL auto_increment,
2165 `workorder_id` int(11) NOT NULL default '0',
2166 `reference` varchar(100) default NULL,
2167 `issue_date` date default NULL,
2168 `loc_code` varchar(5) default NULL,
2169 `workcentre_id` int(11) default NULL,
2170 PRIMARY KEY (`issue_no`),
2171 KEY `workorder_id` (`workorder_id`)
2172 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2175 -- Dumping data for table `0_wo_issues`
2179 -- --------------------------------------------------------
2182 -- Table structure for table `0_wo_issue_items`
2185 DROP TABLE IF EXISTS `0_wo_issue_items`;
2186 CREATE TABLE IF NOT EXISTS `0_wo_issue_items` (
2187 `id` int(11) NOT NULL auto_increment,
2188 `stock_id` varchar(40) default NULL,
2189 `issue_id` int(11) default NULL,
2190 `qty_issued` double default NULL,
2192 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2195 -- Dumping data for table `0_wo_issue_items`
2199 -- --------------------------------------------------------
2202 -- Table structure for table `0_wo_manufacture`
2205 DROP TABLE IF EXISTS `0_wo_manufacture`;
2206 CREATE TABLE IF NOT EXISTS `0_wo_manufacture` (
2207 `id` int(11) NOT NULL auto_increment,
2208 `reference` varchar(100) default NULL,
2209 `workorder_id` int(11) NOT NULL default '0',
2210 `quantity` double NOT NULL default '0',
2211 `date_` date NOT NULL default '0000-00-00',
2213 KEY `workorder_id` (`workorder_id`)
2214 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2217 -- Dumping data for table `0_wo_manufacture`
2221 -- --------------------------------------------------------
2224 -- Table structure for table `0_wo_requirements`
2227 DROP TABLE IF EXISTS `0_wo_requirements`;
2228 CREATE TABLE IF NOT EXISTS `0_wo_requirements` (
2229 `id` int(11) NOT NULL auto_increment,
2230 `workorder_id` int(11) NOT NULL default '0',
2231 `stock_id` char(20) NOT NULL default '',
2232 `workcentre` int(11) NOT NULL default '0',
2233 `units_req` double NOT NULL default '1',
2234 `std_cost` double NOT NULL default '0',
2235 `loc_code` char(5) NOT NULL default '',
2236 `units_issued` double NOT NULL default '0',
2238 KEY `workorder_id` (`workorder_id`)
2239 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2242 -- Dumping data for table `0_wo_requirements`