2 -- version 2.11.8.1deb5
3 -- http://www.phpmyadmin.net
6 -- Generation Time: Sep 26, 2015 at 11:37 AM
7 -- Server version: 5.0.51
8 -- PHP Version: 5.2.6-1+lenny2
14 -- --------------------------------------------------------
17 -- Table structure for table `0_areas`
20 DROP TABLE IF EXISTS `0_areas`;
21 CREATE TABLE IF NOT EXISTS `0_areas` (
22 `area_code` int(11) NOT NULL auto_increment,
23 `description` varchar(60) NOT NULL default '',
24 `inactive` tinyint(1) NOT NULL default '0',
25 PRIMARY KEY (`area_code`),
26 UNIQUE KEY `description` (`description`)
27 ) ENGINE=InnoDB 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`)
57 -- Dumping data for table `0_attachments`
60 -- --------------------------------------------------------
63 -- Table structure for table `0_audit_trail`
66 DROP TABLE IF EXISTS `0_audit_trail`;
67 CREATE TABLE IF NOT EXISTS `0_audit_trail` (
68 `id` int(11) NOT NULL auto_increment,
69 `type` smallint(6) unsigned NOT NULL default '0',
70 `trans_no` int(11) unsigned NOT NULL default '0',
71 `user` smallint(6) unsigned NOT NULL default '0',
72 `stamp` timestamp NOT NULL,
73 `description` varchar(60) default NULL,
74 `fiscal_year` int(11) NOT NULL default 0,
75 `gl_date` date NOT NULL default '0000-00-00',
76 `gl_seq` int(11) unsigned default NULL,
78 KEY `Seq` (`fiscal_year`,`gl_date`,`gl_seq`),
79 KEY `Type_and_Number` (`type`,`trans_no`)
83 -- Dumping data for table `0_audit_trail`
86 -- --------------------------------------------------------
89 -- Table structure for table `0_bank_accounts`
92 DROP TABLE IF EXISTS `0_bank_accounts`;
93 CREATE TABLE IF NOT EXISTS `0_bank_accounts` (
94 `account_code` varchar(15) NOT NULL default '',
95 `account_type` smallint(6) NOT NULL default '0',
96 `bank_account_name` varchar(60) NOT NULL default '',
97 `bank_account_number` varchar(100) NOT NULL default '',
98 `bank_name` varchar(60) NOT NULL default '',
99 `bank_address` tinytext,
100 `bank_curr_code` char(3) NOT NULL default '',
101 `dflt_curr_act` tinyint(1) NOT NULL default '0',
102 `id` smallint(6) NOT NULL auto_increment,
103 `bank_charge_act` varchar(15) NOT NULL default '',
104 `last_reconciled_date` timestamp NOT NULL default '0000-00-00 00:00:00',
105 `ending_reconcile_balance` double NOT NULL default '0',
106 `inactive` tinyint(1) NOT NULL default '0',
108 KEY `bank_account_name` (`bank_account_name`),
109 KEY `bank_account_number` (`bank_account_number`),
110 KEY `account_code` (`account_code`)
111 ) ENGINE=InnoDB AUTO_INCREMENT=3 ;
114 -- Dumping data for table `0_bank_accounts`
117 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);
118 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);
120 -- --------------------------------------------------------
123 -- Table structure for table `0_bank_trans`
126 DROP TABLE IF EXISTS `0_bank_trans`;
127 CREATE TABLE IF NOT EXISTS `0_bank_trans` (
128 `id` int(11) NOT NULL auto_increment,
129 `type` smallint(6) default NULL,
130 `trans_no` int(11) default NULL,
131 `bank_act` varchar(15) NOT NULL default '',
132 `ref` varchar(40) default NULL,
133 `trans_date` date NOT NULL default '0000-00-00',
134 `amount` double default NULL,
135 `dimension_id` int(11) NOT NULL default '0',
136 `dimension2_id` int(11) NOT NULL default '0',
137 `person_type_id` int(11) NOT NULL default '0',
138 `person_id` tinyblob,
139 `reconciled` date default NULL,
141 KEY `bank_act` (`bank_act`,`ref`),
142 KEY `type` (`type`,`trans_no`),
143 KEY `bank_act_2` (`bank_act`,`reconciled`),
144 KEY `bank_act_3` (`bank_act`,`trans_date`)
148 -- Dumping data for table `0_bank_trans`
151 -- --------------------------------------------------------
154 -- Table structure for table `0_bom`
157 DROP TABLE IF EXISTS `0_bom`;
158 CREATE TABLE IF NOT EXISTS `0_bom` (
159 `id` int(11) NOT NULL auto_increment,
160 `parent` char(20) NOT NULL default '',
161 `component` char(20) NOT NULL default '',
162 `workcentre_added` int(11) NOT NULL default '0',
163 `loc_code` char(5) NOT NULL default '',
164 `quantity` double NOT NULL default '1',
165 PRIMARY KEY (`parent`,`component`,`workcentre_added`,`loc_code`),
166 KEY `component` (`component`),
168 KEY `loc_code` (`loc_code`),
169 KEY `parent` (`parent`,`loc_code`),
170 KEY `workcentre_added` (`workcentre_added`)
174 -- Dumping data for table `0_bom`
177 -- --------------------------------------------------------
180 -- Table structure for table `0_budget_trans`
183 DROP TABLE IF EXISTS `0_budget_trans`;
184 CREATE TABLE IF NOT EXISTS `0_budget_trans` (
185 `id` int(11) NOT NULL auto_increment,
186 `tran_date` date NOT NULL default '0000-00-00',
187 `account` varchar(15) NOT NULL default '',
188 `memo_` tinytext NOT NULL,
189 `amount` double NOT NULL default '0',
190 `dimension_id` int(11) default '0',
191 `dimension2_id` int(11) default '0',
193 KEY `Account` (`account`,`tran_date`,`dimension_id`,`dimension2_id`)
197 -- Dumping data for table `0_budget_trans`
200 -- --------------------------------------------------------
203 -- Table structure for table `0_chart_class`
206 DROP TABLE IF EXISTS `0_chart_class`;
207 CREATE TABLE IF NOT EXISTS `0_chart_class` (
208 `cid` varchar(3) NOT NULL,
209 `class_name` varchar(60) NOT NULL default '',
210 `ctype` tinyint(1) NOT NULL default '0',
211 `inactive` tinyint(1) NOT NULL default '0',
216 -- Dumping data for table `0_chart_class`
219 INSERT INTO `0_chart_class` VALUES ('1', 'Assets', 1, 0);
220 INSERT INTO `0_chart_class` VALUES ('2', 'Liabilities', 2, 0);
221 INSERT INTO `0_chart_class` VALUES ('3', 'Income', 4, 0);
222 INSERT INTO `0_chart_class` VALUES ('4', 'Costs', 6, 0);
224 -- --------------------------------------------------------
227 -- Table structure for table `0_chart_master`
230 DROP TABLE IF EXISTS `0_chart_master`;
231 CREATE TABLE IF NOT EXISTS `0_chart_master` (
232 `account_code` varchar(15) NOT NULL default '',
233 `account_code2` varchar(15) NOT NULL default '',
234 `account_name` varchar(60) NOT NULL default '',
235 `account_type` varchar(10) NOT NULL default '0',
236 `inactive` tinyint(1) NOT NULL default '0',
237 PRIMARY KEY (`account_code`),
238 KEY `account_name` (`account_name`),
239 KEY `accounts_by_type` (`account_type`,`account_code`)
243 -- Dumping data for table `0_chart_master`
246 INSERT INTO `0_chart_master` VALUES ('1060', '', 'Checking Account', '1', 0);
247 INSERT INTO `0_chart_master` VALUES ('1065', '', 'Petty Cash', '1', 0);
248 INSERT INTO `0_chart_master` VALUES ('1200', '', 'Accounts Receivables', '1', 0);
249 INSERT INTO `0_chart_master` VALUES ('1205', '', 'Allowance for doubtful accounts', '1', 0);
250 INSERT INTO `0_chart_master` VALUES ('1510', '', 'Inventory', '2', 0);
251 INSERT INTO `0_chart_master` VALUES ('1520', '', 'Stocks of Raw Materials', '2', 0);
252 INSERT INTO `0_chart_master` VALUES ('1530', '', 'Stocks of Work In Progress', '2', 0);
253 INSERT INTO `0_chart_master` VALUES ('1540', '', 'Stocks of Finished Goods', '2', 0);
254 INSERT INTO `0_chart_master` VALUES ('1550', '', 'Goods Received Clearing account', '2', 0);
255 INSERT INTO `0_chart_master` VALUES ('1820', '', 'Office Furniture & Equipment', '3', 0);
256 INSERT INTO `0_chart_master` VALUES ('1825', '', 'Accum. Amort. -Furn. & Equip.', '3', 0);
257 INSERT INTO `0_chart_master` VALUES ('1840', '', 'Vehicle', '3', 0);
258 INSERT INTO `0_chart_master` VALUES ('1845', '', 'Accum. Amort. -Vehicle', '3', 0);
259 INSERT INTO `0_chart_master` VALUES ('2100', '', 'Accounts Payable', '4', 0);
260 INSERT INTO `0_chart_master` VALUES ('2110', '', 'Accrued Income Tax - Federal', '4', 0);
261 INSERT INTO `0_chart_master` VALUES ('2120', '', 'Accrued Income Tax - State', '4', 0);
262 INSERT INTO `0_chart_master` VALUES ('2130', '', 'Accrued Franchise Tax', '4', 0);
263 INSERT INTO `0_chart_master` VALUES ('2140', '', 'Accrued Real & Personal Prop Tax', '4', 0);
264 INSERT INTO `0_chart_master` VALUES ('2150', '', 'Sales Tax', '4', 0);
265 INSERT INTO `0_chart_master` VALUES ('2160', '', 'Accrued Use Tax Payable', '4', 0);
266 INSERT INTO `0_chart_master` VALUES ('2210', '', 'Accrued Wages', '4', 0);
267 INSERT INTO `0_chart_master` VALUES ('2220', '', 'Accrued Comp Time', '4', 0);
268 INSERT INTO `0_chart_master` VALUES ('2230', '', 'Accrued Holiday Pay', '4', 0);
269 INSERT INTO `0_chart_master` VALUES ('2240', '', 'Accrued Vacation Pay', '4', 0);
270 INSERT INTO `0_chart_master` VALUES ('2310', '', 'Accr. Benefits - 401K', '4', 0);
271 INSERT INTO `0_chart_master` VALUES ('2320', '', 'Accr. Benefits - Stock Purchase', '4', 0);
272 INSERT INTO `0_chart_master` VALUES ('2330', '', 'Accr. Benefits - Med, Den', '4', 0);
273 INSERT INTO `0_chart_master` VALUES ('2340', '', 'Accr. Benefits - Payroll Taxes', '4', 0);
274 INSERT INTO `0_chart_master` VALUES ('2350', '', 'Accr. Benefits - Credit Union', '4', 0);
275 INSERT INTO `0_chart_master` VALUES ('2360', '', 'Accr. Benefits - Savings Bond', '4', 0);
276 INSERT INTO `0_chart_master` VALUES ('2370', '', 'Accr. Benefits - Garnish', '4', 0);
277 INSERT INTO `0_chart_master` VALUES ('2380', '', 'Accr. Benefits - Charity Cont.', '4', 0);
278 INSERT INTO `0_chart_master` VALUES ('2620', '', 'Bank Loans', '5', 0);
279 INSERT INTO `0_chart_master` VALUES ('2680', '', 'Loans from Shareholders', '5', 0);
280 INSERT INTO `0_chart_master` VALUES ('3350', '', 'Common Shares', '6', 0);
281 INSERT INTO `0_chart_master` VALUES ('3590', '', 'Retained Earnings - prior years', '7', 0);
282 INSERT INTO `0_chart_master` VALUES ('4010', '', 'Sales', '8', 0);
283 INSERT INTO `0_chart_master` VALUES ('4430', '', 'Shipping & Handling', '9', 0);
284 INSERT INTO `0_chart_master` VALUES ('4440', '', 'Interest', '9', 0);
285 INSERT INTO `0_chart_master` VALUES ('4450', '', 'Foreign Exchange Gain', '9', 0);
286 INSERT INTO `0_chart_master` VALUES ('4500', '', 'Prompt Payment Discounts', '9', 0);
287 INSERT INTO `0_chart_master` VALUES ('4510', '', 'Discounts Given', '9', 0);
288 INSERT INTO `0_chart_master` VALUES ('5010', '', 'Cost of Goods Sold - Retail', '10', 0);
289 INSERT INTO `0_chart_master` VALUES ('5020', '', 'Material Usage Varaiance', '10', 0);
290 INSERT INTO `0_chart_master` VALUES ('5030', '', 'Consumable Materials', '10', 0);
291 INSERT INTO `0_chart_master` VALUES ('5040', '', 'Purchase price Variance', '10', 0);
292 INSERT INTO `0_chart_master` VALUES ('5050', '', 'Purchases of materials', '10', 0);
293 INSERT INTO `0_chart_master` VALUES ('5060', '', 'Discounts Received', '10', 0);
294 INSERT INTO `0_chart_master` VALUES ('5100', '', 'Freight', '10', 0);
295 INSERT INTO `0_chart_master` VALUES ('5410', '', 'Wages & Salaries', '11', 0);
296 INSERT INTO `0_chart_master` VALUES ('5420', '', 'Wages - Overtime', '11', 0);
297 INSERT INTO `0_chart_master` VALUES ('5430', '', 'Benefits - Comp Time', '11', 0);
298 INSERT INTO `0_chart_master` VALUES ('5440', '', 'Benefits - Payroll Taxes', '11', 0);
299 INSERT INTO `0_chart_master` VALUES ('5450', '', 'Benefits - Workers Comp', '11', 0);
300 INSERT INTO `0_chart_master` VALUES ('5460', '', 'Benefits - Pension', '11', 0);
301 INSERT INTO `0_chart_master` VALUES ('5470', '', 'Benefits - General Benefits', '11', 0);
302 INSERT INTO `0_chart_master` VALUES ('5510', '', 'Inc Tax Exp - Federal', '11', 0);
303 INSERT INTO `0_chart_master` VALUES ('5520', '', 'Inc Tax Exp - State', '11', 0);
304 INSERT INTO `0_chart_master` VALUES ('5530', '', 'Taxes - Real Estate', '11', 0);
305 INSERT INTO `0_chart_master` VALUES ('5540', '', 'Taxes - Personal Property', '11', 0);
306 INSERT INTO `0_chart_master` VALUES ('5550', '', 'Taxes - Franchise', '11', 0);
307 INSERT INTO `0_chart_master` VALUES ('5560', '', 'Taxes - Foreign Withholding', '11', 0);
308 INSERT INTO `0_chart_master` VALUES ('5610', '', 'Accounting & Legal', '12', 0);
309 INSERT INTO `0_chart_master` VALUES ('5615', '', 'Advertising & Promotions', '12', 0);
310 INSERT INTO `0_chart_master` VALUES ('5620', '', 'Bad Debts', '12', 0);
311 INSERT INTO `0_chart_master` VALUES ('5660', '', 'Amortization Expense', '12', 0);
312 INSERT INTO `0_chart_master` VALUES ('5685', '', 'Insurance', '12', 0);
313 INSERT INTO `0_chart_master` VALUES ('5690', '', 'Interest & Bank Charges', '12', 0);
314 INSERT INTO `0_chart_master` VALUES ('5700', '', 'Office Supplies', '12', 0);
315 INSERT INTO `0_chart_master` VALUES ('5760', '', 'Rent', '12', 0);
316 INSERT INTO `0_chart_master` VALUES ('5765', '', 'Repair & Maintenance', '12', 0);
317 INSERT INTO `0_chart_master` VALUES ('5780', '', 'Telephone', '12', 0);
318 INSERT INTO `0_chart_master` VALUES ('5785', '', 'Travel & Entertainment', '12', 0);
319 INSERT INTO `0_chart_master` VALUES ('5790', '', 'Utilities', '12', 0);
320 INSERT INTO `0_chart_master` VALUES ('5795', '', 'Registrations', '12', 0);
321 INSERT INTO `0_chart_master` VALUES ('5800', '', 'Licenses', '12', 0);
322 INSERT INTO `0_chart_master` VALUES ('5810', '', 'Foreign Exchange Loss', '12', 0);
323 INSERT INTO `0_chart_master` VALUES ('9990', '', 'Year Profit/Loss', '12', 0);
325 -- --------------------------------------------------------
328 -- Table structure for table `0_chart_types`
331 DROP TABLE IF EXISTS `0_chart_types`;
332 CREATE TABLE IF NOT EXISTS `0_chart_types` (
333 `id` varchar(10) NOT NULL,
334 `name` varchar(60) NOT NULL default '',
335 `class_id` varchar(3) NOT NULL default '',
336 `parent` varchar(10) NOT NULL default '-1',
337 `inactive` tinyint(1) NOT NULL default '0',
340 KEY `class_id` (`class_id`)
344 -- Dumping data for table `0_chart_types`
347 INSERT INTO `0_chart_types` VALUES ('1', 'Current Assets', '1', '', 0);
348 INSERT INTO `0_chart_types` VALUES ('2', 'Inventory Assets', '1', '', 0);
349 INSERT INTO `0_chart_types` VALUES ('3', 'Capital Assets', '1', '', 0);
350 INSERT INTO `0_chart_types` VALUES ('4', 'Current Liabilities', '2', '', 0);
351 INSERT INTO `0_chart_types` VALUES ('5', 'Long Term Liabilities', '2', '', 0);
352 INSERT INTO `0_chart_types` VALUES ('6', 'Share Capital', '2', '', 0);
353 INSERT INTO `0_chart_types` VALUES ('7', 'Retained Earnings', '2', '', 0);
354 INSERT INTO `0_chart_types` VALUES ('8', 'Sales Revenue', '3', '', 0);
355 INSERT INTO `0_chart_types` VALUES ('9', 'Other Revenue', '3', '', 0);
356 INSERT INTO `0_chart_types` VALUES ('10', 'Cost of Goods Sold', '4', '', 0);
357 INSERT INTO `0_chart_types` VALUES ('11', 'Payroll Expenses', '4', '', 0);
358 INSERT INTO `0_chart_types` VALUES ('12', 'General & Administrative expenses', '4', '', 0);
360 -- --------------------------------------------------------
363 -- Table structure for table `0_comments`
366 DROP TABLE IF EXISTS `0_comments`;
367 CREATE TABLE IF NOT EXISTS `0_comments` (
368 `type` int(11) NOT NULL default '0',
369 `id` int(11) NOT NULL default '0',
370 `date_` date default '0000-00-00',
372 KEY `type_and_id` (`type`,`id`)
376 -- Dumping data for table `0_comments`
379 -- --------------------------------------------------------
382 -- Table structure for table `0_credit_status`
385 DROP TABLE IF EXISTS `0_credit_status`;
386 CREATE TABLE IF NOT EXISTS `0_credit_status` (
387 `id` int(11) NOT NULL auto_increment,
388 `reason_description` char(100) NOT NULL default '',
389 `dissallow_invoices` tinyint(1) NOT NULL default '0',
390 `inactive` tinyint(1) NOT NULL default '0',
392 UNIQUE KEY `reason_description` (`reason_description`)
393 ) ENGINE=InnoDB AUTO_INCREMENT=5 ;
396 -- Dumping data for table `0_credit_status`
399 INSERT INTO `0_credit_status` VALUES (1, 'Good History', 0, 0);
400 INSERT INTO `0_credit_status` VALUES (3, 'No more work until payment received', 1, 0);
401 INSERT INTO `0_credit_status` VALUES (4, 'In liquidation', 1, 0);
403 -- --------------------------------------------------------
406 -- Table structure for table `0_crm_categories`
409 DROP TABLE IF EXISTS `0_crm_categories`;
410 CREATE TABLE IF NOT EXISTS `0_crm_categories` (
411 `id` int(11) NOT NULL auto_increment COMMENT 'pure technical key',
412 `type` varchar(20) NOT NULL COMMENT 'contact type e.g. customer',
413 `action` varchar(20) NOT NULL COMMENT 'detailed usage e.g. department',
414 `name` varchar(30) NOT NULL COMMENT 'for category selector',
415 `description` tinytext NOT NULL COMMENT 'usage description',
416 `system` tinyint(1) NOT NULL default '0' COMMENT 'nonzero for core system usage',
417 `inactive` tinyint(1) NOT NULL default '0',
419 UNIQUE KEY `type` (`type`,`action`),
420 UNIQUE KEY `type_2` (`type`,`name`)
421 ) ENGINE=InnoDB AUTO_INCREMENT=13 ;
424 -- Dumping data for table `0_crm_categories`
427 INSERT INTO `0_crm_categories` VALUES (1, 'cust_branch', 'general', 'General', 'General contact data for customer branch (overrides company setting)', 1, 0);
428 INSERT INTO `0_crm_categories` VALUES (2, 'cust_branch', 'invoice', 'Invoices', 'Invoice posting (overrides company setting)', 1, 0);
429 INSERT INTO `0_crm_categories` VALUES (3, 'cust_branch', 'order', 'Orders', 'Order confirmation (overrides company setting)', 1, 0);
430 INSERT INTO `0_crm_categories` VALUES (4, 'cust_branch', 'delivery', 'Deliveries', 'Delivery coordination (overrides company setting)', 1, 0);
431 INSERT INTO `0_crm_categories` VALUES (5, 'customer', 'general', 'General', 'General contact data for customer', 1, 0);
432 INSERT INTO `0_crm_categories` VALUES (6, 'customer', 'order', 'Orders', 'Order confirmation', 1, 0);
433 INSERT INTO `0_crm_categories` VALUES (7, 'customer', 'delivery', 'Deliveries', 'Delivery coordination', 1, 0);
434 INSERT INTO `0_crm_categories` VALUES (8, 'customer', 'invoice', 'Invoices', 'Invoice posting', 1, 0);
435 INSERT INTO `0_crm_categories` VALUES (9, 'supplier', 'general', 'General', 'General contact data for supplier', 1, 0);
436 INSERT INTO `0_crm_categories` VALUES (10, 'supplier', 'order', 'Orders', 'Order confirmation', 1, 0);
437 INSERT INTO `0_crm_categories` VALUES (11, 'supplier', 'delivery', 'Deliveries', 'Delivery coordination', 1, 0);
438 INSERT INTO `0_crm_categories` VALUES (12, 'supplier', 'invoice', 'Invoices', 'Invoice posting', 1, 0);
440 -- --------------------------------------------------------
443 -- Table structure for table `0_crm_contacts`
446 DROP TABLE IF EXISTS `0_crm_contacts`;
447 CREATE TABLE IF NOT EXISTS `0_crm_contacts` (
448 `id` int(11) NOT NULL auto_increment,
449 `person_id` int(11) NOT NULL default '0' COMMENT 'foreign key to crm_contacts',
450 `type` varchar(20) NOT NULL COMMENT 'foreign key to crm_categories',
451 `action` varchar(20) NOT NULL COMMENT 'foreign key to crm_categories',
452 `entity_id` varchar(11) default NULL COMMENT 'entity id in related class table',
454 KEY `type` (`type`,`action`)
458 -- Dumping data for table `0_crm_contacts`
461 -- --------------------------------------------------------
464 -- Table structure for table `0_crm_persons`
467 DROP TABLE IF EXISTS `0_crm_persons`;
468 CREATE TABLE IF NOT EXISTS `0_crm_persons` (
469 `id` int(11) NOT NULL auto_increment,
470 `ref` varchar(30) NOT NULL,
471 `name` varchar(60) NOT NULL,
472 `name2` varchar(60) default NULL,
474 `phone` varchar(30) default NULL,
475 `phone2` varchar(30) default NULL,
476 `fax` varchar(30) default NULL,
477 `email` varchar(100) default NULL,
478 `lang` char(5) default NULL,
479 `notes` tinytext NOT NULL,
480 `inactive` tinyint(1) NOT NULL default '0',
486 -- Dumping data for table `0_crm_persons`
489 -- --------------------------------------------------------
492 -- Table structure for table `0_currencies`
495 DROP TABLE IF EXISTS `0_currencies`;
496 CREATE TABLE IF NOT EXISTS `0_currencies` (
497 `currency` varchar(60) NOT NULL default '',
498 `curr_abrev` char(3) NOT NULL default '',
499 `curr_symbol` varchar(10) NOT NULL default '',
500 `country` varchar(100) NOT NULL default '',
501 `hundreds_name` varchar(15) NOT NULL default '',
502 `auto_update` tinyint(1) NOT NULL default '1',
503 `inactive` tinyint(1) NOT NULL default '0',
504 PRIMARY KEY (`curr_abrev`)
508 -- Dumping data for table `0_currencies`
511 INSERT INTO `0_currencies` VALUES ('US Dollars', 'USD', '$', 'United States', 'Cents', 1, 0);
512 INSERT INTO `0_currencies` VALUES ('CA Dollars', 'CAD', '$', 'Canada', 'Cents', 1, 0);
513 INSERT INTO `0_currencies` VALUES ('Euro', 'EUR', '€', 'Europe', 'Cents', 1, 0);
514 INSERT INTO `0_currencies` VALUES ('Pounds', 'GBP', '£', 'England', 'Pence', 1, 0);
516 -- --------------------------------------------------------
519 -- Table structure for table `0_cust_allocations`
522 DROP TABLE IF EXISTS `0_cust_allocations`;
523 CREATE TABLE IF NOT EXISTS `0_cust_allocations` (
524 `id` int(11) NOT NULL auto_increment,
525 `person_id` int(11) DEFAULT NULL,
526 `amt` double unsigned default NULL,
527 `date_alloc` date NOT NULL default '0000-00-00',
528 `trans_no_from` int(11) default NULL,
529 `trans_type_from` int(11) default NULL,
530 `trans_no_to` int(11) default NULL,
531 `trans_type_to` int(11) default NULL,
533 UNIQUE KEY `trans_type_from` (`person_id`,`trans_type_from`,`trans_no_from`,`trans_type_to`,`trans_no_to`),
534 KEY `From` (`trans_type_from`,`trans_no_from`),
535 KEY `To` (`trans_type_to`,`trans_no_to`)
539 -- Dumping data for table `0_cust_allocations`
542 -- --------------------------------------------------------
545 -- Table structure for table `0_cust_branch`
548 DROP TABLE IF EXISTS `0_cust_branch`;
549 CREATE TABLE IF NOT EXISTS `0_cust_branch` (
550 `branch_code` int(11) NOT NULL auto_increment,
551 `debtor_no` int(11) NOT NULL default '0',
552 `br_name` varchar(60) NOT NULL default '',
553 `branch_ref` varchar(30) NOT NULL default '',
554 `br_address` tinytext NOT NULL,
555 `area` int(11) default NULL,
556 `salesman` int(11) NOT NULL default '0',
557 `default_location` varchar(5) NOT NULL default '',
558 `tax_group_id` int(11) default NULL,
559 `sales_account` varchar(15) NOT NULL default '',
560 `sales_discount_account` varchar(15) NOT NULL default '',
561 `receivables_account` varchar(15) NOT NULL default '',
562 `payment_discount_account` varchar(15) NOT NULL default '',
563 `default_ship_via` int(11) NOT NULL default '1',
564 `br_post_address` tinytext NOT NULL,
565 `group_no` int(11) NOT NULL default '0',
566 `notes` tinytext NOT NULL,
567 `bank_account` varchar(60) DEFAULT NULL,
568 `inactive` tinyint(1) NOT NULL default '0',
569 PRIMARY KEY (`branch_code`,`debtor_no`),
570 KEY `branch_ref` (`branch_ref`),
571 KEY `group_no` (`group_no`)
575 -- Dumping data for table `0_cust_branch`
578 -- --------------------------------------------------------
581 -- Table structure for table `0_debtors_master`
584 DROP TABLE IF EXISTS `0_debtors_master`;
585 CREATE TABLE IF NOT EXISTS `0_debtors_master` (
586 `debtor_no` int(11) NOT NULL auto_increment,
587 `name` varchar(100) NOT NULL default '',
588 `debtor_ref` varchar(30) NOT NULL,
590 `tax_id` varchar(55) NOT NULL default '',
591 `curr_code` char(3) NOT NULL default '',
592 `sales_type` int(11) NOT NULL default '1',
593 `dimension_id` int(11) NOT NULL default '0',
594 `dimension2_id` int(11) NOT NULL default '0',
595 `credit_status` int(11) NOT NULL default '0',
596 `payment_terms` int(11) default NULL,
597 `discount` double NOT NULL default '0',
598 `pymt_discount` double NOT NULL default '0',
599 `credit_limit` float NOT NULL default '1000',
600 `notes` tinytext NOT NULL,
601 `inactive` tinyint(1) NOT NULL default '0',
602 PRIMARY KEY (`debtor_no`),
604 UNIQUE KEY `debtor_ref` (`debtor_ref`)
608 -- Dumping data for table `0_debtors_master`
611 -- --------------------------------------------------------
614 -- Table structure for table `0_debtor_trans`
617 DROP TABLE IF EXISTS `0_debtor_trans`;
618 CREATE TABLE IF NOT EXISTS `0_debtor_trans` (
619 `trans_no` int(11) unsigned NOT NULL default '0',
620 `type` smallint(6) unsigned NOT NULL default '0',
621 `version` tinyint(1) unsigned NOT NULL default '0',
622 `debtor_no` int(11) unsigned default NULL,
623 `branch_code` int(11) NOT NULL default '-1',
624 `tran_date` date NOT NULL default '0000-00-00',
625 `due_date` date NOT NULL default '0000-00-00',
626 `reference` varchar(60) NOT NULL default '',
627 `tpe` int(11) NOT NULL default '0',
628 `order_` int(11) NOT NULL default '0',
629 `ov_amount` double NOT NULL default '0',
630 `ov_gst` double NOT NULL default '0',
631 `ov_freight` double NOT NULL default '0',
632 `ov_freight_tax` double NOT NULL default '0',
633 `ov_discount` double NOT NULL default '0',
634 `alloc` double NOT NULL default '0',
635 `prep_amount` double NOT NULL DEFAULT '0',
636 `rate` double NOT NULL default '1',
637 `ship_via` int(11) default NULL,
638 `dimension_id` int(11) NOT NULL default '0',
639 `dimension2_id` int(11) NOT NULL default '0',
640 `payment_terms` int(11) default NULL,
641 `tax_included` tinyint(1) unsigned NOT NULL default '0',
642 PRIMARY KEY (`type`,`trans_no`),
643 KEY `debtor_no` (`debtor_no`,`branch_code`),
644 KEY `tran_date` (`tran_date`),
645 KEY `order_` (`order_`)
649 -- Dumping data for table `0_debtor_trans`
652 -- --------------------------------------------------------
655 -- Table structure for table `0_debtor_trans_details`
658 DROP TABLE IF EXISTS `0_debtor_trans_details`;
659 CREATE TABLE IF NOT EXISTS `0_debtor_trans_details` (
660 `id` int(11) NOT NULL auto_increment,
661 `debtor_trans_no` int(11) default NULL,
662 `debtor_trans_type` int(11) default NULL,
663 `stock_id` varchar(20) NOT NULL default '',
664 `description` tinytext,
665 `unit_price` double NOT NULL default '0',
666 `unit_tax` double NOT NULL default '0',
667 `quantity` double NOT NULL default '0',
668 `discount_percent` double NOT NULL default '0',
669 `standard_cost` double NOT NULL default '0',
670 `qty_done` double NOT NULL default '0',
671 `src_id` int(11) NOT NULL,
673 KEY `Transaction` (`debtor_trans_type`,`debtor_trans_no`),
678 -- Dumping data for table `0_debtor_trans_details`
681 -- --------------------------------------------------------
684 -- Table structure for table `0_dimensions`
687 DROP TABLE IF EXISTS `0_dimensions`;
688 CREATE TABLE IF NOT EXISTS `0_dimensions` (
689 `id` int(11) NOT NULL auto_increment,
690 `reference` varchar(60) NOT NULL default '',
691 `name` varchar(60) NOT NULL default '',
692 `type_` tinyint(1) NOT NULL default '1',
693 `closed` tinyint(1) NOT NULL default '0',
694 `date_` date NOT NULL default '0000-00-00',
695 `due_date` date NOT NULL default '0000-00-00',
697 UNIQUE KEY `reference` (`reference`),
698 KEY `date_` (`date_`),
699 KEY `due_date` (`due_date`),
700 KEY `type_` (`type_`)
704 -- Dumping data for table `0_dimensions`
707 -- --------------------------------------------------------
710 -- Table structure for table `0_exchange_rates`
713 DROP TABLE IF EXISTS `0_exchange_rates`;
714 CREATE TABLE IF NOT EXISTS `0_exchange_rates` (
715 `id` int(11) NOT NULL auto_increment,
716 `curr_code` char(3) NOT NULL default '',
717 `rate_buy` double NOT NULL default '0',
718 `rate_sell` double NOT NULL default '0',
719 `date_` date NOT NULL default '0000-00-00',
721 UNIQUE KEY `curr_code` (`curr_code`,`date_`)
725 -- Dumping data for table `0_exchange_rates`
728 -- --------------------------------------------------------
731 -- Table structure for table `0_fiscal_year`
734 DROP TABLE IF EXISTS `0_fiscal_year`;
735 CREATE TABLE IF NOT EXISTS `0_fiscal_year` (
736 `id` int(11) NOT NULL auto_increment,
737 `begin` date default '0000-00-00',
738 `end` date default '0000-00-00',
739 `closed` tinyint(1) NOT NULL default '0',
741 UNIQUE KEY `begin` (`begin`),
742 UNIQUE KEY `end` (`end`)
743 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
746 -- Dumping data for table `0_fiscal_year`
749 INSERT INTO `0_fiscal_year` VALUES (1, '2016-01-01', '2016-12-31', 0);
751 -- --------------------------------------------------------
754 -- Table structure for table `0_gl_trans`
757 DROP TABLE IF EXISTS `0_gl_trans`;
758 CREATE TABLE IF NOT EXISTS `0_gl_trans` (
759 `counter` int(11) NOT NULL auto_increment,
760 `type` smallint(6) NOT NULL default '0',
761 `type_no` int(11) NOT NULL default '0',
762 `tran_date` date NOT NULL default '0000-00-00',
763 `account` varchar(15) NOT NULL default '',
764 `memo_` tinytext NOT NULL,
765 `amount` double NOT NULL default '0',
766 `dimension_id` int(11) NOT NULL default '0',
767 `dimension2_id` int(11) NOT NULL default '0',
768 `person_type_id` int(11) default NULL,
769 `person_id` tinyblob,
770 PRIMARY KEY (`counter`),
771 KEY `Type_and_Number` (`type`,`type_no`),
772 KEY `dimension_id` (`dimension_id`),
773 KEY `dimension2_id` (`dimension2_id`),
774 KEY `tran_date` (`tran_date`),
775 KEY `account_and_tran_date` (`account`,`tran_date`)
779 -- Dumping data for table `0_gl_trans`
782 -- --------------------------------------------------------
785 -- Table structure for table `0_grn_batch`
788 DROP TABLE IF EXISTS `0_grn_batch`;
789 CREATE TABLE IF NOT EXISTS `0_grn_batch` (
790 `id` int(11) NOT NULL auto_increment,
791 `supplier_id` int(11) NOT NULL default '0',
792 `purch_order_no` int(11) default NULL,
793 `reference` varchar(60) NOT NULL default '',
794 `delivery_date` date NOT NULL default '0000-00-00',
795 `loc_code` varchar(5) default NULL,
796 `rate` double NULL default '1',
798 KEY `delivery_date` (`delivery_date`),
799 KEY `purch_order_no` (`purch_order_no`)
803 -- Dumping data for table `0_grn_batch`
806 -- --------------------------------------------------------
809 -- Table structure for table `0_grn_items`
812 DROP TABLE IF EXISTS `0_grn_items`;
813 CREATE TABLE IF NOT EXISTS `0_grn_items` (
814 `id` int(11) NOT NULL auto_increment,
815 `grn_batch_id` int(11) default NULL,
816 `po_detail_item` int(11) NOT NULL default '0',
817 `item_code` varchar(20) NOT NULL default '',
818 `description` tinytext,
819 `qty_recd` double NOT NULL default '0',
820 `quantity_inv` double NOT NULL default '0',
822 KEY `grn_batch_id` (`grn_batch_id`)
826 -- Dumping data for table `0_grn_items`
829 -- --------------------------------------------------------
832 -- Table structure for table `0_groups`
835 DROP TABLE IF EXISTS `0_groups`;
836 CREATE TABLE IF NOT EXISTS `0_groups` (
837 `id` smallint(6) unsigned NOT NULL auto_increment,
838 `description` varchar(60) NOT NULL default '',
839 `inactive` tinyint(1) NOT NULL default '0',
841 UNIQUE KEY `description` (`description`)
842 ) ENGINE=InnoDB AUTO_INCREMENT=4 ;
845 -- Dumping data for table `0_groups`
848 INSERT INTO `0_groups` VALUES (1, 'Small', 0);
849 INSERT INTO `0_groups` VALUES (2, 'Medium', 0);
850 INSERT INTO `0_groups` VALUES (3, 'Large', 0);
852 -- --------------------------------------------------------
855 -- Table structure for table `0_item_codes`
858 DROP TABLE IF EXISTS `0_item_codes`;
859 CREATE TABLE IF NOT EXISTS `0_item_codes` (
860 `id` int(11) unsigned NOT NULL auto_increment,
861 `item_code` varchar(20) NOT NULL,
862 `stock_id` varchar(20) NOT NULL,
863 `description` varchar(200) NOT NULL default '',
864 `category_id` smallint(6) unsigned NOT NULL,
865 `quantity` double NOT NULL default '1',
866 `is_foreign` tinyint(1) NOT NULL default '0',
867 `inactive` tinyint(1) NOT NULL default '0',
869 UNIQUE KEY `stock_id` (`stock_id`,`item_code`),
870 KEY `item_code` (`item_code`)
874 -- Dumping data for table `0_item_codes`
877 -- --------------------------------------------------------
880 -- Table structure for table `0_item_tax_types`
883 DROP TABLE IF EXISTS `0_item_tax_types`;
884 CREATE TABLE IF NOT EXISTS `0_item_tax_types` (
885 `id` int(11) NOT NULL auto_increment,
886 `name` varchar(60) NOT NULL default '',
887 `exempt` tinyint(1) NOT NULL default '0',
888 `inactive` tinyint(1) NOT NULL default '0',
890 UNIQUE KEY `name` (`name`)
891 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
894 -- Dumping data for table `0_item_tax_types`
897 INSERT INTO `0_item_tax_types` VALUES (1, 'Regular', 0, 0);
899 -- --------------------------------------------------------
902 -- Table structure for table `0_item_tax_type_exemptions`
905 DROP TABLE IF EXISTS `0_item_tax_type_exemptions`;
906 CREATE TABLE IF NOT EXISTS `0_item_tax_type_exemptions` (
907 `item_tax_type_id` int(11) NOT NULL default '0',
908 `tax_type_id` int(11) NOT NULL default '0',
909 PRIMARY KEY (`item_tax_type_id`,`tax_type_id`)
913 -- Dumping data for table `0_item_tax_type_exemptions`
916 -- --------------------------------------------------------
919 -- Table structure for table `0_item_units`
922 DROP TABLE IF EXISTS `0_item_units`;
923 CREATE TABLE IF NOT EXISTS `0_item_units` (
924 `abbr` varchar(20) NOT NULL,
925 `name` varchar(40) NOT NULL,
926 `decimals` tinyint(2) NOT NULL,
927 `inactive` tinyint(1) NOT NULL default '0',
928 PRIMARY KEY (`abbr`),
929 UNIQUE KEY `name` (`name`)
933 -- Dumping data for table `0_item_units`
936 INSERT INTO `0_item_units` VALUES ('each', 'Each', 0, 0);
937 INSERT INTO `0_item_units` VALUES ('hr', 'Hours', 0, 0);
939 -- --------------------------------------------------------
942 -- Table structure for table `0_journal`
945 DROP TABLE IF EXISTS `0_journal`;
946 CREATE TABLE `0_journal` (
947 `type` smallint(6) NOT NULL DEFAULT '0',
948 `trans_no` int(11) NOT NULL DEFAULT '0',
949 `tran_date` date DEFAULT '0000-00-00',
950 `reference` varchar(60) NOT NULL DEFAULT '',
951 `source_ref` varchar(60) NOT NULL DEFAULT '',
952 `event_date` date DEFAULT '0000-00-00',
953 `doc_date` date NOT NULL DEFAULT '0000-00-00',
954 `currency` char(3) NOT NULL DEFAULT '',
955 `amount` double NOT NULL DEFAULT '0',
956 `rate` double NOT NULL DEFAULT '1',
957 PRIMARY KEY (`type`,`trans_no`),
958 KEY `tran_date` (`tran_date`)
962 -- Dumping data for table `0_journal`
965 -- --------------------------------------------------------
968 -- Table structure for table `0_locations`
971 DROP TABLE IF EXISTS `0_locations`;
972 CREATE TABLE IF NOT EXISTS `0_locations` (
973 `loc_code` varchar(5) NOT NULL default '',
974 `location_name` varchar(60) NOT NULL default '',
975 `delivery_address` tinytext NOT NULL,
976 `phone` varchar(30) NOT NULL default '',
977 `phone2` varchar(30) NOT NULL default '',
978 `fax` varchar(30) NOT NULL default '',
979 `email` varchar(100) NOT NULL default '',
980 `contact` varchar(30) NOT NULL default '',
981 `fixed_asset` tinyint(1) NOT NULL DEFAULT '0',
982 `inactive` tinyint(1) NOT NULL default '0',
983 PRIMARY KEY (`loc_code`)
987 -- Dumping data for table `0_locations`
990 INSERT INTO `0_locations` VALUES ('DEF', 'Default', 'N/A', '', '', '', '', '', 0, 0);
992 -- --------------------------------------------------------
995 -- Table structure for table `0_loc_stock`
998 DROP TABLE IF EXISTS `0_loc_stock`;
999 CREATE TABLE IF NOT EXISTS `0_loc_stock` (
1000 `loc_code` char(5) NOT NULL default '',
1001 `stock_id` char(20) NOT NULL default '',
1002 `reorder_level` double NOT NULL default '0',
1003 PRIMARY KEY (`loc_code`,`stock_id`),
1004 KEY `stock_id` (`stock_id`)
1008 -- Dumping data for table `0_loc_stock`
1011 -- --------------------------------------------------------
1014 -- Table structure for table `0_payment_terms`
1017 DROP TABLE IF EXISTS `0_payment_terms`;
1018 CREATE TABLE IF NOT EXISTS `0_payment_terms` (
1019 `terms_indicator` int(11) NOT NULL auto_increment,
1020 `terms` char(80) NOT NULL default '',
1021 `days_before_due` smallint(6) NOT NULL default '0',
1022 `day_in_following_month` smallint(6) NOT NULL default '0',
1023 `inactive` tinyint(1) NOT NULL default '0',
1024 PRIMARY KEY (`terms_indicator`),
1025 UNIQUE KEY `terms` (`terms`)
1026 ) ENGINE=InnoDB AUTO_INCREMENT=5 ;
1029 -- Dumping data for table `0_payment_terms`
1032 INSERT INTO `0_payment_terms` VALUES (1, 'Due 15th Of the Following Month', 0, 17, 0);
1033 INSERT INTO `0_payment_terms` VALUES (2, 'Due By End Of The Following Month', 0, 30, 0);
1034 INSERT INTO `0_payment_terms` VALUES (3, 'Payment due within 10 days', 10, 0, 0);
1035 INSERT INTO `0_payment_terms` VALUES (4, 'Cash Only', 0, 0, 0);
1037 -- --------------------------------------------------------
1040 -- Table structure for table `0_prices`
1043 DROP TABLE IF EXISTS `0_prices`;
1044 CREATE TABLE IF NOT EXISTS `0_prices` (
1045 `id` int(11) NOT NULL auto_increment,
1046 `stock_id` varchar(20) NOT NULL default '',
1047 `sales_type_id` int(11) NOT NULL default '0',
1048 `curr_abrev` char(3) NOT NULL default '',
1049 `price` double NOT NULL default '0',
1051 UNIQUE KEY `price` (`stock_id`,`sales_type_id`,`curr_abrev`)
1055 -- Dumping data for table `0_prices`
1058 -- --------------------------------------------------------
1061 -- Table structure for table `0_printers`
1064 DROP TABLE IF EXISTS `0_printers`;
1065 CREATE TABLE IF NOT EXISTS `0_printers` (
1066 `id` tinyint(3) unsigned NOT NULL auto_increment,
1067 `name` varchar(20) NOT NULL,
1068 `description` varchar(60) NOT NULL,
1069 `queue` varchar(20) NOT NULL,
1070 `host` varchar(40) NOT NULL,
1071 `port` smallint(11) unsigned NOT NULL,
1072 `timeout` tinyint(3) unsigned NOT NULL,
1074 UNIQUE KEY `name` (`name`)
1075 ) ENGINE=InnoDB AUTO_INCREMENT=4 ;
1078 -- Dumping data for table `0_printers`
1081 INSERT INTO `0_printers` VALUES (1, 'QL500', 'Label printer', 'QL500', 'server', 127, 20);
1082 INSERT INTO `0_printers` VALUES (2, 'Samsung', 'Main network printer', 'scx4521F', 'server', 515, 5);
1083 INSERT INTO `0_printers` VALUES (3, 'Local', 'Local print server at user IP', 'lp', '', 515, 10);
1085 -- --------------------------------------------------------
1088 -- Table structure for table `0_print_profiles`
1091 DROP TABLE IF EXISTS `0_print_profiles`;
1092 CREATE TABLE IF NOT EXISTS `0_print_profiles` (
1093 `id` smallint(6) unsigned NOT NULL auto_increment,
1094 `profile` varchar(30) NOT NULL,
1095 `report` varchar(5) default NULL,
1096 `printer` tinyint(3) unsigned default NULL,
1098 UNIQUE KEY `profile` (`profile`,`report`)
1099 ) ENGINE=InnoDB AUTO_INCREMENT=10 ;
1102 -- Dumping data for table `0_print_profiles`
1105 INSERT INTO `0_print_profiles` VALUES (1, 'Out of office', '', 0);
1106 INSERT INTO `0_print_profiles` VALUES (2, 'Sales Department', '', 0);
1107 INSERT INTO `0_print_profiles` VALUES (3, 'Central', '', 2);
1108 INSERT INTO `0_print_profiles` VALUES (4, 'Sales Department', '104', 2);
1109 INSERT INTO `0_print_profiles` VALUES (5, 'Sales Department', '105', 2);
1110 INSERT INTO `0_print_profiles` VALUES (6, 'Sales Department', '107', 2);
1111 INSERT INTO `0_print_profiles` VALUES (7, 'Sales Department', '109', 2);
1112 INSERT INTO `0_print_profiles` VALUES (8, 'Sales Department', '110', 2);
1113 INSERT INTO `0_print_profiles` VALUES (9, 'Sales Department', '201', 2);
1115 -- --------------------------------------------------------
1118 -- Table structure for table `0_purch_data`
1121 DROP TABLE IF EXISTS `0_purch_data`;
1122 CREATE TABLE IF NOT EXISTS `0_purch_data` (
1123 `supplier_id` int(11) NOT NULL default '0',
1124 `stock_id` char(20) NOT NULL default '',
1125 `price` double NOT NULL default '0',
1126 `suppliers_uom` char(50) NOT NULL default '',
1127 `conversion_factor` double NOT NULL default '1',
1128 `supplier_description` char(50) NOT NULL default '',
1129 PRIMARY KEY (`supplier_id`,`stock_id`)
1133 -- Dumping data for table `0_purch_data`
1136 -- --------------------------------------------------------
1139 -- Table structure for table `0_purch_orders`
1142 DROP TABLE IF EXISTS `0_purch_orders`;
1143 CREATE TABLE IF NOT EXISTS `0_purch_orders` (
1144 `order_no` int(11) NOT NULL auto_increment,
1145 `supplier_id` int(11) NOT NULL default '0',
1146 `comments` tinytext,
1147 `ord_date` date NOT NULL default '0000-00-00',
1148 `reference` tinytext NOT NULL,
1149 `requisition_no` tinytext,
1150 `into_stock_location` varchar(5) NOT NULL default '',
1151 `delivery_address` tinytext NOT NULL,
1152 `total` double NOT NULL default '0',
1153 `prep_amount` double NOT NULL DEFAULT '0',
1154 `alloc` double NOT NULL DEFAULT '0',
1155 `tax_included` tinyint(1) NOT NULL default '0',
1156 PRIMARY KEY (`order_no`),
1157 KEY `ord_date` (`ord_date`)
1161 -- Dumping data for table `0_purch_orders`
1164 -- --------------------------------------------------------
1167 -- Table structure for table `0_purch_order_details`
1170 DROP TABLE IF EXISTS `0_purch_order_details`;
1171 CREATE TABLE IF NOT EXISTS `0_purch_order_details` (
1172 `po_detail_item` int(11) NOT NULL auto_increment,
1173 `order_no` int(11) NOT NULL default '0',
1174 `item_code` varchar(20) NOT NULL default '',
1175 `description` tinytext,
1176 `delivery_date` date NOT NULL default '0000-00-00',
1177 `qty_invoiced` double NOT NULL default '0',
1178 `unit_price` double NOT NULL default '0',
1179 `act_price` double NOT NULL default '0',
1180 `std_cost_unit` double NOT NULL default '0',
1181 `quantity_ordered` double NOT NULL default '0',
1182 `quantity_received` double NOT NULL default '0',
1183 PRIMARY KEY (`po_detail_item`),
1184 KEY `order` (`order_no`,`po_detail_item`),
1185 KEY `itemcode` (`item_code`)
1189 -- Dumping data for table `0_purch_order_details`
1192 -- --------------------------------------------------------
1195 -- Table structure for table `0_quick_entries`
1198 DROP TABLE IF EXISTS `0_quick_entries`;
1199 CREATE TABLE IF NOT EXISTS `0_quick_entries` (
1200 `id` smallint(6) unsigned NOT NULL auto_increment,
1201 `type` tinyint(1) NOT NULL default '0',
1202 `description` varchar(60) NOT NULL,
1203 `usage` varchar(120) NULL,
1204 `base_amount` double NOT NULL default '0',
1205 `base_desc` varchar(60) default NULL,
1206 `bal_type` tinyint(1) NOT NULL default '0',
1208 KEY `description` (`description`)
1209 ) ENGINE=InnoDB AUTO_INCREMENT=4 ;
1212 -- Dumping data for table `0_quick_entries`
1215 INSERT INTO `0_quick_entries` VALUES (1, 1, 'Maintenance', NULL, 0, 'Amount', 0);
1216 INSERT INTO `0_quick_entries` VALUES (2, 4, 'Phone', NULL, 0, 'Amount', 0);
1217 INSERT INTO `0_quick_entries` VALUES (3, 2, 'Cash Sales', 'Retail sales without invoice', 0, 'Amount', 0);
1219 -- --------------------------------------------------------
1222 -- Table structure for table `0_quick_entry_lines`
1225 DROP TABLE IF EXISTS `0_quick_entry_lines`;
1226 CREATE TABLE IF NOT EXISTS `0_quick_entry_lines` (
1227 `id` smallint(6) unsigned NOT NULL auto_increment,
1228 `qid` smallint(6) unsigned NOT NULL,
1229 `amount` double default '0',
1230 `memo` tinytext NOT NULL,
1231 `action` varchar(2) NOT NULL,
1232 `dest_id` varchar(15) NOT NULL default '',
1233 `dimension_id` smallint(6) unsigned default NULL,
1234 `dimension2_id` smallint(6) unsigned default NULL,
1237 ) ENGINE=InnoDB AUTO_INCREMENT=7 ;
1240 -- Dumping data for table `0_quick_entry_lines`
1243 INSERT INTO `0_quick_entry_lines` VALUES (1, 1, 0, '', 't-', '1', 0, 0);
1244 INSERT INTO `0_quick_entry_lines` VALUES (2, 2, 0, '', 't-', '1', 0, 0);
1245 INSERT INTO `0_quick_entry_lines` VALUES (3, 3, 0, '', 't-', '1', 0, 0);
1246 INSERT INTO `0_quick_entry_lines` VALUES (4, 3, 0, '', '=', '4010', 0, 0);
1247 INSERT INTO `0_quick_entry_lines` VALUES (5, 1, 0, '', '=', '5765', 0, 0);
1248 INSERT INTO `0_quick_entry_lines` VALUES (6, 2, 0, '', '=', '5780', 0, 0);
1250 -- --------------------------------------------------------
1253 -- Table structure for table `0_recurrent_invoices`
1256 DROP TABLE IF EXISTS `0_recurrent_invoices`;
1257 CREATE TABLE IF NOT EXISTS `0_recurrent_invoices` (
1258 `id` smallint(6) unsigned NOT NULL auto_increment,
1259 `description` varchar(60) NOT NULL default '',
1260 `order_no` int(11) unsigned NOT NULL,
1261 `debtor_no` int(11) unsigned default NULL,
1262 `group_no` smallint(6) unsigned default NULL,
1263 `days` int(11) NOT NULL default '0',
1264 `monthly` int(11) NOT NULL default '0',
1265 `begin` date NOT NULL default '0000-00-00',
1266 `end` date NOT NULL default '0000-00-00',
1267 `last_sent` date NOT NULL default '0000-00-00',
1269 UNIQUE KEY `description` (`description`)
1273 -- Dumping data for table `0_recurrent_invoices`
1276 -- --------------------------------------------------------
1279 -- Table structure for table `0_reflines`
1282 DROP TABLE IF EXISTS `0_reflines`;
1284 CREATE TABLE `0_reflines` (
1285 `id` int(11) NOT NULL AUTO_INCREMENT,
1286 `trans_type` int(11) NOT NULL,
1287 `prefix` char(5) NOT NULL DEFAULT '',
1288 `pattern` varchar(35) NOT NULL DEFAULT '1',
1289 `description` varchar(60) NOT NULL DEFAULT '',
1290 `default` tinyint(1) NOT NULL DEFAULT '0',
1291 `inactive` tinyint(1) NOT NULL DEFAULT '0',
1293 UNIQUE KEY `prefix` (`trans_type`, `prefix`)
1294 ) ENGINE=InnoDB AUTO_INCREMENT=23;
1297 -- Dumping data for table `0_reflines`
1300 INSERT INTO `0_reflines` VALUES
1301 ('1', '0', '', '{001}/{YYYY}', '', '1', '0'),
1302 ('2', '1', '', '{001}/{YYYY}', '', '1', '0'),
1303 ('3', '2', '', '{001}/{YYYY}', '', '1', '0'),
1304 ('4', '4', '', '{001}/{YYYY}', '', '1', '0'),
1305 ('5', '10', '', '{001}/{YYYY}', '', '1', '0'),
1306 ('6', '11', '', '{001}/{YYYY}', '', '1', '0'),
1307 ('7', '12', '', '{001}/{YYYY}', '', '1', '0'),
1308 ('8', '13', '', '{001}/{YYYY}', '', '1', '0'),
1309 ('9', '16', '', '{001}/{YYYY}', '', '1', '0'),
1310 ('10', '17', '', '{001}/{YYYY}', '', '1', '0'),
1311 ('11', '18', '', '{001}/{YYYY}', '', '1', '0'),
1312 ('12', '20', '', '{001}/{YYYY}', '', '1', '0'),
1313 ('13', '21', '', '{001}/{YYYY}', '', '1', '0'),
1314 ('14', '22', '', '{001}/{YYYY}', '', '1', '0'),
1315 ('15', '25', '', '{001}/{YYYY}', '', '1', '0'),
1316 ('16', '26', '', '{001}/{YYYY}', '', '1', '0'),
1317 ('17', '28', '', '{001}/{YYYY}', '', '1', '0'),
1318 ('18', '29', '', '{001}/{YYYY}', '', '1', '0'),
1319 ('19', '30', '', '{001}/{YYYY}', '', '1', '0'),
1320 ('20', '32', '', '{001}/{YYYY}', '', '1', '0'),
1321 ('21', '35', '', '{001}/{YYYY}', '', '1', '0'),
1322 ('22', '40', '', '{001}/{YYYY}', '', '1', '0');
1324 -- --------------------------------------------------------
1327 -- Table structure for table `0_refs`
1330 DROP TABLE IF EXISTS `0_refs`;
1331 CREATE TABLE IF NOT EXISTS `0_refs` (
1332 `id` int(11) NOT NULL default '0',
1333 `type` int(11) NOT NULL default '0',
1334 `reference` varchar(100) NOT NULL default '',
1335 PRIMARY KEY (`id`,`type`),
1336 KEY `Type_and_Reference` (`type`,`reference`)
1340 -- Dumping data for table `0_refs`
1343 -- --------------------------------------------------------
1346 -- Table structure for table `0_salesman`
1349 DROP TABLE IF EXISTS `0_salesman`;
1350 CREATE TABLE IF NOT EXISTS `0_salesman` (
1351 `salesman_code` int(11) NOT NULL auto_increment,
1352 `salesman_name` char(60) NOT NULL default '',
1353 `salesman_phone` char(30) NOT NULL default '',
1354 `salesman_fax` char(30) NOT NULL default '',
1355 `salesman_email` varchar(100) NOT NULL default '',
1356 `provision` double NOT NULL default '0',
1357 `break_pt` double NOT NULL default '0',
1358 `provision2` double NOT NULL default '0',
1359 `inactive` tinyint(1) NOT NULL default '0',
1360 PRIMARY KEY (`salesman_code`),
1361 UNIQUE KEY `salesman_name` (`salesman_name`)
1362 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
1365 -- Dumping data for table `0_salesman`
1368 INSERT INTO `0_salesman` VALUES (1, 'Sales Person', '', '', '', 5, 1000, 4, 0);
1370 -- --------------------------------------------------------
1373 -- Table structure for table `0_sales_orders`
1376 DROP TABLE IF EXISTS `0_sales_orders`;
1377 CREATE TABLE IF NOT EXISTS `0_sales_orders` (
1378 `order_no` int(11) NOT NULL,
1379 `trans_type` smallint(6) NOT NULL default '30',
1380 `version` tinyint(1) unsigned NOT NULL default '0',
1381 `type` tinyint(1) NOT NULL default '0',
1382 `debtor_no` int(11) NOT NULL default '0',
1383 `branch_code` int(11) NOT NULL default '0',
1384 `reference` varchar(100) NOT NULL default '',
1385 `customer_ref` tinytext NOT NULL,
1386 `comments` tinytext,
1387 `ord_date` date NOT NULL default '0000-00-00',
1388 `order_type` int(11) NOT NULL default '0',
1389 `ship_via` int(11) NOT NULL default '0',
1390 `delivery_address` tinytext NOT NULL,
1391 `contact_phone` varchar(30) default NULL,
1392 `contact_email` varchar(100) default NULL,
1393 `deliver_to` tinytext NOT NULL,
1394 `freight_cost` double NOT NULL default '0',
1395 `from_stk_loc` varchar(5) NOT NULL default '',
1396 `delivery_date` date NOT NULL default '0000-00-00',
1397 `payment_terms` int(11) default NULL,
1398 `total` double NOT NULL default '0',
1399 `prep_amount` double NOT NULL DEFAULT '0',
1400 `alloc` double NOT NULL DEFAULT '0',
1401 PRIMARY KEY (`trans_type`,`order_no`)
1405 -- Dumping data for table `0_sales_orders`
1408 -- --------------------------------------------------------
1411 -- Table structure for table `0_sales_order_details`
1414 DROP TABLE IF EXISTS `0_sales_order_details`;
1415 CREATE TABLE IF NOT EXISTS `0_sales_order_details` (
1416 `id` int(11) NOT NULL auto_increment,
1417 `order_no` int(11) NOT NULL default '0',
1418 `trans_type` smallint(6) NOT NULL default '30',
1419 `stk_code` varchar(20) NOT NULL default '',
1420 `description` tinytext,
1421 `qty_sent` double NOT NULL default '0',
1422 `unit_price` double NOT NULL default '0',
1423 `quantity` double NOT NULL default '0',
1424 `invoiced` double NOT NULL DEFAULT '0',
1425 `discount_percent` double NOT NULL default '0',
1427 KEY `sorder` (`trans_type`,`order_no`),
1428 KEY `stkcode` (`stk_code`)
1432 -- Dumping data for table `0_sales_order_details`
1435 -- --------------------------------------------------------
1438 -- Table structure for table `0_sales_pos`
1441 DROP TABLE IF EXISTS `0_sales_pos`;
1442 CREATE TABLE IF NOT EXISTS `0_sales_pos` (
1443 `id` smallint(6) unsigned NOT NULL auto_increment,
1444 `pos_name` varchar(30) NOT NULL,
1445 `cash_sale` tinyint(1) NOT NULL,
1446 `credit_sale` tinyint(1) NOT NULL,
1447 `pos_location` varchar(5) NOT NULL,
1448 `pos_account` smallint(6) unsigned NOT NULL,
1449 `inactive` tinyint(1) NOT NULL default '0',
1451 UNIQUE KEY `pos_name` (`pos_name`)
1452 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
1455 -- Dumping data for table `0_sales_pos`
1458 INSERT INTO `0_sales_pos` VALUES (1, 'Default', 1, 1, 'DEF', 2, 0);
1460 -- --------------------------------------------------------
1463 -- Table structure for table `0_sales_types`
1466 DROP TABLE IF EXISTS `0_sales_types`;
1467 CREATE TABLE IF NOT EXISTS `0_sales_types` (
1468 `id` int(11) NOT NULL auto_increment,
1469 `sales_type` char(50) NOT NULL default '',
1470 `tax_included` int(1) NOT NULL default '0',
1471 `factor` double NOT NULL default '1',
1472 `inactive` tinyint(1) NOT NULL default '0',
1474 UNIQUE KEY `sales_type` (`sales_type`)
1475 ) ENGINE=InnoDB AUTO_INCREMENT=3 ;
1478 -- Dumping data for table `0_sales_types`
1481 INSERT INTO `0_sales_types` VALUES (1, 'Retail', 1, 1, 0);
1482 INSERT INTO `0_sales_types` VALUES (2, 'Wholesale', 0, 0.7, 0);
1484 -- --------------------------------------------------------
1487 -- Table structure for table `0_security_roles`
1490 DROP TABLE IF EXISTS `0_security_roles`;
1491 CREATE TABLE IF NOT EXISTS `0_security_roles` (
1492 `id` int(11) NOT NULL auto_increment,
1493 `role` varchar(30) NOT NULL,
1494 `description` varchar(50) default NULL,
1497 `inactive` tinyint(1) NOT NULL default '0',
1499 UNIQUE KEY `role` (`role`)
1500 ) ENGINE=InnoDB AUTO_INCREMENT=11 ;
1503 -- Dumping data for table `0_security_roles`
1506 INSERT INTO `0_security_roles` VALUES (1, 'Inquiries', 'Inquiries', '768;2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15872;16128', '257;258;259;260;513;514;515;516;517;518;519;520;521;522;523;524;525;773;774;2822;3073;3075;3076;3077;3329;3330;3331;3332;3333;3334;3335;5377;5633;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8450;8451;10497;10753;11009;11010;11012;13313;13315;15617;15618;15619;15620;15621;15622;15623;15624;15625;15626;15873;15882;16129;16130;16131;16132;775', 0);
1507 INSERT INTO `0_security_roles` VALUES (2, 'System Administrator', 'System Administrator', '256;512;768;2816;3072;3328;5376;5632;5888;7936;8192;8448;9472;9728;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;9217;9218;9220;9473;9474;9475;9476;9729;10497;10753;10754;10755;10756;10757;11009;11010;11011;11012;13057;13313;13314;13315;15617;15618;15619;15620;15621;15622;15623;15624;15628;15625;15626;15627;15873;15874;15875;15876;15877;15878;15879;15880;15883;15881;15882;16129;16130;16131;16132;775', 0);
1508 INSERT INTO `0_security_roles` VALUES (3, 'Salesman', 'Salesman', '768;3072;5632;8192;15872', '773;774;3073;3075;3081;5633;8194;15873;775', 0);
1509 INSERT INTO `0_security_roles` VALUES (4, 'Stock Manager', 'Stock Manager', '768;2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15872;16128', '2818;2822;3073;3076;3077;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5633;5640;5889;5890;5891;8193;8194;8450;8451;10753;11009;11010;11012;13313;13315;15882;16129;16130;16131;16132;775', 0);
1510 INSERT INTO `0_security_roles` VALUES (5, 'Production Manager', 'Production Manager', '512;768;2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '521;523;524;2818;2819;2820;2821;2822;2823;3073;3074;3076;3077;3078;3079;3080;3081;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5633;5640;5640;5889;5890;5891;8193;8194;8196;8197;8450;8451;10753;10755;11009;11010;11012;13313;13315;15617;15619;15620;15621;15624;15624;15876;15877;15880;15882;16129;16130;16131;16132;775', 0);
1511 INSERT INTO `0_security_roles` VALUES (6, 'Purchase Officer', 'Purchase Officer', '512;768;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '521;523;524;2818;2819;2820;2821;2822;2823;3073;3074;3076;3077;3078;3079;3080;3081;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5377;5633;5635;5640;5640;5889;5890;5891;8193;8194;8196;8197;8449;8450;8451;10753;10755;11009;11010;11012;13313;13315;15617;15619;15620;15621;15624;15624;15876;15877;15880;15882;16129;16130;16131;16132;775', 0);
1512 INSERT INTO `0_security_roles` VALUES (7, 'AR Officer', 'AR Officer', '512;768;2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '521;523;524;771;773;774;2818;2819;2820;2821;2822;2823;3073;3073;3074;3075;3076;3077;3078;3079;3080;3081;3081;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5633;5633;5634;5637;5638;5639;5640;5640;5889;5890;5891;8193;8194;8194;8196;8197;8450;8451;10753;10755;11009;11010;11012;13313;13315;15617;15619;15620;15621;15624;15624;15873;15876;15877;15878;15880;15882;16129;16130;16131;16132;775', 0);
1513 INSERT INTO `0_security_roles` VALUES (8, 'AP Officer', 'AP Officer', '512;768;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '257;258;259;260;521;523;524;769;770;771;772;773;774;2818;2819;2820;2821;2822;2823;3073;3074;3082;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5635;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8196;8197;8449;8450;8451;10497;10753;10755;11009;11010;11012;13057;13313;13315;15617;15619;15620;15621;15624;15876;15877;15880;15882;16129;16130;16131;16132;775', 0);
1514 INSERT INTO `0_security_roles` VALUES (9, 'Accountant', 'New Accountant', '512;768;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '257;258;259;260;521;523;524;771;772;773;774;2818;2819;2820;2821;2822;2823;3073;3074;3075;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5634;5635;5637;5638;5639;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8196;8197;8449;8450;8451;10497;10753;10755;11009;11010;11012;13313;13315;15617;15618;15619;15620;15621;15624;15873;15876;15877;15878;15880;15882;16129;16130;16131;16132;775', 0);
1515 INSERT INTO `0_security_roles` VALUES (10, 'Sub Admin', 'Sub Admin', '512;768;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '257;258;259;260;521;523;524;771;772;773;774;2818;2819;2820;2821;2822;2823;3073;3074;3082;3075;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5634;5635;5637;5638;5639;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8196;8197;8449;8450;8451;10497;10753;10755;11009;11010;11012;13057;13313;13315;15617;15619;15620;15621;15624;15873;15874;15876;15877;15878;15879;15880;15882;16129;16130;16131;16132;775', 0);
1517 -- --------------------------------------------------------
1520 -- Table structure for table `0_shippers`
1523 DROP TABLE IF EXISTS `0_shippers`;
1524 CREATE TABLE IF NOT EXISTS `0_shippers` (
1525 `shipper_id` int(11) NOT NULL auto_increment,
1526 `shipper_name` varchar(60) NOT NULL default '',
1527 `phone` varchar(30) NOT NULL default '',
1528 `phone2` varchar(30) NOT NULL default '',
1529 `contact` tinytext NOT NULL,
1530 `address` tinytext NOT NULL,
1531 `inactive` tinyint(1) NOT NULL default '0',
1532 PRIMARY KEY (`shipper_id`),
1533 UNIQUE KEY `name` (`shipper_name`)
1534 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
1537 -- Dumping data for table `0_shippers`
1540 INSERT INTO `0_shippers` VALUES (1, 'Default', '', '', '', '', 0);
1542 -- --------------------------------------------------------
1545 -- Table structure for table `0_sql_trail`
1548 DROP TABLE IF EXISTS `0_sql_trail`;
1549 CREATE TABLE IF NOT EXISTS `0_sql_trail` (
1550 `id` int(11) unsigned NOT NULL auto_increment,
1551 `sql` text NOT NULL,
1552 `result` tinyint(1) NOT NULL,
1553 `msg` varchar(255) NOT NULL,
1558 -- Dumping data for table `0_sql_trail`
1561 -- --------------------------------------------------------
1564 -- Table structure for table `0_stock_category`
1567 DROP TABLE IF EXISTS `0_stock_category`;
1568 CREATE TABLE IF NOT EXISTS `0_stock_category` (
1569 `category_id` int(11) NOT NULL auto_increment,
1570 `description` varchar(60) NOT NULL default '',
1571 `dflt_tax_type` int(11) NOT NULL default '1',
1572 `dflt_units` varchar(20) NOT NULL default 'each',
1573 `dflt_mb_flag` char(1) NOT NULL default 'B',
1574 `dflt_sales_act` varchar(15) NOT NULL default '',
1575 `dflt_cogs_act` varchar(15) NOT NULL default '',
1576 `dflt_inventory_act` varchar(15) NOT NULL default '',
1577 `dflt_adjustment_act` varchar(15) NOT NULL default '',
1578 `dflt_wip_act` varchar(15) NOT NULL default '',
1579 `dflt_dim1` int(11) default NULL,
1580 `dflt_dim2` int(11) default NULL,
1581 `inactive` tinyint(1) NOT NULL default '0',
1582 `dflt_no_sale` tinyint(1) NOT NULL default '0',
1583 `dflt_no_purchase` tinyint(1) NOT NULL default '0',
1584 PRIMARY KEY (`category_id`),
1585 UNIQUE KEY `description` (`description`)
1586 ) ENGINE=InnoDB AUTO_INCREMENT=5 ;
1589 -- Dumping data for table `0_stock_category`
1592 INSERT INTO `0_stock_category` VALUES (1, 'Components', 1, 'each', 'B', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1593 INSERT INTO `0_stock_category` VALUES (2, 'Charges', 1, 'each', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1594 INSERT INTO `0_stock_category` VALUES (3, 'Systems', 1, 'each', 'M', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1595 INSERT INTO `0_stock_category` VALUES (4, 'Services', 1, 'hr', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1597 -- --------------------------------------------------------
1600 -- Structure of table `0_stock_fa_class` ###
1603 DROP TABLE IF EXISTS `0_stock_fa_class`;
1604 CREATE TABLE `0_stock_fa_class` (
1605 `fa_class_id` varchar(20) NOT NULL DEFAULT '',
1606 `parent_id` varchar(20) NOT NULL DEFAULT '',
1607 `description` varchar(200) NOT NULL DEFAULT '',
1608 `long_description` tinytext NOT NULL,
1609 `depreciation_rate` double NOT NULL DEFAULT '0',
1610 `inactive` tinyint(1) NOT NULL DEFAULT '0',
1611 PRIMARY KEY (`fa_class_id`)
1614 -- --------------------------------------------------------
1617 -- Table structure for table `0_stock_master`
1620 DROP TABLE IF EXISTS `0_stock_master`;
1621 CREATE TABLE IF NOT EXISTS `0_stock_master` (
1622 `stock_id` varchar(20) NOT NULL default '',
1623 `category_id` int(11) NOT NULL default '0',
1624 `tax_type_id` int(11) NOT NULL default '0',
1625 `description` varchar(200) NOT NULL default '',
1626 `long_description` tinytext NOT NULL,
1627 `units` varchar(20) NOT NULL default 'each',
1628 `mb_flag` char(1) NOT NULL default 'B',
1629 `sales_account` varchar(15) NOT NULL default '',
1630 `cogs_account` varchar(15) NOT NULL default '',
1631 `inventory_account` varchar(15) NOT NULL default '',
1632 `adjustment_account` varchar(15) NOT NULL default '',
1633 `wip_account` varchar(15) NOT NULL default '',
1634 `dimension_id` int(11) default NULL,
1635 `dimension2_id` int(11) default NULL,
1636 `purchase_cost` double NOT NULL default '0',
1637 `material_cost` double NOT NULL default '0',
1638 `labour_cost` double NOT NULL default '0',
1639 `overhead_cost` double NOT NULL default '0',
1640 `inactive` tinyint(1) NOT NULL default '0',
1641 `no_sale` tinyint(1) NOT NULL default '0',
1642 `no_purchase` tinyint(1) NOT NULL default '0',
1643 `editable` tinyint(1) NOT NULL default '0',
1644 `depreciation_method` char(1) NOT NULL DEFAULT 'S',
1645 `depreciation_rate` double NOT NULL DEFAULT '0',
1646 `depreciation_factor` double NOT NULL DEFAULT '1',
1647 `depreciation_start` date NOT NULL DEFAULT '0000-00-00',
1648 `depreciation_date` date NOT NULL DEFAULT '0000-00-00',
1649 `fa_class_id` varchar(20) NOT NULL DEFAULT '',
1650 PRIMARY KEY (`stock_id`)
1654 -- Dumping data for table `0_stock_master`
1657 -- --------------------------------------------------------
1660 -- Table structure for table `0_stock_moves`
1663 DROP TABLE IF EXISTS `0_stock_moves`;
1664 CREATE TABLE `0_stock_moves` (
1665 `trans_id` int(11) NOT NULL AUTO_INCREMENT,
1666 `trans_no` int(11) NOT NULL DEFAULT '0',
1667 `stock_id` char(20) NOT NULL DEFAULT '',
1668 `type` smallint(6) NOT NULL DEFAULT '0',
1669 `loc_code` char(5) NOT NULL DEFAULT '',
1670 `tran_date` date NOT NULL DEFAULT '0000-00-00',
1671 `price` double NOT NULL DEFAULT '0',
1672 `reference` char(40) NOT NULL DEFAULT '',
1673 `qty` double NOT NULL DEFAULT '1',
1674 `standard_cost` double NOT NULL DEFAULT '0',
1675 PRIMARY KEY (`trans_id`),
1676 KEY `type` (`type`,`trans_no`),
1677 KEY `Move` (`stock_id`,`loc_code`,`tran_date`)
1681 -- Dumping data for table `0_stock_moves`
1684 -- --------------------------------------------------------
1687 -- Table structure for table `0_suppliers`
1690 DROP TABLE IF EXISTS `0_suppliers`;
1691 CREATE TABLE IF NOT EXISTS `0_suppliers` (
1692 `supplier_id` int(11) NOT NULL auto_increment,
1693 `supp_name` varchar(60) NOT NULL default '',
1694 `supp_ref` varchar(30) NOT NULL default '',
1695 `address` tinytext NOT NULL,
1696 `supp_address` tinytext NOT NULL,
1697 `gst_no` varchar(25) NOT NULL default '',
1698 `contact` varchar(60) NOT NULL default '',
1699 `supp_account_no` varchar(40) NOT NULL default '',
1700 `website` varchar(100) NOT NULL default '',
1701 `bank_account` varchar(60) NOT NULL default '',
1702 `curr_code` char(3) default NULL,
1703 `payment_terms` int(11) default NULL,
1704 `tax_included` tinyint(1) NOT NULL default '0',
1705 `dimension_id` int(11) default '0',
1706 `dimension2_id` int(11) default '0',
1707 `tax_group_id` int(11) default NULL,
1708 `credit_limit` double NOT NULL default '0',
1709 `purchase_account` varchar(15) NOT NULL default '',
1710 `payable_account` varchar(15) NOT NULL default '',
1711 `payment_discount_account` varchar(15) NOT NULL default '',
1712 `notes` tinytext NOT NULL,
1713 `inactive` tinyint(1) NOT NULL default '0',
1714 PRIMARY KEY (`supplier_id`),
1715 KEY `supp_ref` (`supp_ref`)
1719 -- Dumping data for table `0_suppliers`
1722 -- --------------------------------------------------------
1725 -- Table structure for table `0_supp_allocations`
1728 DROP TABLE IF EXISTS `0_supp_allocations`;
1729 CREATE TABLE IF NOT EXISTS `0_supp_allocations` (
1730 `id` int(11) NOT NULL auto_increment,
1731 `person_id` int(11) DEFAULT NULL,
1732 `amt` double unsigned default NULL,
1733 `date_alloc` date NOT NULL default '0000-00-00',
1734 `trans_no_from` int(11) default NULL,
1735 `trans_type_from` int(11) default NULL,
1736 `trans_no_to` int(11) default NULL,
1737 `trans_type_to` int(11) default NULL,
1739 UNIQUE KEY `trans_type_from` (`person_id`,`trans_type_from`,`trans_no_from`,`trans_type_to`,`trans_no_to`),
1740 KEY `From` (`trans_type_from`,`trans_no_from`),
1741 KEY `To` (`trans_type_to`,`trans_no_to`)
1745 -- Dumping data for table `0_supp_allocations`
1748 -- --------------------------------------------------------
1751 -- Table structure for table `0_supp_invoice_items`
1754 DROP TABLE IF EXISTS `0_supp_invoice_items`;
1755 CREATE TABLE IF NOT EXISTS `0_supp_invoice_items` (
1756 `id` int(11) NOT NULL auto_increment,
1757 `supp_trans_no` int(11) default NULL,
1758 `supp_trans_type` int(11) default NULL,
1759 `gl_code` varchar(15) NOT NULL default '',
1760 `grn_item_id` int(11) default NULL,
1761 `po_detail_item_id` int(11) default NULL,
1762 `stock_id` varchar(20) NOT NULL default '',
1763 `description` tinytext,
1764 `quantity` double NOT NULL default '0',
1765 `unit_price` double NOT NULL default '0',
1766 `unit_tax` double NOT NULL default '0',
1768 `dimension_id` int(11) NOT NULL DEFAULT '0',
1769 `dimension2_id` int(11) NOT NULL DEFAULT '0',
1771 KEY `Transaction` (`supp_trans_type`,`supp_trans_no`,`stock_id`)
1775 -- Dumping data for table `0_supp_invoice_items`
1778 -- --------------------------------------------------------
1781 -- Table structure for table `0_supp_trans`
1784 DROP TABLE IF EXISTS `0_supp_trans`;
1785 CREATE TABLE IF NOT EXISTS `0_supp_trans` (
1786 `trans_no` int(11) unsigned NOT NULL default '0',
1787 `type` smallint(6) unsigned NOT NULL default '0',
1788 `supplier_id` int(11) unsigned default NULL,
1789 `reference` tinytext NOT NULL,
1790 `supp_reference` varchar(60) NOT NULL default '',
1791 `tran_date` date NOT NULL default '0000-00-00',
1792 `due_date` date NOT NULL default '0000-00-00',
1793 `ov_amount` double NOT NULL default '0',
1794 `ov_discount` double NOT NULL default '0',
1795 `ov_gst` double NOT NULL default '0',
1796 `rate` double NOT NULL default '1',
1797 `alloc` double NOT NULL default '0',
1798 `tax_included` tinyint(1) NOT NULL default '0',
1799 PRIMARY KEY (`type`,`trans_no`),
1800 KEY `supplier_id` (`supplier_id`),
1801 KEY `tran_date` (`tran_date`)
1805 -- Dumping data for table `0_supp_trans`
1808 -- --------------------------------------------------------
1811 -- Table structure for table `0_sys_prefs`
1814 DROP TABLE IF EXISTS `0_sys_prefs`;
1815 CREATE TABLE IF NOT EXISTS `0_sys_prefs` (
1816 `name` varchar(35) NOT NULL default '',
1817 `category` varchar(30) default NULL,
1818 `type` varchar(20) NOT NULL default '',
1819 `length` smallint(6) default NULL,
1820 `value` TEXT NOT NULL DEFAULT '',
1821 PRIMARY KEY (`name`),
1822 KEY `category` (`category`)
1826 -- Dumping data for table `0_sys_prefs`
1829 INSERT INTO `0_sys_prefs` VALUES ('coy_name', 'setup.company', 'varchar', 60, 'Company name');
1830 INSERT INTO `0_sys_prefs` VALUES ('gst_no', 'setup.company', 'varchar', 25, '');
1831 INSERT INTO `0_sys_prefs` VALUES ('coy_no', 'setup.company', 'varchar', 25, '');
1832 INSERT INTO `0_sys_prefs` VALUES ('tax_prd', 'setup.company', 'int', 11, '1');
1833 INSERT INTO `0_sys_prefs` VALUES ('tax_last', 'setup.company', 'int', 11, '1');
1834 INSERT INTO `0_sys_prefs` VALUES ('postal_address', 'setup.company', 'tinytext', 0, 'N/A');
1835 INSERT INTO `0_sys_prefs` VALUES ('phone', 'setup.company', 'varchar', 30, '');
1836 INSERT INTO `0_sys_prefs` VALUES ('fax', 'setup.company', 'varchar', 30, '');
1837 INSERT INTO `0_sys_prefs` VALUES ('email', 'setup.company', 'varchar', 100, '');
1838 INSERT INTO `0_sys_prefs` VALUES ('coy_logo', 'setup.company', 'varchar', 100, '');
1839 INSERT INTO `0_sys_prefs` VALUES ('domicile', 'setup.company', 'varchar', 55, '');
1840 INSERT INTO `0_sys_prefs` VALUES ('curr_default', 'setup.company', 'char', 3, 'USD');
1841 INSERT INTO `0_sys_prefs` VALUES ('use_dimension', 'setup.company', 'tinyint', 1, '1');
1842 INSERT INTO `0_sys_prefs` VALUES ('f_year', 'setup.company', 'int', 11, '1');
1843 INSERT INTO `0_sys_prefs` VALUES ('no_item_list', 'setup.company', 'tinyint', 1, '0');
1844 INSERT INTO `0_sys_prefs` VALUES ('no_customer_list', 'setup.company', 'tinyint', 1, '0');
1845 INSERT INTO `0_sys_prefs` VALUES ('no_supplier_list', 'setup.company', 'tinyint', 1, '0');
1846 INSERT INTO `0_sys_prefs` VALUES ('base_sales', 'setup.company', 'int', 11, '1');
1847 INSERT INTO `0_sys_prefs` VALUES ('time_zone', 'setup.company', 'tinyint', 1, '0');
1848 INSERT INTO `0_sys_prefs` VALUES ('add_pct', 'setup.company', 'int', 5, '-1');
1849 INSERT INTO `0_sys_prefs` VALUES ('round_to', 'setup.company', 'int', 5, '1');
1850 INSERT INTO `0_sys_prefs` VALUES ('login_tout', 'setup.company', 'smallint', 6, '600');
1851 INSERT INTO `0_sys_prefs` VALUES ('past_due_days', 'glsetup.general', 'int', 11, '30');
1852 INSERT INTO `0_sys_prefs` VALUES ('profit_loss_year_act', 'glsetup.general', 'varchar', 15, '9990');
1853 INSERT INTO `0_sys_prefs` VALUES ('retained_earnings_act', 'glsetup.general', 'varchar', 15, '3590');
1854 INSERT INTO `0_sys_prefs` VALUES ('bank_charge_act', 'glsetup.general', 'varchar', 15, '5690');
1855 INSERT INTO `0_sys_prefs` VALUES ('exchange_diff_act', 'glsetup.general', 'varchar', 15, '4450');
1856 INSERT INTO `0_sys_prefs` VALUES ('tax_algorithm', 'glsetup.customer', 'tinyint', 1, '1');
1857 INSERT INTO `0_sys_prefs` VALUES ('default_credit_limit', 'glsetup.customer', 'int', 11, '1000');
1858 INSERT INTO `0_sys_prefs` VALUES ('accumulate_shipping', 'glsetup.customer', 'tinyint', 1, '0');
1859 INSERT INTO `0_sys_prefs` VALUES ('legal_text', 'glsetup.customer', 'tinytext', 0, '');
1860 INSERT INTO `0_sys_prefs` VALUES ('freight_act', 'glsetup.customer', 'varchar', 15, '4430');
1861 INSERT INTO `0_sys_prefs` VALUES ('debtors_act', 'glsetup.sales', 'varchar', 15, '1200');
1862 INSERT INTO `0_sys_prefs` VALUES ('default_sales_act', 'glsetup.sales', 'varchar', 15, '4010');
1863 INSERT INTO `0_sys_prefs` VALUES ('default_sales_discount_act', 'glsetup.sales', 'varchar', 15, '4510');
1864 INSERT INTO `0_sys_prefs` VALUES ('default_prompt_payment_act', 'glsetup.sales', 'varchar', 15, '4500');
1865 INSERT INTO `0_sys_prefs` VALUES ('default_delivery_required', 'glsetup.sales', 'smallint', 6, '1');
1866 INSERT INTO `0_sys_prefs` VALUES ('default_receival_required', 'glsetup.purchase', 'smallint', 6, '10');
1867 INSERT INTO `0_sys_prefs` VALUES ('default_quote_valid_days', 'glsetup.sales', 'smallint', 6, '30');
1868 INSERT INTO `0_sys_prefs` VALUES ('default_dim_required', 'glsetup.dims', 'int', 11, '20');
1869 INSERT INTO `0_sys_prefs` VALUES ('pyt_discount_act', 'glsetup.purchase', 'varchar', 15, '5060');
1870 INSERT INTO `0_sys_prefs` VALUES ('creditors_act', 'glsetup.purchase', 'varchar', 15, '2100');
1871 INSERT INTO `0_sys_prefs` VALUES ('po_over_receive', 'glsetup.purchase', 'int', 11, '10');
1872 INSERT INTO `0_sys_prefs` VALUES ('po_over_charge', 'glsetup.purchase', 'int', 11, '10');
1873 INSERT INTO `0_sys_prefs` VALUES ('allow_negative_stock', 'glsetup.inventory', 'tinyint', 1, '0');
1874 INSERT INTO `0_sys_prefs` VALUES ('default_inventory_act', 'glsetup.items', 'varchar', 15, '1510');
1875 INSERT INTO `0_sys_prefs` VALUES ('default_cogs_act', 'glsetup.items', 'varchar', 15, '5010');
1876 INSERT INTO `0_sys_prefs` VALUES ('default_adj_act', 'glsetup.items', 'varchar', 15, '5040');
1877 INSERT INTO `0_sys_prefs` VALUES ('default_inv_sales_act', 'glsetup.items', 'varchar', 15, '4010');
1878 INSERT INTO `0_sys_prefs` VALUES ('default_wip_act', 'glsetup.items', 'varchar', 15, '1530');
1879 INSERT INTO `0_sys_prefs` VALUES ('default_workorder_required', 'glsetup.manuf', 'int', 11, '20');
1880 INSERT INTO `0_sys_prefs` VALUES ('version_id', 'system', 'varchar', 11, '2.4.1');
1881 INSERT INTO `0_sys_prefs` VALUES ('auto_curr_reval', 'setup.company', 'smallint', 6, '1');
1882 INSERT INTO `0_sys_prefs` VALUES ('grn_clearing_act', 'glsetup.purchase', 'varchar', 15, '1550');
1883 INSERT INTO `0_sys_prefs` VALUES ('bcc_email', 'setup.company', 'varchar', 100, '');
1884 INSERT INTO `0_sys_prefs` VALUES ('deferred_income_act', 'glsetup.sales', 'varchar', '15', '');
1885 INSERT INTO `0_sys_prefs` VALUES ('gl_closing_date','setup.closing_date', 'date', 8, '');
1886 INSERT INTO `0_sys_prefs` VALUES ('alternative_tax_include_on_docs','setup.company', 'tinyint', 1, '0');
1887 INSERT INTO `0_sys_prefs` VALUES ('no_zero_lines_amount','glsetup.sales', 'tinyint', 1, '1');
1888 INSERT INTO `0_sys_prefs` VALUES ('show_po_item_codes','glsetup.purchase', 'tinyint', 1, '0');
1889 INSERT INTO `0_sys_prefs` VALUES ('accounts_alpha','glsetup.general', 'tinyint', 1, '0');
1890 INSERT INTO `0_sys_prefs` VALUES ('loc_notification','glsetup.inventory', 'tinyint', 1, '0');
1891 INSERT INTO `0_sys_prefs` VALUES ('print_invoice_no','glsetup.sales', 'tinyint', 1, '0');
1892 INSERT INTO `0_sys_prefs` VALUES ('allow_negative_prices','glsetup.inventory', 'tinyint', 1, '1');
1893 INSERT INTO `0_sys_prefs` VALUES ('print_item_images_on_quote','glsetup.inventory', 'tinyint', 1, '0');
1894 INSERT INTO `0_sys_prefs` VALUES ('suppress_tax_rates','setup.company', 'tinyint', 1, '0');
1895 INSERT INTO `0_sys_prefs` VALUES ('default_loss_on_asset_disposal_act', 'glsetup.items', 'varchar', '15', '5660');
1896 INSERT INTO `0_sys_prefs` VALUES ('depreciation_period', 'glsetup.company', 'tinyint', '1', '1');
1897 INSERT INTO `0_sys_prefs` VALUES ('use_manufacturing','setup.company', 'tinyint', 1, '1');
1898 INSERT INTO `0_sys_prefs` VALUES ('use_fixed_assets','setup.company', 'tinyint', 1, '1');
1900 -- --------------------------------------------------------
1903 -- Table structure for table `0_tags`
1906 DROP TABLE IF EXISTS `0_tags`;
1907 CREATE TABLE IF NOT EXISTS `0_tags` (
1908 `id` int(11) NOT NULL auto_increment,
1909 `type` smallint(6) NOT NULL,
1910 `name` varchar(30) NOT NULL,
1911 `description` varchar(60) default NULL,
1912 `inactive` tinyint(1) NOT NULL default '0',
1914 UNIQUE KEY `type` (`type`,`name`)
1918 -- Dumping data for table `0_tags`
1921 -- --------------------------------------------------------
1924 -- Table structure for table `0_tag_associations`
1927 DROP TABLE IF EXISTS `0_tag_associations`;
1928 CREATE TABLE IF NOT EXISTS `0_tag_associations` (
1929 `record_id` varchar(15) NOT NULL,
1930 `tag_id` int(11) NOT NULL,
1931 UNIQUE KEY `record_id` (`record_id`,`tag_id`)
1935 -- Dumping data for table `0_tag_associations`
1938 -- --------------------------------------------------------
1941 -- Table structure for table `0_tax_groups`
1944 DROP TABLE IF EXISTS `0_tax_groups`;
1945 CREATE TABLE IF NOT EXISTS `0_tax_groups` (
1946 `id` int(11) NOT NULL auto_increment,
1947 `name` varchar(60) NOT NULL default '',
1948 `inactive` tinyint(1) NOT NULL default '0',
1950 UNIQUE KEY `name` (`name`)
1951 ) ENGINE=InnoDB AUTO_INCREMENT=3 ;
1954 -- Dumping data for table `0_tax_groups`
1957 INSERT INTO `0_tax_groups` VALUES (1, 'Tax', 0);
1958 INSERT INTO `0_tax_groups` VALUES (2, 'Tax Exempt', 0);
1960 -- --------------------------------------------------------
1963 -- Table structure for table `0_tax_group_items`
1966 DROP TABLE IF EXISTS `0_tax_group_items`;
1967 CREATE TABLE IF NOT EXISTS `0_tax_group_items` (
1968 `tax_group_id` int(11) NOT NULL default '0',
1969 `tax_type_id` int(11) NOT NULL default '0',
1970 `tax_shipping` tinyint(1) NOT NULL default '0',
1971 PRIMARY KEY (`tax_group_id`,`tax_type_id`)
1975 -- Dumping data for table `0_tax_group_items`
1978 INSERT INTO `0_tax_group_items` VALUES (1, 1, 1);
1980 -- --------------------------------------------------------
1983 -- Table structure for table `0_tax_types`
1986 DROP TABLE IF EXISTS `0_tax_types`;
1987 CREATE TABLE IF NOT EXISTS `0_tax_types` (
1988 `id` int(11) NOT NULL auto_increment,
1989 `rate` double NOT NULL default '0',
1990 `sales_gl_code` varchar(15) NOT NULL default '',
1991 `purchasing_gl_code` varchar(15) NOT NULL default '',
1992 `name` varchar(60) NOT NULL default '',
1993 `inactive` tinyint(1) NOT NULL default '0',
1995 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
1998 -- Dumping data for table `0_tax_types`
2001 INSERT INTO `0_tax_types` VALUES (1, 5, '2150', '2150', 'Tax', 0);
2003 -- --------------------------------------------------------
2006 -- Table structure for table `0_trans_tax_details`
2009 DROP TABLE IF EXISTS `0_trans_tax_details`;
2010 CREATE TABLE IF NOT EXISTS `0_trans_tax_details` (
2011 `id` int(11) NOT NULL auto_increment,
2012 `trans_type` smallint(6) default NULL,
2013 `trans_no` int(11) default NULL,
2014 `tran_date` date NOT NULL,
2015 `tax_type_id` int(11) NOT NULL default '0',
2016 `rate` double NOT NULL default '0',
2017 `ex_rate` double NOT NULL default '1',
2018 `included_in_price` tinyint(1) NOT NULL default '0',
2019 `net_amount` double NOT NULL default '0',
2020 `amount` double NOT NULL default '0',
2022 `reg_type` tinyint(1) default NULL,
2024 KEY `Type_and_Number` (`trans_type`,`trans_no`),
2025 KEY `tran_date` (`tran_date`)
2029 -- Dumping data for table `0_trans_tax_details`
2032 -- --------------------------------------------------------
2035 -- Table structure for table `0_useronline`
2038 DROP TABLE IF EXISTS `0_useronline`;
2039 CREATE TABLE IF NOT EXISTS `0_useronline` (
2040 `id` int(11) NOT NULL auto_increment,
2041 `timestamp` int(15) NOT NULL default '0',
2042 `ip` varchar(40) NOT NULL default '',
2043 `file` varchar(100) NOT NULL default '',
2045 KEY `timestamp` (`timestamp`),
2050 -- Dumping data for table `0_useronline`
2053 -- --------------------------------------------------------
2056 -- Table structure for table `0_users`
2059 DROP TABLE IF EXISTS `0_users`;
2060 CREATE TABLE IF NOT EXISTS `0_users` (
2061 `id` smallint(6) NOT NULL auto_increment,
2062 `user_id` varchar(60) NOT NULL default '',
2063 `password` varchar(100) NOT NULL default '',
2064 `real_name` varchar(100) NOT NULL default '',
2065 `role_id` int(11) NOT NULL default '1',
2066 `phone` varchar(30) NOT NULL default '',
2067 `email` varchar(100) default NULL,
2068 `language` varchar(20) default NULL,
2069 `date_format` tinyint(1) NOT NULL default '0',
2070 `date_sep` tinyint(1) NOT NULL default '0',
2071 `tho_sep` tinyint(1) NOT NULL default '0',
2072 `dec_sep` tinyint(1) NOT NULL default '0',
2073 `theme` varchar(20) NOT NULL default 'default',
2074 `page_size` varchar(20) NOT NULL default 'A4',
2075 `prices_dec` smallint(6) NOT NULL default '2',
2076 `qty_dec` smallint(6) NOT NULL default '2',
2077 `rates_dec` smallint(6) NOT NULL default '4',
2078 `percent_dec` smallint(6) NOT NULL default '1',
2079 `show_gl` tinyint(1) NOT NULL default '1',
2080 `show_codes` tinyint(1) NOT NULL default '0',
2081 `show_hints` tinyint(1) NOT NULL default '0',
2082 `last_visit_date` datetime default NULL,
2083 `query_size` tinyint(1) unsigned NOT NULL default '10',
2084 `graphic_links` tinyint(1) default '1',
2085 `pos` smallint(6) default '1',
2086 `print_profile` varchar(30) NOT NULL default '',
2087 `rep_popup` tinyint(1) default '1',
2088 `sticky_doc_date` tinyint(1) default '0',
2089 `startup_tab` varchar(20) NOT NULL default '',
2090 `transaction_days` smallint(6) NOT NULL default '30',
2091 `save_report_selections` smallint(6) NOT NULL default '0',
2092 `use_date_picker` tinyint(1) NOT NULL default '1',
2093 `def_print_destination` tinyint(1) NOT NULL default '0',
2094 `def_print_orientation` tinyint(1) NOT NULL default '0',
2095 `inactive` tinyint(1) NOT NULL default '0',
2097 UNIQUE KEY `user_id` (`user_id`)
2098 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
2101 -- Dumping data for table `0_users`
2104 INSERT INTO `0_users` VALUES (1, 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', 2, '', 'adm@example.com', 'en_US', 0, 0, 0, 0, 'default', 'Letter', 2, 2, 4, 1, 1, 0, 0, '2008-04-04 12:34:29', 10, 1, 1, '1', 1, 0, 'orders', 30, 0, 1, 0, 0, 0);
2106 -- --------------------------------------------------------
2109 -- Table structure for table `0_voided`
2112 DROP TABLE IF EXISTS `0_voided`;
2113 CREATE TABLE IF NOT EXISTS `0_voided` (
2114 `type` int(11) NOT NULL default '0',
2115 `id` int(11) NOT NULL default '0',
2116 `date_` date NOT NULL default '0000-00-00',
2117 `memo_` tinytext NOT NULL,
2118 UNIQUE KEY `id` (`type`,`id`)
2122 -- Dumping data for table `0_voided`
2125 -- --------------------------------------------------------
2128 -- Table structure for table `0_workcentres`
2131 DROP TABLE IF EXISTS `0_workcentres`;
2132 CREATE TABLE IF NOT EXISTS `0_workcentres` (
2133 `id` int(11) NOT NULL auto_increment,
2134 `name` char(40) NOT NULL default '',
2135 `description` char(50) NOT NULL default '',
2136 `inactive` tinyint(1) NOT NULL default '0',
2138 UNIQUE KEY `name` (`name`)
2142 -- Dumping data for table `0_workcentres`
2145 -- --------------------------------------------------------
2148 -- Table structure for table `0_workorders`
2151 DROP TABLE IF EXISTS `0_workorders`;
2152 CREATE TABLE IF NOT EXISTS `0_workorders` (
2153 `id` int(11) NOT NULL auto_increment,
2154 `wo_ref` varchar(60) NOT NULL default '',
2155 `loc_code` varchar(5) NOT NULL default '',
2156 `units_reqd` double NOT NULL default '1',
2157 `stock_id` varchar(20) NOT NULL default '',
2158 `date_` date NOT NULL default '0000-00-00',
2159 `type` tinyint(4) NOT NULL default '0',
2160 `required_by` date NOT NULL default '0000-00-00',
2161 `released_date` date NOT NULL default '0000-00-00',
2162 `units_issued` double NOT NULL default '0',
2163 `closed` tinyint(1) NOT NULL default '0',
2164 `released` tinyint(1) NOT NULL default '0',
2165 `additional_costs` double NOT NULL default '0',
2167 UNIQUE KEY `wo_ref` (`wo_ref`)
2171 -- Dumping data for table `0_workorders`
2174 -- --------------------------------------------------------
2177 -- Table structure for table `0_wo_costing`
2180 DROP TABLE IF EXISTS `0_wo_costing`;
2181 CREATE TABLE `0_wo_costing` (
2182 `id` int(11) NOT NULL auto_increment,
2183 `workorder_id` int(11) NOT NULL default '0',
2184 `cost_type` tinyint(1) NOT NULL default '0',
2185 `trans_type` int(11) NOT NULL default '0',
2186 `trans_no` int(11) NOT NULL default '0',
2187 `factor` double NOT NULL default '1',
2192 -- Dumping data for table `0_wo_costing`
2195 -- --------------------------------------------------------
2198 -- Table structure for table `0_wo_issues`
2201 DROP TABLE IF EXISTS `0_wo_issues`;
2202 CREATE TABLE IF NOT EXISTS `0_wo_issues` (
2203 `issue_no` int(11) NOT NULL auto_increment,
2204 `workorder_id` int(11) NOT NULL default '0',
2205 `reference` varchar(100) default NULL,
2206 `issue_date` date default NULL,
2207 `loc_code` varchar(5) default NULL,
2208 `workcentre_id` int(11) default NULL,
2209 PRIMARY KEY (`issue_no`),
2210 KEY `workorder_id` (`workorder_id`)
2214 -- Dumping data for table `0_wo_issues`
2217 -- --------------------------------------------------------
2220 -- Table structure for table `0_wo_issue_items`
2223 DROP TABLE IF EXISTS `0_wo_issue_items`;
2224 CREATE TABLE IF NOT EXISTS `0_wo_issue_items` (
2225 `id` int(11) NOT NULL auto_increment,
2226 `stock_id` varchar(40) default NULL,
2227 `issue_id` int(11) default NULL,
2228 `qty_issued` double default NULL,
2229 `unit_cost` double NOT NULL default '0',
2234 -- Dumping data for table `0_wo_issue_items`
2237 -- --------------------------------------------------------
2240 -- Table structure for table `0_wo_manufacture`
2243 DROP TABLE IF EXISTS `0_wo_manufacture`;
2244 CREATE TABLE IF NOT EXISTS `0_wo_manufacture` (
2245 `id` int(11) NOT NULL auto_increment,
2246 `reference` varchar(100) default NULL,
2247 `workorder_id` int(11) NOT NULL default '0',
2248 `quantity` double NOT NULL default '0',
2249 `date_` date NOT NULL default '0000-00-00',
2251 KEY `workorder_id` (`workorder_id`)
2255 -- Dumping data for table `0_wo_manufacture`
2258 -- --------------------------------------------------------
2261 -- Table structure for table `0_wo_requirements`
2264 DROP TABLE IF EXISTS `0_wo_requirements`;
2265 CREATE TABLE IF NOT EXISTS `0_wo_requirements` (
2266 `id` int(11) NOT NULL auto_increment,
2267 `workorder_id` int(11) NOT NULL default '0',
2268 `stock_id` char(20) NOT NULL default '',
2269 `workcentre` int(11) NOT NULL default '0',
2270 `units_req` double NOT NULL default '1',
2271 `unit_cost` double NOT NULL default '0',
2272 `loc_code` char(5) NOT NULL default '',
2273 `units_issued` double NOT NULL default '0',
2275 KEY `workorder_id` (`workorder_id`)
2279 -- Dumping data for table `0_wo_requirements`