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 `last_reconciled_date` timestamp NOT NULL default '0000-00-00 00:00:00',
106 `ending_reconcile_balance` double NOT NULL default '0',
107 `inactive` tinyint(1) NOT NULL default '0',
109 KEY `bank_account_name` (`bank_account_name`),
110 KEY `bank_account_number` (`bank_account_number`),
111 KEY `account_code` (`account_code`)
112 ) ENGINE=MyISAM AUTO_INCREMENT=3 ;
115 -- Dumping data for table `0_bank_accounts`
118 INSERT INTO `0_bank_accounts` VALUES('1060', 0, 'Current account', 'N/A', 'N/A', '', 'USD', 1, 1, '0000-00-00 00:00:00', 0, 0);
119 INSERT INTO `0_bank_accounts` VALUES('1065', 3, 'Petty Cash account', 'N/A', 'N/A', '', 'USD', 0, 2, '0000-00-00 00:00:00', 0, 0);
121 -- --------------------------------------------------------
124 -- Table structure for table `0_bank_trans`
127 DROP TABLE IF EXISTS `0_bank_trans`;
128 CREATE TABLE IF NOT EXISTS `0_bank_trans` (
129 `id` int(11) NOT NULL auto_increment,
130 `type` smallint(6) default NULL,
131 `trans_no` int(11) default NULL,
132 `bank_act` varchar(15) NOT NULL default '',
133 `ref` varchar(40) default NULL,
134 `trans_date` date NOT NULL default '0000-00-00',
135 `amount` double default NULL,
136 `dimension_id` int(11) NOT NULL default '0',
137 `dimension2_id` int(11) NOT NULL default '0',
138 `person_type_id` int(11) NOT NULL default '0',
139 `person_id` tinyblob,
140 `reconciled` date default NULL,
142 KEY `bank_act` (`bank_act`,`ref`),
143 KEY `type` (`type`,`trans_no`),
144 KEY `bank_act_2` (`bank_act`,`reconciled`),
145 KEY `bank_act_3` (`bank_act`,`trans_date`)
146 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
149 -- Dumping data for table `0_bank_trans`
153 -- --------------------------------------------------------
156 -- Table structure for table `0_bom`
159 DROP TABLE IF EXISTS `0_bom`;
160 CREATE TABLE IF NOT EXISTS `0_bom` (
161 `id` int(11) NOT NULL auto_increment,
162 `parent` char(20) NOT NULL default '',
163 `component` char(20) NOT NULL default '',
164 `workcentre_added` int(11) NOT NULL default '0',
165 `loc_code` char(5) NOT NULL default '',
166 `quantity` double NOT NULL default '1',
167 PRIMARY KEY (`parent`,`component`,`workcentre_added`,`loc_code`),
168 KEY `component` (`component`),
170 KEY `loc_code` (`loc_code`),
171 KEY `parent` (`parent`,`loc_code`),
172 KEY `workcentre_added` (`workcentre_added`)
173 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
176 -- Dumping data for table `0_bom`
180 -- --------------------------------------------------------
183 -- Table structure for table `0_budget_trans`
186 DROP TABLE IF EXISTS `0_budget_trans`;
187 CREATE TABLE IF NOT EXISTS `0_budget_trans` (
188 `counter` int(11) NOT NULL auto_increment,
189 `type` smallint(6) NOT NULL default '0',
190 `type_no` bigint(16) NOT NULL default '1',
191 `tran_date` date NOT NULL default '0000-00-00',
192 `account` varchar(15) NOT NULL default '',
193 `memo_` tinytext NOT NULL,
194 `amount` double NOT NULL default '0',
195 `dimension_id` int(11) default '0',
196 `dimension2_id` int(11) default '0',
197 `person_type_id` int(11) default NULL,
198 `person_id` tinyblob,
199 PRIMARY KEY (`counter`),
200 KEY `Type_and_Number` (`type`,`type_no`),
201 KEY `Account` (`account`,`tran_date`,`dimension_id`,`dimension2_id`)
202 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
205 -- Dumping data for table `0_budget_trans`
209 -- --------------------------------------------------------
212 -- Table structure for table `0_chart_class`
215 DROP TABLE IF EXISTS `0_chart_class`;
216 CREATE TABLE IF NOT EXISTS `0_chart_class` (
217 `cid` varchar(3) NOT NULL,
218 `class_name` varchar(60) NOT NULL default '',
219 `ctype` tinyint(1) NOT NULL default '0',
220 `inactive` tinyint(1) NOT NULL default '0',
225 -- Dumping data for table `0_chart_class`
228 INSERT INTO `0_chart_class` VALUES('1', 'Assets', 1, 0);
229 INSERT INTO `0_chart_class` VALUES('2', 'Liabilities', 2, 0);
230 INSERT INTO `0_chart_class` VALUES('3', 'Income', 4, 0);
231 INSERT INTO `0_chart_class` VALUES('4', 'Costs', 6, 0);
233 -- --------------------------------------------------------
236 -- Table structure for table `0_chart_master`
239 DROP TABLE IF EXISTS `0_chart_master`;
240 CREATE TABLE IF NOT EXISTS `0_chart_master` (
241 `account_code` varchar(15) NOT NULL default '',
242 `account_code2` varchar(15) NOT NULL default '',
243 `account_name` varchar(60) NOT NULL default '',
244 `account_type` varchar(10) NOT NULL default '0',
245 `inactive` tinyint(1) NOT NULL default '0',
246 PRIMARY KEY (`account_code`),
247 KEY `account_name` (`account_name`),
248 KEY `accounts_by_type` (`account_type`,`account_code`)
252 -- Dumping data for table `0_chart_master`
255 INSERT INTO `0_chart_master` VALUES('1060', '', 'Checking Account', '1', 0);
256 INSERT INTO `0_chart_master` VALUES('1065', '', 'Petty Cash', '1', 0);
257 INSERT INTO `0_chart_master` VALUES('1200', '', 'Accounts Receivables', '1', 0);
258 INSERT INTO `0_chart_master` VALUES('1205', '', 'Allowance for doubtful accounts', '1', 0);
259 INSERT INTO `0_chart_master` VALUES('1510', '', 'Inventory', '2', 0);
260 INSERT INTO `0_chart_master` VALUES('1520', '', 'Stocks of Raw Materials', '2', 0);
261 INSERT INTO `0_chart_master` VALUES('1530', '', 'Stocks of Work In Progress', '2', 0);
262 INSERT INTO `0_chart_master` VALUES('1540', '', 'Stocks of Finsihed Goods', '2', 0);
263 INSERT INTO `0_chart_master` VALUES('1550', '', 'Goods Received Clearing account', '2', 0);
264 INSERT INTO `0_chart_master` VALUES('1820', '', 'Office Furniture & Equipment', '3', 0);
265 INSERT INTO `0_chart_master` VALUES('1825', '', 'Accum. Amort. -Furn. & Equip.', '3', 0);
266 INSERT INTO `0_chart_master` VALUES('1840', '', 'Vehicle', '3', 0);
267 INSERT INTO `0_chart_master` VALUES('1845', '', 'Accum. Amort. -Vehicle', '3', 0);
268 INSERT INTO `0_chart_master` VALUES('2100', '', 'Accounts Payable', '4', 0);
269 INSERT INTO `0_chart_master` VALUES('2110', '', 'Accrued Income Tax - Federal', '4', 0);
270 INSERT INTO `0_chart_master` VALUES('2120', '', 'Accrued Income Tax - State', '4', 0);
271 INSERT INTO `0_chart_master` VALUES('2130', '', 'Accrued Franchise Tax', '4', 0);
272 INSERT INTO `0_chart_master` VALUES('2140', '', 'Accrued Real & Personal Prop Tax', '4', 0);
273 INSERT INTO `0_chart_master` VALUES('2150', '', 'Sales Tax', '4', 0);
274 INSERT INTO `0_chart_master` VALUES('2160', '', 'Accrued Use Tax Payable', '4', 0);
275 INSERT INTO `0_chart_master` VALUES('2210', '', 'Accrued Wages', '4', 0);
276 INSERT INTO `0_chart_master` VALUES('2220', '', 'Accrued Comp Time', '4', 0);
277 INSERT INTO `0_chart_master` VALUES('2230', '', 'Accrued Holiday Pay', '4', 0);
278 INSERT INTO `0_chart_master` VALUES('2240', '', 'Accrued Vacation Pay', '4', 0);
279 INSERT INTO `0_chart_master` VALUES('2310', '', 'Accr. Benefits - 401K', '4', 0);
280 INSERT INTO `0_chart_master` VALUES('2320', '', 'Accr. Benefits - Stock Purchase', '4', 0);
281 INSERT INTO `0_chart_master` VALUES('2330', '', 'Accr. Benefits - Med, Den', '4', 0);
282 INSERT INTO `0_chart_master` VALUES('2340', '', 'Accr. Benefits - Payroll Taxes', '4', 0);
283 INSERT INTO `0_chart_master` VALUES('2350', '', 'Accr. Benefits - Credit Union', '4', 0);
284 INSERT INTO `0_chart_master` VALUES('2360', '', 'Accr. Benefits - Savings Bond', '4', 0);
285 INSERT INTO `0_chart_master` VALUES('2370', '', 'Accr. Benefits - Garnish', '4', 0);
286 INSERT INTO `0_chart_master` VALUES('2380', '', 'Accr. Benefits - Charity Cont.', '4', 0);
287 INSERT INTO `0_chart_master` VALUES('2620', '', 'Bank Loans', '5', 0);
288 INSERT INTO `0_chart_master` VALUES('2680', '', 'Loans from Shareholders', '5', 0);
289 INSERT INTO `0_chart_master` VALUES('3350', '', 'Common Shares', '6', 0);
290 INSERT INTO `0_chart_master` VALUES('3590', '', 'Retained Earnings - prior years', '7', 0);
291 INSERT INTO `0_chart_master` VALUES('4010', '', 'Sales', '8', 0);
292 INSERT INTO `0_chart_master` VALUES('4430', '', 'Shipping & Handling', '9', 0);
293 INSERT INTO `0_chart_master` VALUES('4440', '', 'Interest', '9', 0);
294 INSERT INTO `0_chart_master` VALUES('4450', '', 'Foreign Exchange Gain', '9', 0);
295 INSERT INTO `0_chart_master` VALUES('4500', '', 'Prompt Payment Discounts', '9', 0);
296 INSERT INTO `0_chart_master` VALUES('4510', '', 'Discounts Given', '9', 0);
297 INSERT INTO `0_chart_master` VALUES('5010', '', 'Cost of Goods Sold - Retail', '10', 0);
298 INSERT INTO `0_chart_master` VALUES('5020', '', 'Material Usage Varaiance', '10', 0);
299 INSERT INTO `0_chart_master` VALUES('5030', '', 'Consumable Materials', '10', 0);
300 INSERT INTO `0_chart_master` VALUES('5040', '', 'Purchase price Variance', '10', 0);
301 INSERT INTO `0_chart_master` VALUES('5050', '', 'Purchases of materials', '10', 0);
302 INSERT INTO `0_chart_master` VALUES('5060', '', 'Discounts Received', '10', 0);
303 INSERT INTO `0_chart_master` VALUES('5100', '', 'Freight', '10', 0);
304 INSERT INTO `0_chart_master` VALUES('5410', '', 'Wages & Salaries', '11', 0);
305 INSERT INTO `0_chart_master` VALUES('5420', '', 'Wages - Overtime', '11', 0);
306 INSERT INTO `0_chart_master` VALUES('5430', '', 'Benefits - Comp Time', '11', 0);
307 INSERT INTO `0_chart_master` VALUES('5440', '', 'Benefits - Payroll Taxes', '11', 0);
308 INSERT INTO `0_chart_master` VALUES('5450', '', 'Benefits - Workers Comp', '11', 0);
309 INSERT INTO `0_chart_master` VALUES('5460', '', 'Benefits - Pension', '11', 0);
310 INSERT INTO `0_chart_master` VALUES('5470', '', 'Benefits - General Benefits', '11', 0);
311 INSERT INTO `0_chart_master` VALUES('5510', '', 'Inc Tax Exp - Federal', '11', 0);
312 INSERT INTO `0_chart_master` VALUES('5520', '', 'Inc Tax Exp - State', '11', 0);
313 INSERT INTO `0_chart_master` VALUES('5530', '', 'Taxes - Real Estate', '11', 0);
314 INSERT INTO `0_chart_master` VALUES('5540', '', 'Taxes - Personal Property', '11', 0);
315 INSERT INTO `0_chart_master` VALUES('5550', '', 'Taxes - Franchise', '11', 0);
316 INSERT INTO `0_chart_master` VALUES('5560', '', 'Taxes - Foreign Withholding', '11', 0);
317 INSERT INTO `0_chart_master` VALUES('5610', '', 'Accounting & Legal', '12', 0);
318 INSERT INTO `0_chart_master` VALUES('5615', '', 'Advertising & Promotions', '12', 0);
319 INSERT INTO `0_chart_master` VALUES('5620', '', 'Bad Debts', '12', 0);
320 INSERT INTO `0_chart_master` VALUES('5660', '', 'Amortization Expense', '12', 0);
321 INSERT INTO `0_chart_master` VALUES('5685', '', 'Insurance', '12', 0);
322 INSERT INTO `0_chart_master` VALUES('5690', '', 'Interest & Bank Charges', '12', 0);
323 INSERT INTO `0_chart_master` VALUES('5700', '', 'Office Supplies', '12', 0);
324 INSERT INTO `0_chart_master` VALUES('5760', '', 'Rent', '12', 0);
325 INSERT INTO `0_chart_master` VALUES('5765', '', 'Repair & Maintenance', '12', 0);
326 INSERT INTO `0_chart_master` VALUES('5780', '', 'Telephone', '12', 0);
327 INSERT INTO `0_chart_master` VALUES('5785', '', 'Travel & Entertainment', '12', 0);
328 INSERT INTO `0_chart_master` VALUES('5790', '', 'Utilities', '12', 0);
329 INSERT INTO `0_chart_master` VALUES('5795', '', 'Registrations', '12', 0);
330 INSERT INTO `0_chart_master` VALUES('5800', '', 'Licenses', '12', 0);
331 INSERT INTO `0_chart_master` VALUES('5810', '', 'Foreign Exchange Loss', '12', 0);
332 INSERT INTO `0_chart_master` VALUES('9990', '', 'Year Profit/Loss', '12', 0);
334 -- --------------------------------------------------------
337 -- Table structure for table `0_chart_types`
340 DROP TABLE IF EXISTS `0_chart_types`;
341 CREATE TABLE IF NOT EXISTS `0_chart_types` (
342 `id` varchar(10) NOT NULL,
343 `name` varchar(60) NOT NULL default '',
344 `class_id` varchar(3) NOT NULL default '',
345 `parent` varchar(10) NOT NULL default '-1',
346 `inactive` tinyint(1) NOT NULL default '0',
349 KEY `class_id` (`class_id`)
353 -- Dumping data for table `0_chart_types`
356 INSERT INTO `0_chart_types` VALUES('1', 'Current Assets', '1', '', 0);
357 INSERT INTO `0_chart_types` VALUES('2', 'Inventory Assets', '1', '', 0);
358 INSERT INTO `0_chart_types` VALUES('3', 'Capital Assets', '1', '', 0);
359 INSERT INTO `0_chart_types` VALUES('4', 'Current Liabilities', '2', '', 0);
360 INSERT INTO `0_chart_types` VALUES('5', 'Long Term Liabilities', '2', '', 0);
361 INSERT INTO `0_chart_types` VALUES('6', 'Share Capital', '2', '', 0);
362 INSERT INTO `0_chart_types` VALUES('7', 'Retained Earnings', '2', '', 0);
363 INSERT INTO `0_chart_types` VALUES('8', 'Sales Revenue', '3', '', 0);
364 INSERT INTO `0_chart_types` VALUES('9', 'Other Revenue', '3', '', 0);
365 INSERT INTO `0_chart_types` VALUES('10', 'Cost of Goods Sold', '4', '', 0);
366 INSERT INTO `0_chart_types` VALUES('11', 'Payroll Expenses', '4', '', 0);
367 INSERT INTO `0_chart_types` VALUES('12', 'General & Administrative expenses', '4', '', 0);
369 -- --------------------------------------------------------
372 -- Table structure for table `0_comments`
375 DROP TABLE IF EXISTS `0_comments`;
376 CREATE TABLE IF NOT EXISTS `0_comments` (
377 `type` int(11) NOT NULL default '0',
378 `id` int(11) NOT NULL default '0',
379 `date_` date default '0000-00-00',
381 KEY `type_and_id` (`type`,`id`)
385 -- Dumping data for table `0_comments`
389 -- --------------------------------------------------------
392 -- Table structure for table `0_credit_status`
395 DROP TABLE IF EXISTS `0_credit_status`;
396 CREATE TABLE IF NOT EXISTS `0_credit_status` (
397 `id` int(11) NOT NULL auto_increment,
398 `reason_description` char(100) NOT NULL default '',
399 `dissallow_invoices` tinyint(1) NOT NULL default '0',
400 `inactive` tinyint(1) NOT NULL default '0',
402 UNIQUE KEY `reason_description` (`reason_description`)
403 ) ENGINE=MyISAM AUTO_INCREMENT=5 ;
406 -- Dumping data for table `0_credit_status`
409 INSERT INTO `0_credit_status` VALUES(1, 'Good History', 0, 0);
410 INSERT INTO `0_credit_status` VALUES(3, 'No more work until payment received', 1, 0);
411 INSERT INTO `0_credit_status` VALUES(4, 'In liquidation', 1, 0);
413 -- --------------------------------------------------------
416 -- Table structure for table `0_crm_categories`
419 DROP TABLE IF EXISTS `0_crm_categories`;
420 CREATE TABLE IF NOT EXISTS `0_crm_categories` (
421 `id` int(11) NOT NULL auto_increment COMMENT 'pure technical key',
422 `type` varchar(20) NOT NULL COMMENT 'contact type e.g. customer',
423 `action` varchar(20) NOT NULL COMMENT 'detailed usage e.g. department',
424 `name` varchar(30) NOT NULL COMMENT 'for category selector',
425 `description` tinytext NOT NULL COMMENT 'usage description',
426 `system` tinyint(1) NOT NULL default '0' COMMENT 'nonzero for core system usage',
427 `inactive` tinyint(1) NOT NULL default '0',
429 UNIQUE KEY `type` (`type`,`action`),
430 UNIQUE KEY `type_2` (`type`,`name`)
431 ) ENGINE=InnoDB AUTO_INCREMENT=13 ;
434 -- Dumping data for table `0_crm_categories`
437 INSERT INTO `0_crm_categories` VALUES(1, 'cust_branch', 'general', 'General', 'General contact data for customer branch (overrides company setting)', 1, 0);
438 INSERT INTO `0_crm_categories` VALUES(2, 'cust_branch', 'invoice', 'Invoices', 'Invoice posting (overrides company setting)', 1, 0);
439 INSERT INTO `0_crm_categories` VALUES(3, 'cust_branch', 'order', 'Orders', 'Order confirmation (overrides company setting)', 1, 0);
440 INSERT INTO `0_crm_categories` VALUES(4, 'cust_branch', 'delivery', 'Deliveries', 'Delivery coordination (overrides company setting)', 1, 0);
441 INSERT INTO `0_crm_categories` VALUES(5, 'customer', 'general', 'General', 'General contact data for customer', 1, 0);
442 INSERT INTO `0_crm_categories` VALUES(6, 'customer', 'order', 'Orders', 'Order confirmation', 1, 0);
443 INSERT INTO `0_crm_categories` VALUES(7, 'customer', 'delivery', 'Deliveries', 'Delivery coordination', 1, 0);
444 INSERT INTO `0_crm_categories` VALUES(8, 'customer', 'invoice', 'Invoices', 'Invoice posting', 1, 0);
445 INSERT INTO `0_crm_categories` VALUES(9, 'supplier', 'general', 'General', 'General contact data for supplier', 1, 0);
446 INSERT INTO `0_crm_categories` VALUES(10, 'supplier', 'order', 'Orders', 'Order confirmation', 1, 0);
447 INSERT INTO `0_crm_categories` VALUES(11, 'supplier', 'delivery', 'Deliveries', 'Delivery coordination', 1, 0);
448 INSERT INTO `0_crm_categories` VALUES(12, 'supplier', 'invoice', 'Invoices', 'Invoice posting', 1, 0);
450 -- --------------------------------------------------------
453 -- Table structure for table `0_crm_contacts`
456 DROP TABLE IF EXISTS `0_crm_contacts`;
457 CREATE TABLE IF NOT EXISTS `0_crm_contacts` (
458 `id` int(11) NOT NULL auto_increment,
459 `person_id` int(11) NOT NULL default '0' COMMENT 'foreign key to crm_contacts',
460 `type` varchar(20) NOT NULL COMMENT 'foreign key to crm_categories',
461 `action` varchar(20) NOT NULL COMMENT 'foreign key to crm_categories',
462 `entity_id` varchar(11) default NULL COMMENT 'entity id in related class table',
464 KEY `type` (`type`,`action`)
465 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
468 -- Dumping data for table `0_crm_contacts`
471 -- --------------------------------------------------------
474 -- Table structure for table `0_crm_persons`
477 DROP TABLE IF EXISTS `0_crm_persons`;
478 CREATE TABLE IF NOT EXISTS `0_crm_persons` (
479 `id` int(11) NOT NULL auto_increment,
480 `ref` varchar(30) NOT NULL,
481 `name` varchar(60) NOT NULL,
482 `name2` varchar(60) default NULL,
484 `phone` varchar(30) default NULL,
485 `phone2` varchar(30) default NULL,
486 `fax` varchar(30) default NULL,
487 `email` varchar(100) default NULL,
488 `lang` char(5) default NULL,
489 `notes` tinytext NOT NULL,
490 `inactive` tinyint(1) NOT NULL default '0',
493 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
496 -- Dumping data for table `0_crm_persons`
500 -- --------------------------------------------------------
503 -- Table structure for table `0_currencies`
506 DROP TABLE IF EXISTS `0_currencies`;
507 CREATE TABLE IF NOT EXISTS `0_currencies` (
508 `currency` varchar(60) NOT NULL default '',
509 `curr_abrev` char(3) NOT NULL default '',
510 `curr_symbol` varchar(10) NOT NULL default '',
511 `country` varchar(100) NOT NULL default '',
512 `hundreds_name` varchar(15) NOT NULL default '',
513 `auto_update` tinyint(1) NOT NULL default '1',
514 `inactive` tinyint(1) NOT NULL default '0',
515 PRIMARY KEY (`curr_abrev`)
519 -- Dumping data for table `0_currencies`
522 INSERT INTO `0_currencies` VALUES('US Dollars', 'USD', '$', 'United States', 'Cents', 1, 0);
523 INSERT INTO `0_currencies` VALUES('CA Dollars', 'CAD', '$', 'Canada', 'Cents', 1, 0);
524 INSERT INTO `0_currencies` VALUES('Euro', 'EUR', '?', 'Europe', 'Cents', 1, 0);
525 INSERT INTO `0_currencies` VALUES('Pounds', 'GBP', '?', 'England', 'Pence', 1, 0);
527 -- --------------------------------------------------------
530 -- Table structure for table `0_cust_allocations`
533 DROP TABLE IF EXISTS `0_cust_allocations`;
534 CREATE TABLE IF NOT EXISTS `0_cust_allocations` (
535 `id` int(11) NOT NULL auto_increment,
536 `amt` double unsigned default NULL,
537 `date_alloc` date NOT NULL default '0000-00-00',
538 `trans_no_from` int(11) default NULL,
539 `trans_type_from` int(11) default NULL,
540 `trans_no_to` int(11) default NULL,
541 `trans_type_to` int(11) default NULL,
543 KEY `From` (`trans_type_from`,`trans_no_from`),
544 KEY `To` (`trans_type_to`,`trans_no_to`)
545 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
548 -- Dumping data for table `0_cust_allocations`
552 -- --------------------------------------------------------
555 -- Table structure for table `0_cust_branch`
558 DROP TABLE IF EXISTS `0_cust_branch`;
559 CREATE TABLE IF NOT EXISTS `0_cust_branch` (
560 `branch_code` int(11) NOT NULL auto_increment,
561 `debtor_no` int(11) NOT NULL default '0',
562 `br_name` varchar(60) NOT NULL default '',
563 `branch_ref` varchar(30) NOT NULL default '',
564 `br_address` tinytext NOT NULL,
565 `area` int(11) default NULL,
566 `salesman` int(11) NOT NULL default '0',
567 `contact_name` varchar(60) NOT NULL default '',
568 `default_location` varchar(5) NOT NULL default '',
569 `tax_group_id` int(11) default NULL,
570 `sales_account` varchar(15) NOT NULL default '',
571 `sales_discount_account` varchar(15) NOT NULL default '',
572 `receivables_account` varchar(15) NOT NULL default '',
573 `payment_discount_account` varchar(15) NOT NULL default '',
574 `default_ship_via` int(11) NOT NULL default '1',
575 `disable_trans` tinyint(4) NOT NULL default '0',
576 `br_post_address` tinytext NOT NULL,
577 `group_no` int(11) NOT NULL default '0',
578 `notes` tinytext NOT NULL,
579 `bank_account` varchar(60) DEFAULT NULL,
580 `inactive` tinyint(1) NOT NULL default '0',
581 PRIMARY KEY (`branch_code`,`debtor_no`),
582 KEY `branch_code` (`branch_code`),
583 KEY `branch_ref` (`branch_ref`),
584 KEY `group_no` (`group_no`)
585 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
588 -- Dumping data for table `0_cust_branch`
592 -- --------------------------------------------------------
595 -- Table structure for table `0_debtors_master`
598 DROP TABLE IF EXISTS `0_debtors_master`;
599 CREATE TABLE IF NOT EXISTS `0_debtors_master` (
600 `debtor_no` int(11) NOT NULL auto_increment,
601 `name` varchar(100) NOT NULL default '',
602 `debtor_ref` varchar(30) NOT NULL,
604 `tax_id` varchar(55) NOT NULL default '',
605 `curr_code` char(3) NOT NULL default '',
606 `sales_type` int(11) NOT NULL default '1',
607 `dimension_id` int(11) NOT NULL default '0',
608 `dimension2_id` int(11) NOT NULL default '0',
609 `credit_status` int(11) NOT NULL default '0',
610 `payment_terms` int(11) default NULL,
611 `discount` double NOT NULL default '0',
612 `pymt_discount` double NOT NULL default '0',
613 `credit_limit` float NOT NULL default '1000',
614 `notes` tinytext NOT NULL,
615 `inactive` tinyint(1) NOT NULL default '0',
616 PRIMARY KEY (`debtor_no`),
618 UNIQUE KEY `debtor_ref` (`debtor_ref`)
619 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
622 -- Dumping data for table `0_debtors_master`
626 -- --------------------------------------------------------
629 -- Table structure for table `0_debtor_trans`
632 DROP TABLE IF EXISTS `0_debtor_trans`;
633 CREATE TABLE IF NOT EXISTS `0_debtor_trans` (
634 `trans_no` int(11) unsigned NOT NULL default '0',
635 `type` smallint(6) unsigned NOT NULL default '0',
636 `version` tinyint(1) unsigned NOT NULL default '0',
637 `debtor_no` int(11) unsigned default NULL,
638 `branch_code` int(11) NOT NULL default '-1',
639 `tran_date` date NOT NULL default '0000-00-00',
640 `due_date` date NOT NULL default '0000-00-00',
641 `reference` varchar(60) NOT NULL default '',
642 `tpe` int(11) NOT NULL default '0',
643 `order_` int(11) NOT NULL default '0',
644 `ov_amount` double NOT NULL default '0',
645 `ov_gst` double NOT NULL default '0',
646 `ov_freight` double NOT NULL default '0',
647 `ov_freight_tax` double NOT NULL default '0',
648 `ov_discount` double NOT NULL default '0',
649 `alloc` double NOT NULL default '0',
650 `rate` double NOT NULL default '1',
651 `ship_via` int(11) default NULL,
652 `dimension_id` int(11) NOT NULL default '0',
653 `dimension2_id` int(11) NOT NULL default '0',
654 `payment_terms` int(11) default NULL,
655 `tax_included` tinyint(1) unsigned NOT NULL default '0',
656 PRIMARY KEY (`type`,`trans_no`),
657 KEY `debtor_no` (`debtor_no`,`branch_code`),
658 KEY `tran_date` (`tran_date`)
662 -- Dumping data for table `0_debtor_trans`
666 -- --------------------------------------------------------
669 -- Table structure for table `0_debtor_trans_details`
672 DROP TABLE IF EXISTS `0_debtor_trans_details`;
673 CREATE TABLE IF NOT EXISTS `0_debtor_trans_details` (
674 `id` int(11) NOT NULL auto_increment,
675 `debtor_trans_no` int(11) default NULL,
676 `debtor_trans_type` int(11) default NULL,
677 `stock_id` varchar(20) NOT NULL default '',
678 `description` tinytext,
679 `unit_price` double NOT NULL default '0',
680 `unit_tax` double NOT NULL default '0',
681 `quantity` double NOT NULL default '0',
682 `discount_percent` double NOT NULL default '0',
683 `standard_cost` double NOT NULL default '0',
684 `qty_done` double NOT NULL default '0',
685 `src_id` int(11) NOT NULL,
687 KEY `Transaction` (`debtor_trans_type`,`debtor_trans_no`),
689 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
692 -- Dumping data for table `0_debtor_trans_details`
696 -- --------------------------------------------------------
699 -- Table structure for table `0_dimensions`
702 DROP TABLE IF EXISTS `0_dimensions`;
703 CREATE TABLE IF NOT EXISTS `0_dimensions` (
704 `id` int(11) NOT NULL auto_increment,
705 `reference` varchar(60) NOT NULL default '',
706 `name` varchar(60) NOT NULL default '',
707 `type_` tinyint(1) NOT NULL default '1',
708 `closed` tinyint(1) NOT NULL default '0',
709 `date_` date NOT NULL default '0000-00-00',
710 `due_date` date NOT NULL default '0000-00-00',
712 UNIQUE KEY `reference` (`reference`),
713 KEY `date_` (`date_`),
714 KEY `due_date` (`due_date`),
715 KEY `type_` (`type_`)
716 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
719 -- Dumping data for table `0_dimensions`
723 -- --------------------------------------------------------
726 -- Table structure for table `0_exchange_rates`
729 DROP TABLE IF EXISTS `0_exchange_rates`;
730 CREATE TABLE IF NOT EXISTS `0_exchange_rates` (
731 `id` int(11) NOT NULL auto_increment,
732 `curr_code` char(3) NOT NULL default '',
733 `rate_buy` double NOT NULL default '0',
734 `rate_sell` double NOT NULL default '0',
735 `date_` date NOT NULL default '0000-00-00',
737 UNIQUE KEY `curr_code` (`curr_code`,`date_`)
738 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
741 -- Dumping data for table `0_exchange_rates`
745 -- --------------------------------------------------------
748 -- Table structure for table `0_fiscal_year`
751 DROP TABLE IF EXISTS `0_fiscal_year`;
752 CREATE TABLE IF NOT EXISTS `0_fiscal_year` (
753 `id` int(11) NOT NULL auto_increment,
754 `begin` date default '0000-00-00',
755 `end` date default '0000-00-00',
756 `closed` tinyint(1) NOT NULL default '0',
758 UNIQUE KEY `begin` (`begin`),
759 UNIQUE KEY `end` (`end`)
760 ) ENGINE=InnoDB AUTO_INCREMENT=4 ;
763 -- Dumping data for table `0_fiscal_year`
766 INSERT INTO `0_fiscal_year` VALUES(1, '2008-01-01', '2008-12-31', 0);
767 INSERT INTO `0_fiscal_year` VALUES(2, '2009-01-01', '2009-12-31', 0);
768 INSERT INTO `0_fiscal_year` VALUES(3, '2010-01-01', '2010-12-31', 0);
771 -- Table structure for table `0_gl_trans`
774 DROP TABLE IF EXISTS `0_gl_trans`;
775 CREATE TABLE IF NOT EXISTS `0_gl_trans` (
776 `counter` int(11) NOT NULL auto_increment,
777 `type` smallint(6) NOT NULL default '0',
778 `type_no` bigint(16) NOT NULL default '1',
779 `tran_date` date NOT NULL default '0000-00-00',
780 `account` varchar(15) NOT NULL default '',
781 `memo_` tinytext NOT NULL,
782 `amount` double NOT NULL default '0',
783 `dimension_id` int(11) NOT NULL default '0',
784 `dimension2_id` int(11) NOT NULL default '0',
785 `person_type_id` int(11) default NULL,
786 `person_id` tinyblob,
787 PRIMARY KEY (`counter`),
788 KEY `Type_and_Number` (`type`,`type_no`),
789 KEY `dimension_id` (`dimension_id`),
790 KEY `dimension2_id` (`dimension2_id`),
791 KEY `tran_date` (`tran_date`),
792 KEY `account_and_tran_date` (`account`,`tran_date`)
793 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
796 -- Dumping data for table `0_gl_trans`
800 -- --------------------------------------------------------
803 -- Table structure for table `0_grn_batch`
806 DROP TABLE IF EXISTS `0_grn_batch`;
807 CREATE TABLE IF NOT EXISTS `0_grn_batch` (
808 `id` int(11) NOT NULL auto_increment,
809 `supplier_id` int(11) NOT NULL default '0',
810 `purch_order_no` int(11) default NULL,
811 `reference` varchar(60) NOT NULL default '',
812 `delivery_date` date NOT NULL default '0000-00-00',
813 `loc_code` varchar(5) default NULL,
815 KEY `delivery_date` (`delivery_date`),
816 KEY `purch_order_no` (`purch_order_no`)
817 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
820 -- Dumping data for table `0_grn_batch`
824 -- --------------------------------------------------------
827 -- Table structure for table `0_grn_items`
830 DROP TABLE IF EXISTS `0_grn_items`;
831 CREATE TABLE IF NOT EXISTS `0_grn_items` (
832 `id` int(11) NOT NULL auto_increment,
833 `grn_batch_id` int(11) default NULL,
834 `po_detail_item` int(11) NOT NULL default '0',
835 `item_code` varchar(20) NOT NULL default '',
836 `description` tinytext,
837 `qty_recd` double NOT NULL default '0',
838 `quantity_inv` double NOT NULL default '0',
840 KEY `grn_batch_id` (`grn_batch_id`)
841 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
844 -- Dumping data for table `0_grn_items`
848 -- --------------------------------------------------------
851 -- Table structure for table `0_groups`
854 DROP TABLE IF EXISTS `0_groups`;
855 CREATE TABLE IF NOT EXISTS `0_groups` (
856 `id` smallint(6) unsigned NOT NULL auto_increment,
857 `description` varchar(60) NOT NULL default '',
858 `inactive` tinyint(1) NOT NULL default '0',
860 UNIQUE KEY `description` (`description`)
861 ) ENGINE=MyISAM AUTO_INCREMENT=4 ;
864 -- Dumping data for table `0_groups`
867 INSERT INTO `0_groups` VALUES(1, 'Small', 0);
868 INSERT INTO `0_groups` VALUES(2, 'Medium', 0);
869 INSERT INTO `0_groups` VALUES(3, 'Large', 0);
871 -- --------------------------------------------------------
874 -- Table structure for table `0_item_codes`
877 DROP TABLE IF EXISTS `0_item_codes`;
878 CREATE TABLE IF NOT EXISTS `0_item_codes` (
879 `id` int(11) unsigned NOT NULL auto_increment,
880 `item_code` varchar(20) NOT NULL,
881 `stock_id` varchar(20) NOT NULL,
882 `description` varchar(200) NOT NULL default '',
883 `category_id` smallint(6) unsigned NOT NULL,
884 `quantity` double NOT NULL default '1',
885 `is_foreign` tinyint(1) NOT NULL default '0',
886 `inactive` tinyint(1) NOT NULL default '0',
888 UNIQUE KEY `stock_id` (`stock_id`,`item_code`),
889 KEY `item_code` (`item_code`)
890 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
893 -- Dumping data for table `0_item_codes`
897 -- --------------------------------------------------------
900 -- Table structure for table `0_item_tax_types`
903 DROP TABLE IF EXISTS `0_item_tax_types`;
904 CREATE TABLE IF NOT EXISTS `0_item_tax_types` (
905 `id` int(11) NOT NULL auto_increment,
906 `name` varchar(60) NOT NULL default '',
907 `exempt` tinyint(1) NOT NULL default '0',
908 `inactive` tinyint(1) NOT NULL default '0',
910 UNIQUE KEY `name` (`name`)
911 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
914 -- Dumping data for table `0_item_tax_types`
917 INSERT INTO `0_item_tax_types` VALUES(1, 'Regular', 0, 0);
919 -- --------------------------------------------------------
922 -- Table structure for table `0_item_tax_type_exemptions`
925 DROP TABLE IF EXISTS `0_item_tax_type_exemptions`;
926 CREATE TABLE IF NOT EXISTS `0_item_tax_type_exemptions` (
927 `item_tax_type_id` int(11) NOT NULL default '0',
928 `tax_type_id` int(11) NOT NULL default '0',
929 PRIMARY KEY (`item_tax_type_id`,`tax_type_id`)
933 -- Dumping data for table `0_item_tax_type_exemptions`
937 -- --------------------------------------------------------
940 -- Table structure for table `0_item_units`
943 DROP TABLE IF EXISTS `0_item_units`;
944 CREATE TABLE IF NOT EXISTS `0_item_units` (
945 `abbr` varchar(20) NOT NULL,
946 `name` varchar(40) NOT NULL,
947 `decimals` tinyint(2) NOT NULL,
948 `inactive` tinyint(1) NOT NULL default '0',
949 PRIMARY KEY (`abbr`),
950 UNIQUE KEY `name` (`name`)
954 -- Dumping data for table `0_item_units`
957 INSERT INTO `0_item_units` VALUES('ea.', 'Each', 0, 0);
959 -- --------------------------------------------------------
962 -- Table structure for table `0_locations`
965 DROP TABLE IF EXISTS `0_locations`;
966 CREATE TABLE IF NOT EXISTS `0_locations` (
967 `loc_code` varchar(5) NOT NULL default '',
968 `location_name` varchar(60) NOT NULL default '',
969 `delivery_address` tinytext NOT NULL,
970 `phone` varchar(30) NOT NULL default '',
971 `phone2` varchar(30) NOT NULL default '',
972 `fax` varchar(30) NOT NULL default '',
973 `email` varchar(100) NOT NULL default '',
974 `contact` varchar(30) NOT NULL default '',
975 `inactive` tinyint(1) NOT NULL default '0',
976 PRIMARY KEY (`loc_code`)
980 -- Dumping data for table `0_locations`
983 INSERT INTO `0_locations` VALUES('DEF', 'Default', 'N/A', '', '', '', '', '', 0);
985 -- --------------------------------------------------------
988 -- Table structure for table `0_loc_stock`
991 DROP TABLE IF EXISTS `0_loc_stock`;
992 CREATE TABLE IF NOT EXISTS `0_loc_stock` (
993 `loc_code` char(5) NOT NULL default '',
994 `stock_id` char(20) NOT NULL default '',
995 `reorder_level` bigint(20) NOT NULL default '0',
996 PRIMARY KEY (`loc_code`,`stock_id`),
997 KEY `stock_id` (`stock_id`)
1001 -- Dumping data for table `0_loc_stock`
1005 -- --------------------------------------------------------
1008 -- Table structure for table `0_movement_types`
1011 DROP TABLE IF EXISTS `0_movement_types`;
1012 CREATE TABLE IF NOT EXISTS `0_movement_types` (
1013 `id` int(11) NOT NULL auto_increment,
1014 `name` varchar(60) NOT NULL default '',
1015 `inactive` tinyint(1) NOT NULL default '0',
1017 UNIQUE KEY `name` (`name`)
1018 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
1021 -- Dumping data for table `0_movement_types`
1024 INSERT INTO `0_movement_types` VALUES(1, 'Adjustment', 0);
1026 -- --------------------------------------------------------
1029 -- Table structure for table `0_payment_terms`
1032 DROP TABLE IF EXISTS `0_payment_terms`;
1033 CREATE TABLE IF NOT EXISTS `0_payment_terms` (
1034 `terms_indicator` int(11) NOT NULL auto_increment,
1035 `terms` char(80) NOT NULL default '',
1036 `days_before_due` smallint(6) NOT NULL default '0',
1037 `day_in_following_month` smallint(6) NOT NULL default '0',
1038 `inactive` tinyint(1) NOT NULL default '0',
1039 PRIMARY KEY (`terms_indicator`),
1040 UNIQUE KEY `terms` (`terms`)
1041 ) ENGINE=MyISAM AUTO_INCREMENT=5 ;
1044 -- Dumping data for table `0_payment_terms`
1047 INSERT INTO `0_payment_terms` VALUES(1, 'Due 15th Of the Following Month', 0, 17, 0);
1048 INSERT INTO `0_payment_terms` VALUES(2, 'Due By End Of The Following Month', 0, 30, 0);
1049 INSERT INTO `0_payment_terms` VALUES(3, 'Payment due within 10 days', 10, 0, 0);
1050 INSERT INTO `0_payment_terms` VALUES(4, 'Cash Only', 0, 0, 0);
1052 -- --------------------------------------------------------
1055 -- Table structure for table `0_prices`
1058 DROP TABLE IF EXISTS `0_prices`;
1059 CREATE TABLE IF NOT EXISTS `0_prices` (
1060 `id` int(11) NOT NULL auto_increment,
1061 `stock_id` varchar(20) NOT NULL default '',
1062 `sales_type_id` int(11) NOT NULL default '0',
1063 `curr_abrev` char(3) NOT NULL default '',
1064 `price` double NOT NULL default '0',
1066 UNIQUE KEY `price` (`stock_id`,`sales_type_id`,`curr_abrev`)
1067 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1070 -- Dumping data for table `0_prices`
1074 -- --------------------------------------------------------
1077 -- Table structure for table `0_printers`
1080 DROP TABLE IF EXISTS `0_printers`;
1081 CREATE TABLE IF NOT EXISTS `0_printers` (
1082 `id` tinyint(3) unsigned NOT NULL auto_increment,
1083 `name` varchar(20) NOT NULL,
1084 `description` varchar(60) NOT NULL,
1085 `queue` varchar(20) NOT NULL,
1086 `host` varchar(40) NOT NULL,
1087 `port` smallint(11) unsigned NOT NULL,
1088 `timeout` tinyint(3) unsigned NOT NULL,
1090 UNIQUE KEY `name` (`name`)
1091 ) ENGINE=MyISAM AUTO_INCREMENT=4 ;
1094 -- Dumping data for table `0_printers`
1097 INSERT INTO `0_printers` VALUES(1, 'QL500', 'Label printer', 'QL500', 'server', 127, 20);
1098 INSERT INTO `0_printers` VALUES(2, 'Samsung', 'Main network printer', 'scx4521F', 'server', 515, 5);
1099 INSERT INTO `0_printers` VALUES(3, 'Local', 'Local print server at user IP', 'lp', '', 515, 10);
1101 -- --------------------------------------------------------
1104 -- Table structure for table `0_print_profiles`
1107 DROP TABLE IF EXISTS `0_print_profiles`;
1108 CREATE TABLE IF NOT EXISTS `0_print_profiles` (
1109 `id` smallint(6) unsigned NOT NULL auto_increment,
1110 `profile` varchar(30) NOT NULL,
1111 `report` varchar(5) default NULL,
1112 `printer` tinyint(3) unsigned default NULL,
1114 UNIQUE KEY `profile` (`profile`,`report`)
1115 ) ENGINE=MyISAM AUTO_INCREMENT=10 ;
1118 -- Dumping data for table `0_print_profiles`
1121 INSERT INTO `0_print_profiles` VALUES(1, 'Out of office', '', 0);
1122 INSERT INTO `0_print_profiles` VALUES(2, 'Sales Department', '', 0);
1123 INSERT INTO `0_print_profiles` VALUES(3, 'Central', '', 2);
1124 INSERT INTO `0_print_profiles` VALUES(4, 'Sales Department', '104', 2);
1125 INSERT INTO `0_print_profiles` VALUES(5, 'Sales Department', '105', 2);
1126 INSERT INTO `0_print_profiles` VALUES(6, 'Sales Department', '107', 2);
1127 INSERT INTO `0_print_profiles` VALUES(7, 'Sales Department', '109', 2);
1128 INSERT INTO `0_print_profiles` VALUES(8, 'Sales Department', '110', 2);
1129 INSERT INTO `0_print_profiles` VALUES(9, 'Sales Department', '201', 2);
1131 -- --------------------------------------------------------
1134 -- Table structure for table `0_purch_data`
1137 DROP TABLE IF EXISTS `0_purch_data`;
1138 CREATE TABLE IF NOT EXISTS `0_purch_data` (
1139 `supplier_id` int(11) NOT NULL default '0',
1140 `stock_id` char(20) NOT NULL default '',
1141 `price` double NOT NULL default '0',
1142 `suppliers_uom` char(50) NOT NULL default '',
1143 `conversion_factor` double NOT NULL default '1',
1144 `supplier_description` char(50) NOT NULL default '',
1145 PRIMARY KEY (`supplier_id`,`stock_id`)
1149 -- Dumping data for table `0_purch_data`
1153 -- --------------------------------------------------------
1156 -- Table structure for table `0_purch_orders`
1159 DROP TABLE IF EXISTS `0_purch_orders`;
1160 CREATE TABLE IF NOT EXISTS `0_purch_orders` (
1161 `order_no` int(11) NOT NULL auto_increment,
1162 `supplier_id` int(11) NOT NULL default '0',
1163 `comments` tinytext,
1164 `ord_date` date NOT NULL default '0000-00-00',
1165 `reference` tinytext NOT NULL,
1166 `requisition_no` tinytext,
1167 `into_stock_location` varchar(5) NOT NULL default '',
1168 `delivery_address` tinytext NOT NULL,
1169 `total` double NOT NULL default '0',
1170 `tax_included` tinyint(1) NOT NULL default '0',
1171 PRIMARY KEY (`order_no`),
1172 KEY `ord_date` (`ord_date`)
1173 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1176 -- Dumping data for table `0_purch_orders`
1180 -- --------------------------------------------------------
1183 -- Table structure for table `0_purch_order_details`
1186 DROP TABLE IF EXISTS `0_purch_order_details`;
1187 CREATE TABLE IF NOT EXISTS `0_purch_order_details` (
1188 `po_detail_item` int(11) NOT NULL auto_increment,
1189 `order_no` int(11) NOT NULL default '0',
1190 `item_code` varchar(20) NOT NULL default '',
1191 `description` tinytext,
1192 `delivery_date` date NOT NULL default '0000-00-00',
1193 `qty_invoiced` double NOT NULL default '0',
1194 `unit_price` double NOT NULL default '0',
1195 `act_price` double NOT NULL default '0',
1196 `std_cost_unit` double NOT NULL default '0',
1197 `quantity_ordered` double NOT NULL default '0',
1198 `quantity_received` double NOT NULL default '0',
1199 PRIMARY KEY (`po_detail_item`),
1200 KEY `order` (`order_no`,`po_detail_item`),
1201 KEY `itemcode` (`item_code`)
1202 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1205 -- Dumping data for table `0_purch_order_details`
1209 -- --------------------------------------------------------
1212 -- Table structure for table `0_quick_entries`
1215 DROP TABLE IF EXISTS `0_quick_entries`;
1216 CREATE TABLE IF NOT EXISTS `0_quick_entries` (
1217 `id` smallint(6) unsigned NOT NULL auto_increment,
1218 `type` tinyint(1) NOT NULL default '0',
1219 `description` varchar(60) NOT NULL,
1220 `base_amount` double NOT NULL default '0',
1221 `base_desc` varchar(60) default NULL,
1222 `bal_type` tinyint(1) NOT NULL default '0',
1224 KEY `description` (`description`)
1225 ) ENGINE=MyISAM AUTO_INCREMENT=4 ;
1228 -- Dumping data for table `0_quick_entries`
1231 INSERT INTO `0_quick_entries` VALUES(1, 1, 'Maintenance', 0, 'Amount', 0);
1232 INSERT INTO `0_quick_entries` VALUES(2, 4, 'Phone', 0, 'Amount', 0);
1233 INSERT INTO `0_quick_entries` VALUES(3, 2, 'Cash Sales', 0, 'Amount', 0);
1235 -- --------------------------------------------------------
1238 -- Table structure for table `0_quick_entry_lines`
1241 DROP TABLE IF EXISTS `0_quick_entry_lines`;
1242 CREATE TABLE IF NOT EXISTS `0_quick_entry_lines` (
1243 `id` smallint(6) unsigned NOT NULL auto_increment,
1244 `qid` smallint(6) unsigned NOT NULL,
1245 `amount` double default '0',
1246 `action` varchar(2) NOT NULL,
1247 `dest_id` varchar(15) NOT NULL default '',
1248 `dimension_id` smallint(6) unsigned default NULL,
1249 `dimension2_id` smallint(6) unsigned default NULL,
1252 ) ENGINE=MyISAM AUTO_INCREMENT=7 ;
1255 -- Dumping data for table `0_quick_entry_lines`
1258 INSERT INTO `0_quick_entry_lines` VALUES(1, 1, 0, 't-', '1', 0, 0);
1259 INSERT INTO `0_quick_entry_lines` VALUES(2, 2, 0, 't-', '1', 0, 0);
1260 INSERT INTO `0_quick_entry_lines` VALUES(3, 3, 0, 't-', '1', 0, 0);
1261 INSERT INTO `0_quick_entry_lines` VALUES(4, 3, 0, '=', '4010', 0, 0);
1262 INSERT INTO `0_quick_entry_lines` VALUES(5, 1, 0, '=', '5765', 0, 0);
1263 INSERT INTO `0_quick_entry_lines` VALUES(6, 2, 0, '=', '5780', 0, 0);
1265 -- --------------------------------------------------------
1268 -- Table structure for table `0_recurrent_invoices`
1271 DROP TABLE IF EXISTS `0_recurrent_invoices`;
1272 CREATE TABLE IF NOT EXISTS `0_recurrent_invoices` (
1273 `id` smallint(6) unsigned NOT NULL auto_increment,
1274 `description` varchar(60) NOT NULL default '',
1275 `order_no` int(11) unsigned NOT NULL,
1276 `debtor_no` int(11) unsigned default NULL,
1277 `group_no` smallint(6) unsigned default NULL,
1278 `days` int(11) NOT NULL default '0',
1279 `monthly` int(11) NOT NULL default '0',
1280 `begin` date NOT NULL default '0000-00-00',
1281 `end` date NOT NULL default '0000-00-00',
1282 `last_sent` date NOT NULL default '0000-00-00',
1284 UNIQUE KEY `description` (`description`)
1285 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1288 -- Dumping data for table `0_recurrent_invoices`
1292 -- --------------------------------------------------------
1295 -- Table structure for table `0_refs`
1298 DROP TABLE IF EXISTS `0_refs`;
1299 CREATE TABLE IF NOT EXISTS `0_refs` (
1300 `id` int(11) NOT NULL default '0',
1301 `type` int(11) NOT NULL default '0',
1302 `reference` varchar(100) NOT NULL default '',
1303 PRIMARY KEY (`id`,`type`),
1304 KEY `Type_and_Reference` (`type`,`reference`)
1308 -- Dumping data for table `0_refs`
1312 -- --------------------------------------------------------
1315 -- Table structure for table `0_salesman`
1318 DROP TABLE IF EXISTS `0_salesman`;
1319 CREATE TABLE IF NOT EXISTS `0_salesman` (
1320 `salesman_code` int(11) NOT NULL auto_increment,
1321 `salesman_name` char(60) NOT NULL default '',
1322 `salesman_phone` char(30) NOT NULL default '',
1323 `salesman_fax` char(30) NOT NULL default '',
1324 `salesman_email` varchar(100) NOT NULL default '',
1325 `provision` double NOT NULL default '0',
1326 `break_pt` double NOT NULL default '0',
1327 `provision2` double NOT NULL default '0',
1328 `inactive` tinyint(1) NOT NULL default '0',
1329 PRIMARY KEY (`salesman_code`),
1330 UNIQUE KEY `salesman_name` (`salesman_name`)
1331 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
1334 -- Dumping data for table `0_salesman`
1337 INSERT INTO `0_salesman` VALUES(1, 'Sales Person', '', '', '', 5, 1000, 4, 0);
1339 -- --------------------------------------------------------
1342 -- Table structure for table `0_sales_orders`
1345 DROP TABLE IF EXISTS `0_sales_orders`;
1346 CREATE TABLE IF NOT EXISTS `0_sales_orders` (
1347 `order_no` int(11) NOT NULL,
1348 `trans_type` smallint(6) NOT NULL default '30',
1349 `version` tinyint(1) unsigned NOT NULL default '0',
1350 `type` tinyint(1) NOT NULL default '0',
1351 `debtor_no` int(11) NOT NULL default '0',
1352 `branch_code` int(11) NOT NULL default '0',
1353 `reference` varchar(100) NOT NULL default '',
1354 `customer_ref` tinytext NOT NULL,
1355 `comments` tinytext,
1356 `ord_date` date NOT NULL default '0000-00-00',
1357 `order_type` int(11) NOT NULL default '0',
1358 `ship_via` int(11) NOT NULL default '0',
1359 `delivery_address` tinytext NOT NULL,
1360 `contact_phone` varchar(30) default NULL,
1361 `contact_email` varchar(100) default NULL,
1362 `deliver_to` tinytext NOT NULL,
1363 `freight_cost` double NOT NULL default '0',
1364 `from_stk_loc` varchar(5) NOT NULL default '',
1365 `delivery_date` date NOT NULL default '0000-00-00',
1366 `payment_terms` int(11) default NULL,
1367 `total` double NOT NULL default '0',
1368 PRIMARY KEY (`trans_type`,`order_no`)
1372 -- Dumping data for table `0_sales_orders`
1376 -- --------------------------------------------------------
1379 -- Table structure for table `0_sales_order_details`
1382 DROP TABLE IF EXISTS `0_sales_order_details`;
1383 CREATE TABLE IF NOT EXISTS `0_sales_order_details` (
1384 `id` int(11) NOT NULL auto_increment,
1385 `order_no` int(11) NOT NULL default '0',
1386 `trans_type` smallint(6) NOT NULL default '30',
1387 `stk_code` varchar(20) NOT NULL default '',
1388 `description` tinytext,
1389 `qty_sent` double NOT NULL default '0',
1390 `unit_price` double NOT NULL default '0',
1391 `quantity` double NOT NULL default '0',
1392 `discount_percent` double NOT NULL default '0',
1394 KEY `sorder` (`trans_type`,`order_no`),
1395 KEY `stkcode` (`stk_code`)
1396 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1399 -- Dumping data for table `0_sales_order_details`
1403 -- --------------------------------------------------------
1406 -- Table structure for table `0_sales_pos`
1409 DROP TABLE IF EXISTS `0_sales_pos`;
1410 CREATE TABLE IF NOT EXISTS `0_sales_pos` (
1411 `id` smallint(6) unsigned NOT NULL auto_increment,
1412 `pos_name` varchar(30) NOT NULL,
1413 `cash_sale` tinyint(1) NOT NULL,
1414 `credit_sale` tinyint(1) NOT NULL,
1415 `pos_location` varchar(5) NOT NULL,
1416 `pos_account` smallint(6) unsigned NOT NULL,
1417 `inactive` tinyint(1) NOT NULL default '0',
1419 UNIQUE KEY `pos_name` (`pos_name`)
1420 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
1423 -- Dumping data for table `0_sales_pos`
1426 INSERT INTO `0_sales_pos` VALUES(1, 'Default', 1, 1, 'DEF', 2, 0);
1428 -- --------------------------------------------------------
1431 -- Table structure for table `0_sales_types`
1434 DROP TABLE IF EXISTS `0_sales_types`;
1435 CREATE TABLE IF NOT EXISTS `0_sales_types` (
1436 `id` int(11) NOT NULL auto_increment,
1437 `sales_type` char(50) NOT NULL default '',
1438 `tax_included` int(1) NOT NULL default '0',
1439 `factor` double NOT NULL default '1',
1440 `inactive` tinyint(1) NOT NULL default '0',
1442 UNIQUE KEY `sales_type` (`sales_type`)
1443 ) ENGINE=MyISAM AUTO_INCREMENT=3 ;
1446 -- Dumping data for table `0_sales_types`
1449 INSERT INTO `0_sales_types` VALUES(1, 'Retail', 1, 1, 0);
1450 INSERT INTO `0_sales_types` VALUES(2, 'Wholesale', 0, 0.7, 0);
1452 -- --------------------------------------------------------
1455 -- Table structure for table `0_security_roles`
1458 DROP TABLE IF EXISTS `0_security_roles`;
1459 CREATE TABLE IF NOT EXISTS `0_security_roles` (
1460 `id` int(11) NOT NULL auto_increment,
1461 `role` varchar(30) NOT NULL,
1462 `description` varchar(50) default NULL,
1465 `inactive` tinyint(1) NOT NULL default '0',
1467 UNIQUE KEY `role` (`role`)
1468 ) ENGINE=MyISAM AUTO_INCREMENT=11 ;
1471 -- Dumping data for table `0_security_roles`
1474 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);
1475 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);
1476 INSERT INTO `0_security_roles` VALUES(3, 'Salesman', 'Salesman', '768;3072;5632;8192;15872', '773;774;3073;3075;3081;5633;8194;15873', 0);
1477 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);
1478 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);
1479 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);
1480 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);
1481 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);
1482 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);
1483 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);
1485 -- --------------------------------------------------------
1488 -- Table structure for table `0_shippers`
1491 DROP TABLE IF EXISTS `0_shippers`;
1492 CREATE TABLE IF NOT EXISTS `0_shippers` (
1493 `shipper_id` int(11) NOT NULL auto_increment,
1494 `shipper_name` varchar(60) NOT NULL default '',
1495 `phone` varchar(30) NOT NULL default '',
1496 `phone2` varchar(30) NOT NULL default '',
1497 `contact` tinytext NOT NULL,
1498 `address` tinytext NOT NULL,
1499 `inactive` tinyint(1) NOT NULL default '0',
1500 PRIMARY KEY (`shipper_id`),
1501 UNIQUE KEY `name` (`shipper_name`)
1502 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
1505 -- Dumping data for table `0_shippers`
1508 INSERT INTO `0_shippers` VALUES(1, 'Default', '', '', '', '', 0);
1510 -- --------------------------------------------------------
1513 -- Table structure for table `0_sql_trail`
1516 DROP TABLE IF EXISTS `0_sql_trail`;
1517 CREATE TABLE IF NOT EXISTS `0_sql_trail` (
1518 `id` int(11) unsigned NOT NULL auto_increment,
1519 `sql` text NOT NULL,
1520 `result` tinyint(1) NOT NULL,
1521 `msg` varchar(255) NOT NULL,
1523 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1526 -- Dumping data for table `0_sql_trail`
1530 -- --------------------------------------------------------
1533 -- Table structure for table `0_stock_category`
1536 DROP TABLE IF EXISTS `0_stock_category`;
1537 CREATE TABLE IF NOT EXISTS `0_stock_category` (
1538 `category_id` int(11) NOT NULL auto_increment,
1539 `description` varchar(60) NOT NULL default '',
1540 `dflt_tax_type` int(11) NOT NULL default '1',
1541 `dflt_units` varchar(20) NOT NULL default 'each',
1542 `dflt_mb_flag` char(1) NOT NULL default 'B',
1543 `dflt_sales_act` varchar(15) NOT NULL default '',
1544 `dflt_cogs_act` varchar(15) NOT NULL default '',
1545 `dflt_inventory_act` varchar(15) NOT NULL default '',
1546 `dflt_adjustment_act` varchar(15) NOT NULL default '',
1547 `dflt_assembly_act` varchar(15) NOT NULL default '',
1548 `dflt_dim1` int(11) default NULL,
1549 `dflt_dim2` int(11) default NULL,
1550 `inactive` tinyint(1) NOT NULL default '0',
1551 `dflt_no_sale` tinyint(1) NOT NULL default '0',
1552 PRIMARY KEY (`category_id`),
1553 UNIQUE KEY `description` (`description`)
1554 ) ENGINE=MyISAM AUTO_INCREMENT=5 ;
1557 -- Dumping data for table `0_stock_category`
1560 INSERT INTO `0_stock_category` VALUES(1, 'Components', 1, 'each', 'B', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0);
1561 INSERT INTO `0_stock_category` VALUES(2, 'Charges', 1, 'each', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0);
1562 INSERT INTO `0_stock_category` VALUES(3, 'Systems', 1, 'each', 'M', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0);
1563 INSERT INTO `0_stock_category` VALUES(4, 'Services', 1, 'hrs', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0);
1565 -- --------------------------------------------------------
1568 -- Table structure for table `0_stock_master`
1571 DROP TABLE IF EXISTS `0_stock_master`;
1572 CREATE TABLE IF NOT EXISTS `0_stock_master` (
1573 `stock_id` varchar(20) NOT NULL default '',
1574 `category_id` int(11) NOT NULL default '0',
1575 `tax_type_id` int(11) NOT NULL default '0',
1576 `description` varchar(200) NOT NULL default '',
1577 `long_description` tinytext NOT NULL,
1578 `units` varchar(20) NOT NULL default 'each',
1579 `mb_flag` char(1) NOT NULL default 'B',
1580 `sales_account` varchar(15) NOT NULL default '',
1581 `cogs_account` varchar(15) NOT NULL default '',
1582 `inventory_account` varchar(15) NOT NULL default '',
1583 `adjustment_account` varchar(15) NOT NULL default '',
1584 `assembly_account` varchar(15) NOT NULL default '',
1585 `dimension_id` int(11) default NULL,
1586 `dimension2_id` int(11) default NULL,
1587 `actual_cost` double NOT NULL default '0',
1588 `last_cost` double NOT NULL default '0',
1589 `material_cost` double NOT NULL default '0',
1590 `labour_cost` double NOT NULL default '0',
1591 `overhead_cost` double NOT NULL default '0',
1592 `inactive` tinyint(1) NOT NULL default '0',
1593 `no_sale` tinyint(1) NOT NULL default '0',
1594 `editable` tinyint(1) NOT NULL default '0',
1595 PRIMARY KEY (`stock_id`)
1599 -- Dumping data for table `0_stock_master`
1603 -- --------------------------------------------------------
1606 -- Table structure for table `0_stock_moves`
1609 DROP TABLE IF EXISTS `0_stock_moves`;
1610 CREATE TABLE IF NOT EXISTS `0_stock_moves` (
1611 `trans_id` int(11) NOT NULL auto_increment,
1612 `trans_no` int(11) NOT NULL default '0',
1613 `stock_id` char(20) NOT NULL default '',
1614 `type` smallint(6) NOT NULL default '0',
1615 `loc_code` char(5) NOT NULL default '',
1616 `tran_date` date NOT NULL default '0000-00-00',
1617 `person_id` int(11) default NULL,
1618 `price` double NOT NULL default '0',
1619 `reference` char(40) NOT NULL default '',
1620 `qty` double NOT NULL default '1',
1621 `discount_percent` double NOT NULL default '0',
1622 `standard_cost` double NOT NULL default '0',
1623 `visible` tinyint(1) NOT NULL default '1',
1624 PRIMARY KEY (`trans_id`),
1625 KEY `type` (`type`,`trans_no`),
1626 KEY `Move` (`stock_id`,`loc_code`,`tran_date`)
1627 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1630 -- Dumping data for table `0_stock_moves`
1634 -- --------------------------------------------------------
1637 -- Table structure for table `0_suppliers`
1640 DROP TABLE IF EXISTS `0_suppliers`;
1641 CREATE TABLE IF NOT EXISTS `0_suppliers` (
1642 `supplier_id` int(11) NOT NULL auto_increment,
1643 `supp_name` varchar(60) NOT NULL default '',
1644 `supp_ref` varchar(30) NOT NULL default '',
1645 `address` tinytext NOT NULL,
1646 `supp_address` tinytext NOT NULL,
1647 `gst_no` varchar(25) NOT NULL default '',
1648 `contact` varchar(60) NOT NULL default '',
1649 `supp_account_no` varchar(40) NOT NULL default '',
1650 `website` varchar(100) NOT NULL default '',
1651 `bank_account` varchar(60) NOT NULL default '',
1652 `curr_code` char(3) default NULL,
1653 `payment_terms` int(11) default NULL,
1654 `tax_included` tinyint(1) NOT NULL default '0',
1655 `tax_algorithm` tinyint(1) NOT NULL default '1',
1656 `dimension_id` int(11) default '0',
1657 `dimension2_id` int(11) default '0',
1658 `tax_group_id` int(11) default NULL,
1659 `credit_limit` double NOT NULL default '0',
1660 `purchase_account` varchar(15) NOT NULL default '',
1661 `payable_account` varchar(15) NOT NULL default '',
1662 `payment_discount_account` varchar(15) NOT NULL default '',
1663 `notes` tinytext NOT NULL,
1664 `inactive` tinyint(1) NOT NULL default '0',
1665 PRIMARY KEY (`supplier_id`),
1666 KEY `supp_ref` (`supp_ref`)
1667 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1670 -- Dumping data for table `0_suppliers`
1674 -- --------------------------------------------------------
1677 -- Table structure for table `0_supp_allocations`
1680 DROP TABLE IF EXISTS `0_supp_allocations`;
1681 CREATE TABLE IF NOT EXISTS `0_supp_allocations` (
1682 `id` int(11) NOT NULL auto_increment,
1683 `amt` double unsigned default NULL,
1684 `date_alloc` date NOT NULL default '0000-00-00',
1685 `trans_no_from` int(11) default NULL,
1686 `trans_type_from` int(11) default NULL,
1687 `trans_no_to` int(11) default NULL,
1688 `trans_type_to` int(11) default NULL,
1690 KEY `From` (`trans_type_from`,`trans_no_from`),
1691 KEY `To` (`trans_type_to`,`trans_no_to`)
1692 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1695 -- Dumping data for table `0_supp_allocations`
1699 -- --------------------------------------------------------
1702 -- Table structure for table `0_supp_invoice_items`
1705 DROP TABLE IF EXISTS `0_supp_invoice_items`;
1706 CREATE TABLE IF NOT EXISTS `0_supp_invoice_items` (
1707 `id` int(11) NOT NULL auto_increment,
1708 `supp_trans_no` int(11) default NULL,
1709 `supp_trans_type` int(11) default NULL,
1710 `gl_code` varchar(15) NOT NULL default '',
1711 `grn_item_id` int(11) default NULL,
1712 `po_detail_item_id` int(11) default NULL,
1713 `stock_id` varchar(20) NOT NULL default '',
1714 `description` tinytext,
1715 `quantity` double NOT NULL default '0',
1716 `unit_price` double NOT NULL default '0',
1717 `unit_tax` double NOT NULL default '0',
1720 KEY `Transaction` (`supp_trans_type`,`supp_trans_no`,`stock_id`)
1721 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1724 -- Dumping data for table `0_supp_invoice_items`
1728 -- --------------------------------------------------------
1731 -- Table structure for table `0_supp_trans`
1734 DROP TABLE IF EXISTS `0_supp_trans`;
1735 CREATE TABLE IF NOT EXISTS `0_supp_trans` (
1736 `trans_no` int(11) unsigned NOT NULL default '0',
1737 `type` smallint(6) unsigned NOT NULL default '0',
1738 `supplier_id` int(11) unsigned default NULL,
1739 `reference` tinytext NOT NULL,
1740 `supp_reference` varchar(60) NOT NULL default '',
1741 `tran_date` date NOT NULL default '0000-00-00',
1742 `due_date` date NOT NULL default '0000-00-00',
1743 `ov_amount` double NOT NULL default '0',
1744 `ov_discount` double NOT NULL default '0',
1745 `ov_gst` double NOT NULL default '0',
1746 `rate` double NOT NULL default '1',
1747 `alloc` double NOT NULL default '0',
1748 `tax_included` tinyint(1) NOT NULL default '0',
1749 `tax_algorihm` tinyint(1) NOT NULL default '1',
1750 PRIMARY KEY (`type`,`trans_no`),
1751 KEY `supplier_id` (`supplier_id`),
1752 KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
1753 KEY `type` (`type`),
1754 KEY `tran_date` (`tran_date`)
1758 -- Dumping data for table `0_supp_trans`
1762 -- --------------------------------------------------------
1765 -- Table structure for table `0_sys_prefs`
1768 DROP TABLE IF EXISTS `0_sys_prefs`;
1769 CREATE TABLE IF NOT EXISTS `0_sys_prefs` (
1770 `name` varchar(35) NOT NULL default '',
1771 `category` varchar(30) default NULL,
1772 `type` varchar(20) NOT NULL default '',
1773 `length` smallint(6) default NULL,
1775 PRIMARY KEY (`name`),
1776 KEY `category` (`category`)
1780 -- Dumping data for table `0_sys_prefs`
1783 INSERT INTO `0_sys_prefs` VALUES('coy_name', 'setup.company', 'varchar', 60, 'Company name');
1784 INSERT INTO `0_sys_prefs` VALUES('gst_no', 'setup.company', 'varchar', 25, '');
1785 INSERT INTO `0_sys_prefs` VALUES('coy_no', 'setup.company', 'varchar', 25, '');
1786 INSERT INTO `0_sys_prefs` VALUES('tax_prd', 'setup.company', 'int', 11, '1');
1787 INSERT INTO `0_sys_prefs` VALUES('tax_last', 'setup.company', 'int', 11, '1');
1788 INSERT INTO `0_sys_prefs` VALUES('postal_address', 'setup.company', 'tinytext', 0, 'N/A');
1789 INSERT INTO `0_sys_prefs` VALUES('phone', 'setup.company', 'varchar', 30, '');
1790 INSERT INTO `0_sys_prefs` VALUES('fax', 'setup.company', 'varchar', 30, '');
1791 INSERT INTO `0_sys_prefs` VALUES('email', 'setup.company', 'varchar', 100, '');
1792 INSERT INTO `0_sys_prefs` VALUES('coy_logo', 'setup.company', 'varchar', 100, '');
1793 INSERT INTO `0_sys_prefs` VALUES('domicile', 'setup.company', 'varchar', 55, '');
1794 INSERT INTO `0_sys_prefs` VALUES('curr_default', 'setup.company', 'char', 3, 'USD');
1795 INSERT INTO `0_sys_prefs` VALUES('use_dimension', 'setup.company', 'tinyint', 1, '1');
1796 INSERT INTO `0_sys_prefs` VALUES('f_year', 'setup.company', 'int', 11, '3');
1797 INSERT INTO `0_sys_prefs` VALUES('no_item_list', 'setup.company', 'tinyint', 1, '0');
1798 INSERT INTO `0_sys_prefs` VALUES('no_customer_list', 'setup.company', 'tinyint', 1, '0');
1799 INSERT INTO `0_sys_prefs` VALUES('no_supplier_list', 'setup.company', 'tinyint', 1, '0');
1800 INSERT INTO `0_sys_prefs` VALUES('base_sales', 'setup.company', 'int', 11, '1');
1801 INSERT INTO `0_sys_prefs` VALUES('time_zone', 'setup.company', 'tinyint', 1, '0');
1802 INSERT INTO `0_sys_prefs` VALUES('add_pct', 'setup.company', 'int', 5, '-1');
1803 INSERT INTO `0_sys_prefs` VALUES('round_to', 'setup.company', 'int', 5, '1');
1804 INSERT INTO `0_sys_prefs` VALUES('login_tout', 'setup.company', 'smallint', 6, '600');
1805 INSERT INTO `0_sys_prefs` VALUES('past_due_days', 'glsetup.general', 'int', 11, '30');
1806 INSERT INTO `0_sys_prefs` VALUES('profit_loss_year_act', 'glsetup.general', 'varchar', 15, '9990');
1807 INSERT INTO `0_sys_prefs` VALUES('retained_earnings_act', 'glsetup.general', 'varchar', 15, '3590');
1808 INSERT INTO `0_sys_prefs` VALUES('bank_charge_act', 'glsetup.general', 'varchar', 15, '5690');
1809 INSERT INTO `0_sys_prefs` VALUES('exchange_diff_act', 'glsetup.general', 'varchar', 15, '4450');
1810 INSERT INTO `0_sys_prefs` VALUES('tax_algorithm', 'glsetup.general', 'tinyint', 1, '1');
1811 INSERT INTO `0_sys_prefs` VALUES('default_credit_limit', 'glsetup.customer', 'int', 11, '1000');
1812 INSERT INTO `0_sys_prefs` VALUES('accumulate_shipping', 'glsetup.customer', 'tinyint', 1, '0');
1813 INSERT INTO `0_sys_prefs` VALUES('legal_text', 'glsetup.customer', 'tinytext', 0, '');
1814 INSERT INTO `0_sys_prefs` VALUES('freight_act', 'glsetup.customer', 'varchar', 15, '4430');
1815 INSERT INTO `0_sys_prefs` VALUES('debtors_act', 'glsetup.sales', 'varchar', 15, '1200');
1816 INSERT INTO `0_sys_prefs` VALUES('default_sales_act', 'glsetup.sales', 'varchar', 15, '4010');
1817 INSERT INTO `0_sys_prefs` VALUES('default_sales_discount_act', 'glsetup.sales', 'varchar', 15, '4510');
1818 INSERT INTO `0_sys_prefs` VALUES('default_prompt_payment_act', 'glsetup.sales', 'varchar', 15, '4500');
1819 INSERT INTO `0_sys_prefs` VALUES('default_delivery_required', 'glsetup.sales', 'smallint', 6, '1');
1820 INSERT INTO `0_sys_prefs` VALUES('default_dim_required', 'glsetup.dims', 'int', 11, '20');
1821 INSERT INTO `0_sys_prefs` VALUES('pyt_discount_act', 'glsetup.purchase', 'varchar', 15, '5060');
1822 INSERT INTO `0_sys_prefs` VALUES('creditors_act', 'glsetup.purchase', 'varchar', 15, '2100');
1823 INSERT INTO `0_sys_prefs` VALUES('po_over_receive', 'glsetup.purchase', 'int', 11, '10');
1824 INSERT INTO `0_sys_prefs` VALUES('po_over_charge', 'glsetup.purchase', 'int', 11, '10');
1825 INSERT INTO `0_sys_prefs` VALUES('allow_negative_stock', 'glsetup.inventory', 'tinyint', 1, '0');
1826 INSERT INTO `0_sys_prefs` VALUES('default_inventory_act', 'glsetup.items', 'varchar', 15, '1510');
1827 INSERT INTO `0_sys_prefs` VALUES('default_cogs_act', 'glsetup.items', 'varchar', 15, '5010');
1828 INSERT INTO `0_sys_prefs` VALUES('default_adj_act', 'glsetup.items', 'varchar', 15, '5040');
1829 INSERT INTO `0_sys_prefs` VALUES('default_inv_sales_act', 'glsetup.items', 'varchar', 15, '4010');
1830 INSERT INTO `0_sys_prefs` VALUES('default_assembly_act', 'glsetup.items', 'varchar', 15, '1530');
1831 INSERT INTO `0_sys_prefs` VALUES('default_workorder_required', 'glsetup.manuf', 'int', 11, '20');
1832 INSERT INTO `0_sys_prefs` VALUES('version_id', 'system', 'varchar', 11, '2.3rc');
1833 INSERT INTO `0_sys_prefs` VALUES('auto_curr_reval', 'setup.company', 'smallint', 6, '1');
1834 INSERT INTO `0_sys_prefs` VALUES('grn_clearing_act', 'glsetup.purchase', 'varchar', 15, '1550');
1836 -- --------------------------------------------------------
1839 -- Table structure for table `0_sys_types`
1842 DROP TABLE IF EXISTS `0_sys_types`;
1843 CREATE TABLE IF NOT EXISTS `0_sys_types` (
1844 `type_id` smallint(6) NOT NULL default '0',
1845 `type_no` int(11) NOT NULL default '1',
1846 `next_reference` varchar(100) NOT NULL default '',
1847 PRIMARY KEY (`type_id`)
1851 -- Dumping data for table `0_sys_types`
1854 INSERT INTO `0_sys_types` VALUES(0, 17, '1');
1855 INSERT INTO `0_sys_types` VALUES(1, 7, '1');
1856 INSERT INTO `0_sys_types` VALUES(2, 4, '1');
1857 INSERT INTO `0_sys_types` VALUES(4, 3, '1');
1858 INSERT INTO `0_sys_types` VALUES(10, 16, '1');
1859 INSERT INTO `0_sys_types` VALUES(11, 2, '1');
1860 INSERT INTO `0_sys_types` VALUES(12, 6, '1');
1861 INSERT INTO `0_sys_types` VALUES(13, 1, '1');
1862 INSERT INTO `0_sys_types` VALUES(16, 2, '1');
1863 INSERT INTO `0_sys_types` VALUES(17, 2, '1');
1864 INSERT INTO `0_sys_types` VALUES(18, 1, '1');
1865 INSERT INTO `0_sys_types` VALUES(20, 6, '1');
1866 INSERT INTO `0_sys_types` VALUES(21, 1, '1');
1867 INSERT INTO `0_sys_types` VALUES(22, 3, '1');
1868 INSERT INTO `0_sys_types` VALUES(25, 1, '1');
1869 INSERT INTO `0_sys_types` VALUES(26, 1, '1');
1870 INSERT INTO `0_sys_types` VALUES(28, 1, '1');
1871 INSERT INTO `0_sys_types` VALUES(29, 1, '1');
1872 INSERT INTO `0_sys_types` VALUES(30, 0, '1');
1873 INSERT INTO `0_sys_types` VALUES(32, 0, '1');
1874 INSERT INTO `0_sys_types` VALUES(35, 1, '1');
1875 INSERT INTO `0_sys_types` VALUES(40, 1, '1');
1877 -- --------------------------------------------------------
1880 -- Table structure for table `0_tags`
1883 DROP TABLE IF EXISTS `0_tags`;
1884 CREATE TABLE IF NOT EXISTS `0_tags` (
1885 `id` int(11) NOT NULL auto_increment,
1886 `type` smallint(6) NOT NULL,
1887 `name` varchar(30) NOT NULL,
1888 `description` varchar(60) default NULL,
1889 `inactive` tinyint(1) NOT NULL default '0',
1891 UNIQUE KEY `type` (`type`,`name`)
1892 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1895 -- Dumping data for table `0_tags`
1899 -- --------------------------------------------------------
1902 -- Table structure for table `0_tag_associations`
1905 DROP TABLE IF EXISTS `0_tag_associations`;
1906 CREATE TABLE IF NOT EXISTS `0_tag_associations` (
1907 `record_id` varchar(15) NOT NULL,
1908 `tag_id` int(11) NOT NULL,
1909 UNIQUE KEY `record_id` (`record_id`,`tag_id`)
1913 -- Dumping data for table `0_tag_associations`
1917 -- --------------------------------------------------------
1920 -- Table structure for table `0_tax_groups`
1923 DROP TABLE IF EXISTS `0_tax_groups`;
1924 CREATE TABLE IF NOT EXISTS `0_tax_groups` (
1925 `id` int(11) NOT NULL auto_increment,
1926 `name` varchar(60) NOT NULL default '',
1927 `inactive` tinyint(1) NOT NULL default '0',
1929 UNIQUE KEY `name` (`name`)
1930 ) ENGINE=InnoDB AUTO_INCREMENT=3 ;
1933 -- Dumping data for table `0_tax_groups`
1936 INSERT INTO `0_tax_groups` VALUES(1, 'Tax', 0);
1937 INSERT INTO `0_tax_groups` VALUES(2, 'Tax Exempt', 0);
1939 -- --------------------------------------------------------
1942 -- Table structure for table `0_tax_group_items`
1945 DROP TABLE IF EXISTS `0_tax_group_items`;
1946 CREATE TABLE IF NOT EXISTS `0_tax_group_items` (
1947 `tax_group_id` int(11) NOT NULL default '0',
1948 `tax_type_id` int(11) NOT NULL default '0',
1949 `tax_shipping` tinyint(1) NOT NULL default '0',
1950 PRIMARY KEY (`tax_group_id`,`tax_type_id`)
1954 -- Dumping data for table `0_tax_group_items`
1957 INSERT INTO `0_tax_group_items` VALUES(1, 1, 5, 1);
1959 -- --------------------------------------------------------
1962 -- Table structure for table `0_tax_types`
1965 DROP TABLE IF EXISTS `0_tax_types`;
1966 CREATE TABLE IF NOT EXISTS `0_tax_types` (
1967 `id` int(11) NOT NULL auto_increment,
1968 `rate` double NOT NULL default '0',
1969 `sales_gl_code` varchar(15) NOT NULL default '',
1970 `purchasing_gl_code` varchar(15) NOT NULL default '',
1971 `name` varchar(60) NOT NULL default '',
1972 `inactive` tinyint(1) NOT NULL default '0',
1974 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
1977 -- Dumping data for table `0_tax_types`
1980 INSERT INTO `0_tax_types` VALUES(1, 5, '2150', '2150', 'Tax', 0);
1982 -- --------------------------------------------------------
1985 -- Table structure for table `0_trans_tax_details`
1988 DROP TABLE IF EXISTS `0_trans_tax_details`;
1989 CREATE TABLE IF NOT EXISTS `0_trans_tax_details` (
1990 `id` int(11) NOT NULL auto_increment,
1991 `trans_type` smallint(6) default NULL,
1992 `trans_no` int(11) default NULL,
1993 `tran_date` date NOT NULL,
1994 `tax_type_id` int(11) NOT NULL default '0',
1995 `rate` double NOT NULL default '0',
1996 `ex_rate` double NOT NULL default '1',
1997 `included_in_price` tinyint(1) NOT NULL default '0',
1998 `net_amount` double NOT NULL default '0',
1999 `amount` double NOT NULL default '0',
2002 KEY `Type_and_Number` (`trans_type`,`trans_no`),
2003 KEY `tran_date` (`tran_date`)
2004 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2007 -- Dumping data for table `0_trans_tax_details`
2011 -- --------------------------------------------------------
2014 -- Table structure for table `0_useronline`
2017 DROP TABLE IF EXISTS `0_useronline`;
2018 CREATE TABLE IF NOT EXISTS `0_useronline` (
2019 `id` int(11) NOT NULL auto_increment,
2020 `timestamp` int(15) NOT NULL default '0',
2021 `ip` varchar(40) NOT NULL default '',
2022 `file` varchar(100) NOT NULL default '',
2024 KEY `timestamp` (`timestamp`),
2026 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2029 -- Dumping data for table `0_useronline`
2033 -- --------------------------------------------------------
2036 -- Table structure for table `0_users`
2039 DROP TABLE IF EXISTS `0_users`;
2040 CREATE TABLE IF NOT EXISTS `0_users` (
2041 `id` smallint(6) NOT NULL auto_increment,
2042 `user_id` varchar(60) NOT NULL default '',
2043 `password` varchar(100) NOT NULL default '',
2044 `real_name` varchar(100) NOT NULL default '',
2045 `role_id` int(11) NOT NULL default '1',
2046 `phone` varchar(30) NOT NULL default '',
2047 `email` varchar(100) default NULL,
2048 `language` varchar(20) default NULL,
2049 `date_format` tinyint(1) NOT NULL default '0',
2050 `date_sep` tinyint(1) NOT NULL default '0',
2051 `tho_sep` tinyint(1) NOT NULL default '0',
2052 `dec_sep` tinyint(1) NOT NULL default '0',
2053 `theme` varchar(20) NOT NULL default 'default',
2054 `page_size` varchar(20) NOT NULL default 'A4',
2055 `prices_dec` smallint(6) NOT NULL default '2',
2056 `qty_dec` smallint(6) NOT NULL default '2',
2057 `rates_dec` smallint(6) NOT NULL default '4',
2058 `percent_dec` smallint(6) NOT NULL default '1',
2059 `show_gl` tinyint(1) NOT NULL default '1',
2060 `show_codes` tinyint(1) NOT NULL default '0',
2061 `show_hints` tinyint(1) NOT NULL default '0',
2062 `last_visit_date` datetime default NULL,
2063 `query_size` tinyint(1) default '10',
2064 `graphic_links` tinyint(1) default '1',
2065 `pos` smallint(6) default '1',
2066 `print_profile` varchar(30) NOT NULL default '1',
2067 `rep_popup` tinyint(1) default '1',
2068 `sticky_doc_date` tinyint(1) default '0',
2069 `startup_tab` varchar(20) NOT NULL default '',
2070 `inactive` tinyint(1) NOT NULL default '0',
2072 UNIQUE KEY `user_id` (`user_id`)
2073 ) ENGINE=MyISAM AUTO_INCREMENT=2 ;
2076 -- Dumping data for table `0_users`
2079 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);
2081 -- --------------------------------------------------------
2084 -- Table structure for table `0_voided`
2087 DROP TABLE IF EXISTS `0_voided`;
2088 CREATE TABLE IF NOT EXISTS `0_voided` (
2089 `type` int(11) NOT NULL default '0',
2090 `id` int(11) NOT NULL default '0',
2091 `date_` date NOT NULL default '0000-00-00',
2092 `memo_` tinytext NOT NULL,
2093 UNIQUE KEY `id` (`type`,`id`)
2097 -- Dumping data for table `0_voided`
2101 -- --------------------------------------------------------
2104 -- Table structure for table `0_workcentres`
2107 DROP TABLE IF EXISTS `0_workcentres`;
2108 CREATE TABLE IF NOT EXISTS `0_workcentres` (
2109 `id` int(11) NOT NULL auto_increment,
2110 `name` char(40) NOT NULL default '',
2111 `description` char(50) NOT NULL default '',
2112 `inactive` tinyint(1) NOT NULL default '0',
2114 UNIQUE KEY `name` (`name`)
2115 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2118 -- Dumping data for table `0_workcentres`
2122 -- --------------------------------------------------------
2125 -- Table structure for table `0_workorders`
2128 DROP TABLE IF EXISTS `0_workorders`;
2129 CREATE TABLE IF NOT EXISTS `0_workorders` (
2130 `id` int(11) NOT NULL auto_increment,
2131 `wo_ref` varchar(60) NOT NULL default '',
2132 `loc_code` varchar(5) NOT NULL default '',
2133 `units_reqd` double NOT NULL default '1',
2134 `stock_id` varchar(20) NOT NULL default '',
2135 `date_` date NOT NULL default '0000-00-00',
2136 `type` tinyint(4) NOT NULL default '0',
2137 `required_by` date NOT NULL default '0000-00-00',
2138 `released_date` date NOT NULL default '0000-00-00',
2139 `units_issued` double NOT NULL default '0',
2140 `closed` tinyint(1) NOT NULL default '0',
2141 `released` tinyint(1) NOT NULL default '0',
2142 `additional_costs` double NOT NULL default '0',
2144 UNIQUE KEY `wo_ref` (`wo_ref`)
2145 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2148 -- Dumping data for table `0_workorders`
2152 -- --------------------------------------------------------
2155 -- Table structure for table `0_wo_issues`
2158 DROP TABLE IF EXISTS `0_wo_issues`;
2159 CREATE TABLE IF NOT EXISTS `0_wo_issues` (
2160 `issue_no` int(11) NOT NULL auto_increment,
2161 `workorder_id` int(11) NOT NULL default '0',
2162 `reference` varchar(100) default NULL,
2163 `issue_date` date default NULL,
2164 `loc_code` varchar(5) default NULL,
2165 `workcentre_id` int(11) default NULL,
2166 PRIMARY KEY (`issue_no`),
2167 KEY `workorder_id` (`workorder_id`)
2168 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2171 -- Dumping data for table `0_wo_issues`
2175 -- --------------------------------------------------------
2178 -- Table structure for table `0_wo_issue_items`
2181 DROP TABLE IF EXISTS `0_wo_issue_items`;
2182 CREATE TABLE IF NOT EXISTS `0_wo_issue_items` (
2183 `id` int(11) NOT NULL auto_increment,
2184 `stock_id` varchar(40) default NULL,
2185 `issue_id` int(11) default NULL,
2186 `qty_issued` double default NULL,
2188 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2191 -- Dumping data for table `0_wo_issue_items`
2195 -- --------------------------------------------------------
2198 -- Table structure for table `0_wo_manufacture`
2201 DROP TABLE IF EXISTS `0_wo_manufacture`;
2202 CREATE TABLE IF NOT EXISTS `0_wo_manufacture` (
2203 `id` int(11) NOT NULL auto_increment,
2204 `reference` varchar(100) default NULL,
2205 `workorder_id` int(11) NOT NULL default '0',
2206 `quantity` double NOT NULL default '0',
2207 `date_` date NOT NULL default '0000-00-00',
2209 KEY `workorder_id` (`workorder_id`)
2210 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2213 -- Dumping data for table `0_wo_manufacture`
2217 -- --------------------------------------------------------
2220 -- Table structure for table `0_wo_requirements`
2223 DROP TABLE IF EXISTS `0_wo_requirements`;
2224 CREATE TABLE IF NOT EXISTS `0_wo_requirements` (
2225 `id` int(11) NOT NULL auto_increment,
2226 `workorder_id` int(11) NOT NULL default '0',
2227 `stock_id` char(20) NOT NULL default '',
2228 `workcentre` int(11) NOT NULL default '0',
2229 `units_req` double NOT NULL default '1',
2230 `std_cost` double NOT NULL default '0',
2231 `loc_code` char(5) NOT NULL default '',
2232 `units_issued` double NOT NULL default '0',
2234 KEY `workorder_id` (`workorder_id`)
2235 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2238 -- Dumping data for table `0_wo_requirements`