Merged last changes from stable.
[fa-stable.git] / sql / en_US-new.sql
1 -- phpMyAdmin SQL Dump
2 -- version 2.11.8.1deb5
3 -- http://www.phpmyadmin.net
4 --
5 -- Host: localhost
6 -- Generation Time: May 11, 2010 at 11:37 PM
7 -- Server version: 5.0.51
8 -- PHP Version: 5.2.6-1+lenny2
9
10 --
11 -- Database: `fatest`
12 --
13
14 -- --------------------------------------------------------
15
16 --
17 -- Table structure for table `0_areas`
18 --
19
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 ;
28
29 --
30 -- Dumping data for table `0_areas`
31 --
32
33 INSERT INTO `0_areas` VALUES(1, 'Global', 0);
34
35 -- --------------------------------------------------------
36
37 --
38 -- Table structure for table `0_attachments`
39 --
40
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 '',
52   PRIMARY KEY  (`id`),
53   KEY `type_no` (`type_no`,`trans_no`)
54 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
55
56 --
57 -- Dumping data for table `0_attachments`
58 --
59
60
61 -- --------------------------------------------------------
62
63 --
64 -- Table structure for table `0_audit_trail`
65 --
66
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,
78   PRIMARY KEY  (`id`),
79   KEY `Seq` (`fiscal_year`,`gl_date`,`gl_seq`),
80   KEY `Type_and_Number` (`type`,`trans_no`)
81 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
82
83 --
84 -- Dumping data for table `0_audit_trail`
85 --
86
87
88 -- --------------------------------------------------------
89
90 --
91 -- Table structure for table `0_bank_accounts`
92 --
93
94 DROP TABLE IF EXISTS `0_bank_accounts`;
95 CREATE TABLE IF NOT EXISTS `0_bank_accounts` (
96   `account_code` varchar(15) NOT NULL default '',
97   `account_type` smallint(6) NOT NULL default '0',
98   `bank_account_name` varchar(60) NOT NULL default '',
99   `bank_account_number` varchar(100) NOT NULL default '',
100   `bank_name` varchar(60) NOT NULL default '',
101   `bank_address` tinytext,
102   `bank_curr_code` char(3) NOT NULL default '',
103   `dflt_curr_act` tinyint(1) NOT NULL default '0',
104   `id` smallint(6) NOT NULL auto_increment,
105   `bank_charge_act` varchar(15) NOT NULL default '',
106   `last_reconciled_date` timestamp NOT NULL default '0000-00-00 00:00:00',
107   `ending_reconcile_balance` double NOT NULL default '0',
108   `inactive` tinyint(1) NOT NULL default '0',
109   PRIMARY KEY  (`id`),
110   KEY `bank_account_name` (`bank_account_name`),
111   KEY `bank_account_number` (`bank_account_number`),
112   KEY `account_code` (`account_code`)
113 ) ENGINE=MyISAM  AUTO_INCREMENT=3 ;
114
115 --
116 -- Dumping data for table `0_bank_accounts`
117 --
118
119 INSERT INTO `0_bank_accounts` VALUES('1060', 0, 'Current account', 'N/A', 'N/A', '', 'USD', 1, 1, '5690', '0000-00-00 00:00:00', 0, 0);
120 INSERT INTO `0_bank_accounts` VALUES('1065', 3, 'Petty Cash account', 'N/A', 'N/A', '', 'USD', 0, 2, '5690', '0000-00-00 00:00:00', 0, 0);
121
122 -- --------------------------------------------------------
123
124 --
125 -- Table structure for table `0_bank_trans`
126 --
127
128 DROP TABLE IF EXISTS `0_bank_trans`;
129 CREATE TABLE IF NOT EXISTS `0_bank_trans` (
130   `id` int(11) NOT NULL auto_increment,
131   `type` smallint(6) default NULL,
132   `trans_no` int(11) default NULL,
133   `bank_act` varchar(15) NOT NULL default '',
134   `ref` varchar(40) default NULL,
135   `trans_date` date NOT NULL default '0000-00-00',
136   `amount` double default NULL,
137   `dimension_id` int(11) NOT NULL default '0',
138   `dimension2_id` int(11) NOT NULL default '0',
139   `person_type_id` int(11) NOT NULL default '0',
140   `person_id` tinyblob,
141   `reconciled` date default NULL,
142   PRIMARY KEY  (`id`),
143   KEY `bank_act` (`bank_act`,`ref`),
144   KEY `type` (`type`,`trans_no`),
145   KEY `bank_act_2` (`bank_act`,`reconciled`),
146   KEY `bank_act_3` (`bank_act`,`trans_date`)
147 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
148
149 --
150 -- Dumping data for table `0_bank_trans`
151 --
152
153
154 -- --------------------------------------------------------
155
156 --
157 -- Table structure for table `0_bom`
158 --
159
160 DROP TABLE IF EXISTS `0_bom`;
161 CREATE TABLE IF NOT EXISTS `0_bom` (
162   `id` int(11) NOT NULL auto_increment,
163   `parent` char(20) NOT NULL default '',
164   `component` char(20) NOT NULL default '',
165   `workcentre_added` int(11) NOT NULL default '0',
166   `loc_code` char(5) NOT NULL default '',
167   `quantity` double NOT NULL default '1',
168   PRIMARY KEY  (`parent`,`component`,`workcentre_added`,`loc_code`),
169   KEY `component` (`component`),
170   KEY `id` (`id`),
171   KEY `loc_code` (`loc_code`),
172   KEY `parent` (`parent`,`loc_code`),
173   KEY `workcentre_added` (`workcentre_added`)
174 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
175
176 --
177 -- Dumping data for table `0_bom`
178 --
179
180
181 -- --------------------------------------------------------
182
183 --
184 -- Table structure for table `0_budget_trans`
185 --
186
187 DROP TABLE IF EXISTS `0_budget_trans`;
188 CREATE TABLE IF NOT EXISTS `0_budget_trans` (
189   `id` int(11) NOT NULL auto_increment,
190   `tran_date` date NOT NULL default '0000-00-00',
191   `account` varchar(15) NOT NULL default '',
192   `memo_` tinytext NOT NULL,
193   `amount` double NOT NULL default '0',
194   `dimension_id` int(11) default '0',
195   `dimension2_id` int(11) default '0',
196   PRIMARY KEY  (`id`),
197   KEY `Account` (`account`,`tran_date`,`dimension_id`,`dimension2_id`)
198 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
199
200 --
201 -- Dumping data for table `0_budget_trans`
202 --
203
204
205 -- --------------------------------------------------------
206
207 --
208 -- Table structure for table `0_chart_class`
209 --
210
211 DROP TABLE IF EXISTS `0_chart_class`;
212 CREATE TABLE IF NOT EXISTS `0_chart_class` (
213   `cid` varchar(3) NOT NULL,
214   `class_name` varchar(60) NOT NULL default '',
215   `ctype` tinyint(1) NOT NULL default '0',
216   `inactive` tinyint(1) NOT NULL default '0',
217   PRIMARY KEY  (`cid`)
218 ) ENGINE=MyISAM;
219
220 --
221 -- Dumping data for table `0_chart_class`
222 --
223
224 INSERT INTO `0_chart_class` VALUES('1', 'Assets', 1, 0);
225 INSERT INTO `0_chart_class` VALUES('2', 'Liabilities', 2, 0);
226 INSERT INTO `0_chart_class` VALUES('3', 'Income', 4, 0);
227 INSERT INTO `0_chart_class` VALUES('4', 'Costs', 6, 0);
228
229 -- --------------------------------------------------------
230
231 --
232 -- Table structure for table `0_chart_master`
233 --
234
235 DROP TABLE IF EXISTS `0_chart_master`;
236 CREATE TABLE IF NOT EXISTS `0_chart_master` (
237   `account_code` varchar(15) NOT NULL default '',
238   `account_code2` varchar(15) NOT NULL default '',
239   `account_name` varchar(60) NOT NULL default '',
240   `account_type` varchar(10) NOT NULL default '0',
241   `inactive` tinyint(1) NOT NULL default '0',
242   PRIMARY KEY  (`account_code`),
243   KEY `account_name` (`account_name`),
244   KEY `accounts_by_type` (`account_type`,`account_code`)
245 ) ENGINE=MyISAM;
246
247 --
248 -- Dumping data for table `0_chart_master`
249 --
250
251 INSERT INTO `0_chart_master` VALUES('1060', '', 'Checking Account', '1', 0);
252 INSERT INTO `0_chart_master` VALUES('1065', '', 'Petty Cash', '1', 0);
253 INSERT INTO `0_chart_master` VALUES('1200', '', 'Accounts Receivables', '1', 0);
254 INSERT INTO `0_chart_master` VALUES('1205', '', 'Allowance for doubtful accounts', '1', 0);
255 INSERT INTO `0_chart_master` VALUES('1510', '', 'Inventory', '2', 0);
256 INSERT INTO `0_chart_master` VALUES('1520', '', 'Stocks of Raw Materials', '2', 0);
257 INSERT INTO `0_chart_master` VALUES('1530', '', 'Stocks of Work In Progress', '2', 0);
258 INSERT INTO `0_chart_master` VALUES('1540', '', 'Stocks of Finsihed Goods', '2', 0);
259 INSERT INTO `0_chart_master` VALUES('1550', '', 'Goods Received Clearing account', '2', 0);
260 INSERT INTO `0_chart_master` VALUES('1820', '', 'Office Furniture & Equipment', '3', 0);
261 INSERT INTO `0_chart_master` VALUES('1825', '', 'Accum. Amort. -Furn. & Equip.', '3', 0);
262 INSERT INTO `0_chart_master` VALUES('1840', '', 'Vehicle', '3', 0);
263 INSERT INTO `0_chart_master` VALUES('1845', '', 'Accum. Amort. -Vehicle', '3', 0);
264 INSERT INTO `0_chart_master` VALUES('2100', '', 'Accounts Payable', '4', 0);
265 INSERT INTO `0_chart_master` VALUES('2110', '', 'Accrued Income Tax - Federal', '4', 0);
266 INSERT INTO `0_chart_master` VALUES('2120', '', 'Accrued Income Tax - State', '4', 0);
267 INSERT INTO `0_chart_master` VALUES('2130', '', 'Accrued Franchise Tax', '4', 0);
268 INSERT INTO `0_chart_master` VALUES('2140', '', 'Accrued Real & Personal Prop Tax', '4', 0);
269 INSERT INTO `0_chart_master` VALUES('2150', '', 'Sales Tax', '4', 0);
270 INSERT INTO `0_chart_master` VALUES('2160', '', 'Accrued Use Tax Payable', '4', 0);
271 INSERT INTO `0_chart_master` VALUES('2210', '', 'Accrued Wages', '4', 0);
272 INSERT INTO `0_chart_master` VALUES('2220', '', 'Accrued Comp Time', '4', 0);
273 INSERT INTO `0_chart_master` VALUES('2230', '', 'Accrued Holiday Pay', '4', 0);
274 INSERT INTO `0_chart_master` VALUES('2240', '', 'Accrued Vacation Pay', '4', 0);
275 INSERT INTO `0_chart_master` VALUES('2310', '', 'Accr. Benefits - 401K', '4', 0);
276 INSERT INTO `0_chart_master` VALUES('2320', '', 'Accr. Benefits - Stock Purchase', '4', 0);
277 INSERT INTO `0_chart_master` VALUES('2330', '', 'Accr. Benefits - Med, Den', '4', 0);
278 INSERT INTO `0_chart_master` VALUES('2340', '', 'Accr. Benefits - Payroll Taxes', '4', 0);
279 INSERT INTO `0_chart_master` VALUES('2350', '', 'Accr. Benefits - Credit Union', '4', 0);
280 INSERT INTO `0_chart_master` VALUES('2360', '', 'Accr. Benefits - Savings Bond', '4', 0);
281 INSERT INTO `0_chart_master` VALUES('2370', '', 'Accr. Benefits - Garnish', '4', 0);
282 INSERT INTO `0_chart_master` VALUES('2380', '', 'Accr. Benefits - Charity Cont.', '4', 0);
283 INSERT INTO `0_chart_master` VALUES('2620', '', 'Bank Loans', '5', 0);
284 INSERT INTO `0_chart_master` VALUES('2680', '', 'Loans from Shareholders', '5', 0);
285 INSERT INTO `0_chart_master` VALUES('3350', '', 'Common Shares', '6', 0);
286 INSERT INTO `0_chart_master` VALUES('3590', '', 'Retained Earnings - prior years', '7', 0);
287 INSERT INTO `0_chart_master` VALUES('4010', '', 'Sales', '8', 0);
288 INSERT INTO `0_chart_master` VALUES('4430', '', 'Shipping & Handling', '9', 0);
289 INSERT INTO `0_chart_master` VALUES('4440', '', 'Interest', '9', 0);
290 INSERT INTO `0_chart_master` VALUES('4450', '', 'Foreign Exchange Gain', '9', 0);
291 INSERT INTO `0_chart_master` VALUES('4500', '', 'Prompt Payment Discounts', '9', 0);
292 INSERT INTO `0_chart_master` VALUES('4510', '', 'Discounts Given', '9', 0);
293 INSERT INTO `0_chart_master` VALUES('5010', '', 'Cost of Goods Sold - Retail', '10', 0);
294 INSERT INTO `0_chart_master` VALUES('5020', '', 'Material Usage Varaiance', '10', 0);
295 INSERT INTO `0_chart_master` VALUES('5030', '', 'Consumable Materials', '10', 0);
296 INSERT INTO `0_chart_master` VALUES('5040', '', 'Purchase price Variance', '10', 0);
297 INSERT INTO `0_chart_master` VALUES('5050', '', 'Purchases of materials', '10', 0);
298 INSERT INTO `0_chart_master` VALUES('5060', '', 'Discounts Received', '10', 0);
299 INSERT INTO `0_chart_master` VALUES('5100', '', 'Freight', '10', 0);
300 INSERT INTO `0_chart_master` VALUES('5410', '', 'Wages & Salaries', '11', 0);
301 INSERT INTO `0_chart_master` VALUES('5420', '', 'Wages - Overtime', '11', 0);
302 INSERT INTO `0_chart_master` VALUES('5430', '', 'Benefits - Comp Time', '11', 0);
303 INSERT INTO `0_chart_master` VALUES('5440', '', 'Benefits - Payroll Taxes', '11', 0);
304 INSERT INTO `0_chart_master` VALUES('5450', '', 'Benefits - Workers Comp', '11', 0);
305 INSERT INTO `0_chart_master` VALUES('5460', '', 'Benefits - Pension', '11', 0);
306 INSERT INTO `0_chart_master` VALUES('5470', '', 'Benefits - General Benefits', '11', 0);
307 INSERT INTO `0_chart_master` VALUES('5510', '', 'Inc Tax Exp - Federal', '11', 0);
308 INSERT INTO `0_chart_master` VALUES('5520', '', 'Inc Tax Exp - State', '11', 0);
309 INSERT INTO `0_chart_master` VALUES('5530', '', 'Taxes - Real Estate', '11', 0);
310 INSERT INTO `0_chart_master` VALUES('5540', '', 'Taxes - Personal Property', '11', 0);
311 INSERT INTO `0_chart_master` VALUES('5550', '', 'Taxes - Franchise', '11', 0);
312 INSERT INTO `0_chart_master` VALUES('5560', '', 'Taxes - Foreign Withholding', '11', 0);
313 INSERT INTO `0_chart_master` VALUES('5610', '', 'Accounting & Legal', '12', 0);
314 INSERT INTO `0_chart_master` VALUES('5615', '', 'Advertising & Promotions', '12', 0);
315 INSERT INTO `0_chart_master` VALUES('5620', '', 'Bad Debts', '12', 0);
316 INSERT INTO `0_chart_master` VALUES('5660', '', 'Amortization Expense', '12', 0);
317 INSERT INTO `0_chart_master` VALUES('5685', '', 'Insurance', '12', 0);
318 INSERT INTO `0_chart_master` VALUES('5690', '', 'Interest & Bank Charges', '12', 0);
319 INSERT INTO `0_chart_master` VALUES('5700', '', 'Office Supplies', '12', 0);
320 INSERT INTO `0_chart_master` VALUES('5760', '', 'Rent', '12', 0);
321 INSERT INTO `0_chart_master` VALUES('5765', '', 'Repair & Maintenance', '12', 0);
322 INSERT INTO `0_chart_master` VALUES('5780', '', 'Telephone', '12', 0);
323 INSERT INTO `0_chart_master` VALUES('5785', '', 'Travel & Entertainment', '12', 0);
324 INSERT INTO `0_chart_master` VALUES('5790', '', 'Utilities', '12', 0);
325 INSERT INTO `0_chart_master` VALUES('5795', '', 'Registrations', '12', 0);
326 INSERT INTO `0_chart_master` VALUES('5800', '', 'Licenses', '12', 0);
327 INSERT INTO `0_chart_master` VALUES('5810', '', 'Foreign Exchange Loss', '12', 0);
328 INSERT INTO `0_chart_master` VALUES('9990', '', 'Year Profit/Loss', '12', 0);
329
330 -- --------------------------------------------------------
331
332 --
333 -- Table structure for table `0_chart_types`
334 --
335
336 DROP TABLE IF EXISTS `0_chart_types`;
337 CREATE TABLE IF NOT EXISTS `0_chart_types` (
338   `id` varchar(10) NOT NULL,
339   `name` varchar(60) NOT NULL default '',
340   `class_id` varchar(3) NOT NULL default '',
341   `parent` varchar(10) NOT NULL default '-1',
342   `inactive` tinyint(1) NOT NULL default '0',
343   PRIMARY KEY  (`id`),
344   KEY `name` (`name`),
345   KEY `class_id` (`class_id`)
346 ) ENGINE=MyISAM ;
347
348 --
349 -- Dumping data for table `0_chart_types`
350 --
351
352 INSERT INTO `0_chart_types` VALUES('1', 'Current Assets', '1', '', 0);
353 INSERT INTO `0_chart_types` VALUES('2', 'Inventory Assets', '1', '', 0);
354 INSERT INTO `0_chart_types` VALUES('3', 'Capital Assets', '1', '', 0);
355 INSERT INTO `0_chart_types` VALUES('4', 'Current Liabilities', '2', '', 0);
356 INSERT INTO `0_chart_types` VALUES('5', 'Long Term Liabilities', '2', '', 0);
357 INSERT INTO `0_chart_types` VALUES('6', 'Share Capital', '2', '', 0);
358 INSERT INTO `0_chart_types` VALUES('7', 'Retained Earnings', '2', '', 0);
359 INSERT INTO `0_chart_types` VALUES('8', 'Sales Revenue', '3', '', 0);
360 INSERT INTO `0_chart_types` VALUES('9', 'Other Revenue', '3', '', 0);
361 INSERT INTO `0_chart_types` VALUES('10', 'Cost of Goods Sold', '4', '', 0);
362 INSERT INTO `0_chart_types` VALUES('11', 'Payroll Expenses', '4', '', 0);
363 INSERT INTO `0_chart_types` VALUES('12', 'General & Administrative expenses', '4', '', 0);
364
365 -- --------------------------------------------------------
366
367 --
368 -- Table structure for table `0_comments`
369 --
370
371 DROP TABLE IF EXISTS `0_comments`;
372 CREATE TABLE IF NOT EXISTS `0_comments` (
373   `type` int(11) NOT NULL default '0',
374   `id` int(11) NOT NULL default '0',
375   `date_` date default '0000-00-00',
376   `memo_` tinytext,
377   KEY `type_and_id` (`type`,`id`)
378 ) ENGINE=InnoDB;
379
380 --
381 -- Dumping data for table `0_comments`
382 --
383
384
385 -- --------------------------------------------------------
386
387 --
388 -- Table structure for table `0_credit_status`
389 --
390
391 DROP TABLE IF EXISTS `0_credit_status`;
392 CREATE TABLE IF NOT EXISTS `0_credit_status` (
393   `id` int(11) NOT NULL auto_increment,
394   `reason_description` char(100) NOT NULL default '',
395   `dissallow_invoices` tinyint(1) NOT NULL default '0',
396   `inactive` tinyint(1) NOT NULL default '0',
397   PRIMARY KEY  (`id`),
398   UNIQUE KEY `reason_description` (`reason_description`)
399 ) ENGINE=MyISAM  AUTO_INCREMENT=5 ;
400
401 --
402 -- Dumping data for table `0_credit_status`
403 --
404
405 INSERT INTO `0_credit_status` VALUES(1, 'Good History', 0, 0);
406 INSERT INTO `0_credit_status` VALUES(3, 'No more work until payment received', 1, 0);
407 INSERT INTO `0_credit_status` VALUES(4, 'In liquidation', 1, 0);
408
409 -- --------------------------------------------------------
410
411 --
412 -- Table structure for table `0_crm_categories`
413 --
414
415 DROP TABLE IF EXISTS `0_crm_categories`;
416 CREATE TABLE IF NOT EXISTS `0_crm_categories` (
417   `id` int(11) NOT NULL auto_increment COMMENT 'pure technical key',
418   `type` varchar(20) NOT NULL COMMENT 'contact type e.g. customer',
419   `action` varchar(20) NOT NULL COMMENT 'detailed usage e.g. department',
420   `name` varchar(30) NOT NULL COMMENT 'for category selector',
421   `description` tinytext NOT NULL COMMENT 'usage description',
422   `system` tinyint(1) NOT NULL default '0' COMMENT 'nonzero for core system usage',
423   `inactive` tinyint(1) NOT NULL default '0',
424   PRIMARY KEY  (`id`),
425   UNIQUE KEY `type` (`type`,`action`),
426   UNIQUE KEY `type_2` (`type`,`name`)
427 ) ENGINE=InnoDB  AUTO_INCREMENT=13 ;
428
429 --
430 -- Dumping data for table `0_crm_categories`
431 --
432
433 INSERT INTO `0_crm_categories` VALUES(1, 'cust_branch', 'general', 'General', 'General contact data for customer branch (overrides company setting)', 1, 0);
434 INSERT INTO `0_crm_categories` VALUES(2, 'cust_branch', 'invoice', 'Invoices', 'Invoice posting (overrides company setting)', 1, 0);
435 INSERT INTO `0_crm_categories` VALUES(3, 'cust_branch', 'order', 'Orders', 'Order confirmation (overrides company setting)', 1, 0);
436 INSERT INTO `0_crm_categories` VALUES(4, 'cust_branch', 'delivery', 'Deliveries', 'Delivery coordination (overrides company setting)', 1, 0);
437 INSERT INTO `0_crm_categories` VALUES(5, 'customer', 'general', 'General', 'General contact data for customer', 1, 0);
438 INSERT INTO `0_crm_categories` VALUES(6, 'customer', 'order', 'Orders', 'Order confirmation', 1, 0);
439 INSERT INTO `0_crm_categories` VALUES(7, 'customer', 'delivery', 'Deliveries', 'Delivery coordination', 1, 0);
440 INSERT INTO `0_crm_categories` VALUES(8, 'customer', 'invoice', 'Invoices', 'Invoice posting', 1, 0);
441 INSERT INTO `0_crm_categories` VALUES(9, 'supplier', 'general', 'General', 'General contact data for supplier', 1, 0);
442 INSERT INTO `0_crm_categories` VALUES(10, 'supplier', 'order', 'Orders', 'Order confirmation', 1, 0);
443 INSERT INTO `0_crm_categories` VALUES(11, 'supplier', 'delivery', 'Deliveries', 'Delivery coordination', 1, 0);
444 INSERT INTO `0_crm_categories` VALUES(12, 'supplier', 'invoice', 'Invoices', 'Invoice posting', 1, 0);
445
446 -- --------------------------------------------------------
447
448 --
449 -- Table structure for table `0_crm_contacts`
450 --
451
452 DROP TABLE IF EXISTS `0_crm_contacts`;
453 CREATE TABLE IF NOT EXISTS `0_crm_contacts` (
454   `id` int(11) NOT NULL auto_increment,
455   `person_id` int(11) NOT NULL default '0' COMMENT 'foreign key to crm_contacts',
456   `type` varchar(20) NOT NULL COMMENT 'foreign key to crm_categories',
457   `action` varchar(20) NOT NULL COMMENT 'foreign key to crm_categories',
458   `entity_id` varchar(11) default NULL COMMENT 'entity id in related class table',
459   PRIMARY KEY  (`id`),
460   KEY `type` (`type`,`action`)
461 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
462
463 --
464 -- Dumping data for table `0_crm_contacts`
465 --
466
467 -- --------------------------------------------------------
468
469 --
470 -- Table structure for table `0_crm_persons`
471 --
472
473 DROP TABLE IF EXISTS `0_crm_persons`;
474 CREATE TABLE IF NOT EXISTS `0_crm_persons` (
475   `id` int(11) NOT NULL auto_increment,
476   `ref` varchar(30) NOT NULL,
477   `name` varchar(60) NOT NULL,
478   `name2` varchar(60) default NULL,
479   `address` tinytext,
480   `phone` varchar(30) default NULL,
481   `phone2` varchar(30) default NULL,
482   `fax` varchar(30) default NULL,
483   `email` varchar(100) default NULL,
484   `lang` char(5) default NULL,
485   `notes` tinytext NOT NULL,
486   `inactive` tinyint(1) NOT NULL default '0',
487   PRIMARY KEY  (`id`),
488   KEY `ref` (`ref`)
489 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
490
491 --
492 -- Dumping data for table `0_crm_persons`
493 --
494
495
496 -- --------------------------------------------------------
497
498 --
499 -- Table structure for table `0_currencies`
500 --
501
502 DROP TABLE IF EXISTS `0_currencies`;
503 CREATE TABLE IF NOT EXISTS `0_currencies` (
504   `currency` varchar(60) NOT NULL default '',
505   `curr_abrev` char(3) NOT NULL default '',
506   `curr_symbol` varchar(10) NOT NULL default '',
507   `country` varchar(100) NOT NULL default '',
508   `hundreds_name` varchar(15) NOT NULL default '',
509   `auto_update` tinyint(1) NOT NULL default '1',
510   `inactive` tinyint(1) NOT NULL default '0',
511   PRIMARY KEY  (`curr_abrev`)
512 ) ENGINE=MyISAM;
513
514 --
515 -- Dumping data for table `0_currencies`
516 --
517
518 INSERT INTO `0_currencies` VALUES('US Dollars', 'USD', '$', 'United States', 'Cents', 1, 0);
519 INSERT INTO `0_currencies` VALUES('CA Dollars', 'CAD', '$', 'Canada', 'Cents', 1, 0);
520 INSERT INTO `0_currencies` VALUES('Euro', 'EUR', '?', 'Europe', 'Cents', 1, 0);
521 INSERT INTO `0_currencies` VALUES('Pounds', 'GBP', '?', 'England', 'Pence', 1, 0);
522
523 -- --------------------------------------------------------
524
525 --
526 -- Table structure for table `0_cust_allocations`
527 --
528
529 DROP TABLE IF EXISTS `0_cust_allocations`;
530 CREATE TABLE IF NOT EXISTS `0_cust_allocations` (
531   `id` int(11) NOT NULL auto_increment,
532   `amt` double unsigned default NULL,
533   `date_alloc` date NOT NULL default '0000-00-00',
534   `trans_no_from` int(11) default NULL,
535   `trans_type_from` int(11) default NULL,
536   `trans_no_to` int(11) default NULL,
537   `trans_type_to` int(11) default NULL,
538   PRIMARY KEY (`id`),
539   UNIQUE KEY (`trans_type_from`,`trans_no_from`,`trans_type_to`,`trans_no_to`),
540   KEY `From` (`trans_type_from`,`trans_no_from`),
541   KEY `To` (`trans_type_to`,`trans_no_to`)
542 ) ENGINE=InnoDB  AUTO_INCREMENT=1 ;
543
544 --
545 -- Dumping data for table `0_cust_allocations`
546 --
547
548
549 -- --------------------------------------------------------
550
551 --
552 -- Table structure for table `0_cust_branch`
553 --
554
555 DROP TABLE IF EXISTS `0_cust_branch`;
556 CREATE TABLE IF NOT EXISTS `0_cust_branch` (
557   `branch_code` int(11) NOT NULL auto_increment,
558   `debtor_no` int(11) NOT NULL default '0',
559   `br_name` varchar(60) NOT NULL default '',
560   `branch_ref` varchar(30) NOT NULL default '',
561   `br_address` tinytext NOT NULL,
562   `area` int(11) default NULL,
563   `salesman` int(11) NOT NULL default '0',
564   `contact_name` varchar(60) NOT NULL default '',
565   `default_location` varchar(5) NOT NULL default '',
566   `tax_group_id` int(11) default NULL,
567   `sales_account` varchar(15) NOT NULL default '',
568   `sales_discount_account` varchar(15) NOT NULL default '',
569   `receivables_account` varchar(15) NOT NULL default '',
570   `payment_discount_account` varchar(15) NOT NULL default '',
571   `default_ship_via` int(11) NOT NULL default '1',
572   `disable_trans` tinyint(4) NOT NULL default '0',
573   `br_post_address` tinytext NOT NULL,
574   `group_no` int(11) NOT NULL default '0',
575   `notes` tinytext NOT NULL,
576   `bank_account` varchar(60) DEFAULT NULL,
577   `inactive` tinyint(1) NOT NULL default '0',
578   PRIMARY KEY  (`branch_code`,`debtor_no`),
579   KEY `branch_code` (`branch_code`),
580   KEY `branch_ref` (`branch_ref`),
581   KEY `group_no` (`group_no`)
582 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
583
584 --
585 -- Dumping data for table `0_cust_branch`
586 --
587
588
589 -- --------------------------------------------------------
590
591 --
592 -- Table structure for table `0_debtors_master`
593 --
594
595 DROP TABLE IF EXISTS `0_debtors_master`;
596 CREATE TABLE IF NOT EXISTS `0_debtors_master` (
597   `debtor_no` int(11) NOT NULL auto_increment,
598   `name` varchar(100) NOT NULL default '',
599   `debtor_ref` varchar(30) NOT NULL,
600   `address` tinytext,
601   `tax_id` varchar(55) NOT NULL default '',
602   `curr_code` char(3) NOT NULL default '',
603   `sales_type` int(11) NOT NULL default '1',
604   `dimension_id` int(11) NOT NULL default '0',
605   `dimension2_id` int(11) NOT NULL default '0',
606   `credit_status` int(11) NOT NULL default '0',
607   `payment_terms` int(11) default NULL,
608   `discount` double NOT NULL default '0',
609   `pymt_discount` double NOT NULL default '0',
610   `credit_limit` float NOT NULL default '1000',
611   `notes` tinytext NOT NULL,
612   `inactive` tinyint(1) NOT NULL default '0',
613   PRIMARY KEY  (`debtor_no`),
614   KEY `name` (`name`),
615   UNIQUE KEY `debtor_ref` (`debtor_ref`)
616 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
617
618 --
619 -- Dumping data for table `0_debtors_master`
620 --
621
622
623 -- --------------------------------------------------------
624
625 --
626 -- Table structure for table `0_debtor_trans`
627 --
628
629 DROP TABLE IF EXISTS `0_debtor_trans`;
630 CREATE TABLE IF NOT EXISTS `0_debtor_trans` (
631   `trans_no` int(11) unsigned NOT NULL default '0',
632   `type` smallint(6) unsigned NOT NULL default '0',
633   `version` tinyint(1) unsigned NOT NULL default '0',
634   `debtor_no` int(11) unsigned default NULL,
635   `branch_code` int(11) NOT NULL default '-1',
636   `tran_date` date NOT NULL default '0000-00-00',
637   `due_date` date NOT NULL default '0000-00-00',
638   `reference` varchar(60) NOT NULL default '',
639   `tpe` int(11) NOT NULL default '0',
640   `order_` int(11) NOT NULL default '0',
641   `ov_amount` double NOT NULL default '0',
642   `ov_gst` double NOT NULL default '0',
643   `ov_freight` double NOT NULL default '0',
644   `ov_freight_tax` double NOT NULL default '0',
645   `ov_discount` double NOT NULL default '0',
646   `alloc` double NOT NULL default '0',
647   `prep_amount` double NOT NULL DEFAULT '0',
648   `rate` double NOT NULL default '1',
649   `ship_via` int(11) default NULL,
650   `dimension_id` int(11) NOT NULL default '0',
651   `dimension2_id` int(11) NOT NULL default '0',
652   `payment_terms` int(11) default NULL,
653   `tax_included` tinyint(1) unsigned NOT NULL default '0',
654   PRIMARY KEY  (`type`,`trans_no`),
655   KEY `debtor_no` (`debtor_no`,`branch_code`),
656   KEY `tran_date` (`tran_date`)
657 ) ENGINE=InnoDB;
658
659 --
660 -- Dumping data for table `0_debtor_trans`
661 --
662
663
664 -- --------------------------------------------------------
665
666 --
667 -- Table structure for table `0_debtor_trans_details`
668 --
669
670 DROP TABLE IF EXISTS `0_debtor_trans_details`;
671 CREATE TABLE IF NOT EXISTS `0_debtor_trans_details` (
672   `id` int(11) NOT NULL auto_increment,
673   `debtor_trans_no` int(11) default NULL,
674   `debtor_trans_type` int(11) default NULL,
675   `stock_id` varchar(20) NOT NULL default '',
676   `description` tinytext,
677   `unit_price` double NOT NULL default '0',
678   `unit_tax` double NOT NULL default '0',
679   `quantity` double NOT NULL default '0',
680   `discount_percent` double NOT NULL default '0',
681   `standard_cost` double NOT NULL default '0',
682   `qty_done` double NOT NULL default '0',
683   `src_id` int(11) NOT NULL,
684   PRIMARY KEY  (`id`),
685   KEY `Transaction` (`debtor_trans_type`,`debtor_trans_no`),
686   KEY (`src_id`)
687 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
688
689 --
690 -- Dumping data for table `0_debtor_trans_details`
691 --
692
693
694 -- --------------------------------------------------------
695
696 --
697 -- Table structure for table `0_dimensions`
698 --
699
700 DROP TABLE IF EXISTS `0_dimensions`;
701 CREATE TABLE IF NOT EXISTS `0_dimensions` (
702   `id` int(11) NOT NULL auto_increment,
703   `reference` varchar(60) NOT NULL default '',
704   `name` varchar(60) NOT NULL default '',
705   `type_` tinyint(1) NOT NULL default '1',
706   `closed` tinyint(1) NOT NULL default '0',
707   `date_` date NOT NULL default '0000-00-00',
708   `due_date` date NOT NULL default '0000-00-00',
709   PRIMARY KEY  (`id`),
710   UNIQUE KEY `reference` (`reference`),
711   KEY `date_` (`date_`),
712   KEY `due_date` (`due_date`),
713   KEY `type_` (`type_`)
714 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
715
716 --
717 -- Dumping data for table `0_dimensions`
718 --
719
720
721 -- --------------------------------------------------------
722
723 --
724 -- Table structure for table `0_exchange_rates`
725 --
726
727 DROP TABLE IF EXISTS `0_exchange_rates`;
728 CREATE TABLE IF NOT EXISTS `0_exchange_rates` (
729   `id` int(11) NOT NULL auto_increment,
730   `curr_code` char(3) NOT NULL default '',
731   `rate_buy` double NOT NULL default '0',
732   `rate_sell` double NOT NULL default '0',
733   `date_` date NOT NULL default '0000-00-00',
734   PRIMARY KEY  (`id`),
735   UNIQUE KEY `curr_code` (`curr_code`,`date_`)
736 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
737
738 --
739 -- Dumping data for table `0_exchange_rates`
740 --
741
742
743 -- --------------------------------------------------------
744
745 --
746 -- Table structure for table `0_fiscal_year`
747 --
748
749 DROP TABLE IF EXISTS `0_fiscal_year`;
750 CREATE TABLE IF NOT EXISTS `0_fiscal_year` (
751   `id` int(11) NOT NULL auto_increment,
752   `begin` date default '0000-00-00',
753   `end` date default '0000-00-00',
754   `closed` tinyint(1) NOT NULL default '0',
755   PRIMARY KEY  (`id`),
756   UNIQUE KEY `begin` (`begin`),
757   UNIQUE KEY `end` (`end`)
758 ) ENGINE=InnoDB  AUTO_INCREMENT=4 ;
759
760 --
761 -- Dumping data for table `0_fiscal_year`
762 --
763
764 INSERT INTO `0_fiscal_year` VALUES(1, '2008-01-01', '2008-12-31', 0);
765 INSERT INTO `0_fiscal_year` VALUES(2, '2009-01-01', '2009-12-31', 0);
766 INSERT INTO `0_fiscal_year` VALUES(3, '2010-01-01', '2010-12-31', 0);
767 INSERT INTO `0_fiscal_year` VALUES(4, '2011-01-01', '2011-12-31', 0);
768 INSERT INTO `0_fiscal_year` VALUES(5, '2012-01-01', '2012-12-31', 0);
769 INSERT INTO `0_fiscal_year` VALUES(6, '2013-01-01', '2013-12-31', 0);
770
771 --
772 -- Table structure for table `0_gl_trans`
773 --
774
775 DROP TABLE IF EXISTS `0_gl_trans`;
776 CREATE TABLE IF NOT EXISTS `0_gl_trans` (
777   `counter` int(11) NOT NULL auto_increment,
778   `type` smallint(6) NOT NULL default '0',
779   `type_no` bigint(16) NOT NULL default '1',
780   `tran_date` date NOT NULL default '0000-00-00',
781   `account` varchar(15) NOT NULL default '',
782   `memo_` tinytext NOT NULL,
783   `amount` double NOT NULL default '0',
784   `dimension_id` int(11) NOT NULL default '0',
785   `dimension2_id` int(11) NOT NULL default '0',
786   `person_type_id` int(11) default NULL,
787   `person_id` tinyblob,
788   PRIMARY KEY  (`counter`),
789   KEY `Type_and_Number` (`type`,`type_no`),
790   KEY `dimension_id` (`dimension_id`),
791   KEY `dimension2_id` (`dimension2_id`),
792   KEY `tran_date` (`tran_date`),
793   KEY `account_and_tran_date` (`account`,`tran_date`)
794 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
795
796 --
797 -- Dumping data for table `0_gl_trans`
798 --
799
800
801 -- --------------------------------------------------------
802
803 --
804 -- Table structure for table `0_grn_batch`
805 --
806
807 DROP TABLE IF EXISTS `0_grn_batch`;
808 CREATE TABLE IF NOT EXISTS `0_grn_batch` (
809   `id` int(11) NOT NULL auto_increment,
810   `supplier_id` int(11) NOT NULL default '0',
811   `purch_order_no` int(11) default NULL,
812   `reference` varchar(60) NOT NULL default '',
813   `delivery_date` date NOT NULL default '0000-00-00',
814   `loc_code` varchar(5) default NULL,
815   PRIMARY KEY  (`id`),
816   KEY `delivery_date` (`delivery_date`),
817   KEY `purch_order_no` (`purch_order_no`)
818 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
819
820 --
821 -- Dumping data for table `0_grn_batch`
822 --
823
824
825 -- --------------------------------------------------------
826
827 --
828 -- Table structure for table `0_grn_items`
829 --
830
831 DROP TABLE IF EXISTS `0_grn_items`;
832 CREATE TABLE IF NOT EXISTS `0_grn_items` (
833   `id` int(11) NOT NULL auto_increment,
834   `grn_batch_id` int(11) default NULL,
835   `po_detail_item` int(11) NOT NULL default '0',
836   `item_code` varchar(20) NOT NULL default '',
837   `description` tinytext,
838   `qty_recd` double NOT NULL default '0',
839   `quantity_inv` double NOT NULL default '0',
840   PRIMARY KEY  (`id`),
841   KEY `grn_batch_id` (`grn_batch_id`)
842 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
843
844 --
845 -- Dumping data for table `0_grn_items`
846 --
847
848
849 -- --------------------------------------------------------
850
851 --
852 -- Table structure for table `0_groups`
853 --
854
855 DROP TABLE IF EXISTS `0_groups`;
856 CREATE TABLE IF NOT EXISTS `0_groups` (
857   `id` smallint(6) unsigned NOT NULL auto_increment,
858   `description` varchar(60) NOT NULL default '',
859   `inactive` tinyint(1) NOT NULL default '0',
860   PRIMARY KEY  (`id`),
861   UNIQUE KEY `description` (`description`)
862 ) ENGINE=MyISAM  AUTO_INCREMENT=4 ;
863
864 --
865 -- Dumping data for table `0_groups`
866 --
867
868 INSERT INTO `0_groups` VALUES(1, 'Small', 0);
869 INSERT INTO `0_groups` VALUES(2, 'Medium', 0);
870 INSERT INTO `0_groups` VALUES(3, 'Large', 0);
871
872 -- --------------------------------------------------------
873
874 --
875 -- Table structure for table `0_item_codes`
876 --
877
878 DROP TABLE IF EXISTS `0_item_codes`;
879 CREATE TABLE IF NOT EXISTS `0_item_codes` (
880   `id` int(11) unsigned NOT NULL auto_increment,
881   `item_code` varchar(20) NOT NULL,
882   `stock_id` varchar(20) NOT NULL,
883   `description` varchar(200) NOT NULL default '',
884   `category_id` smallint(6) unsigned NOT NULL,
885   `quantity` double NOT NULL default '1',
886   `is_foreign` tinyint(1) NOT NULL default '0',
887   `inactive` tinyint(1) NOT NULL default '0',
888   PRIMARY KEY  (`id`),
889   UNIQUE KEY `stock_id` (`stock_id`,`item_code`),
890   KEY `item_code` (`item_code`)
891 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
892
893 --
894 -- Dumping data for table `0_item_codes`
895 --
896
897
898 -- --------------------------------------------------------
899
900 --
901 -- Table structure for table `0_item_tax_types`
902 --
903
904 DROP TABLE IF EXISTS `0_item_tax_types`;
905 CREATE TABLE IF NOT EXISTS `0_item_tax_types` (
906   `id` int(11) NOT NULL auto_increment,
907   `name` varchar(60) NOT NULL default '',
908   `exempt` tinyint(1) NOT NULL default '0',
909   `inactive` tinyint(1) NOT NULL default '0',
910   PRIMARY KEY  (`id`),
911   UNIQUE KEY `name` (`name`)
912 ) ENGINE=InnoDB  AUTO_INCREMENT=2 ;
913
914 --
915 -- Dumping data for table `0_item_tax_types`
916 --
917
918 INSERT INTO `0_item_tax_types` VALUES(1, 'Regular', 0, 0);
919
920 -- --------------------------------------------------------
921
922 --
923 -- Table structure for table `0_item_tax_type_exemptions`
924 --
925
926 DROP TABLE IF EXISTS `0_item_tax_type_exemptions`;
927 CREATE TABLE IF NOT EXISTS `0_item_tax_type_exemptions` (
928   `item_tax_type_id` int(11) NOT NULL default '0',
929   `tax_type_id` int(11) NOT NULL default '0',
930   PRIMARY KEY  (`item_tax_type_id`,`tax_type_id`)
931 ) ENGINE=InnoDB;
932
933 --
934 -- Dumping data for table `0_item_tax_type_exemptions`
935 --
936
937
938 -- --------------------------------------------------------
939
940 --
941 -- Table structure for table `0_item_units`
942 --
943
944 DROP TABLE IF EXISTS `0_item_units`;
945 CREATE TABLE IF NOT EXISTS `0_item_units` (
946   `abbr` varchar(20) NOT NULL,
947   `name` varchar(40) NOT NULL,
948   `decimals` tinyint(2) NOT NULL,
949   `inactive` tinyint(1) NOT NULL default '0',
950   PRIMARY KEY  (`abbr`),
951   UNIQUE KEY `name` (`name`)
952 ) ENGINE=MyISAM;
953
954 --
955 -- Dumping data for table `0_item_units`
956 --
957
958 INSERT INTO `0_item_units` VALUES('ea.', 'Each', 0, 0);
959
960 -- --------------------------------------------------------
961
962 --
963 -- Table structure for table `0_locations`
964 --
965
966 DROP TABLE IF EXISTS `0_locations`;
967 CREATE TABLE IF NOT EXISTS `0_locations` (
968   `loc_code` varchar(5) NOT NULL default '',
969   `location_name` varchar(60) NOT NULL default '',
970   `delivery_address` tinytext NOT NULL,
971   `phone` varchar(30) NOT NULL default '',
972   `phone2` varchar(30) NOT NULL default '',
973   `fax` varchar(30) NOT NULL default '',
974   `email` varchar(100) NOT NULL default '',
975   `contact` varchar(30) NOT NULL default '',
976   `inactive` tinyint(1) NOT NULL default '0',
977   PRIMARY KEY  (`loc_code`)
978 ) ENGINE=MyISAM;
979
980 --
981 -- Dumping data for table `0_locations`
982 --
983
984 INSERT INTO `0_locations` VALUES('DEF', 'Default', 'N/A', '', '', '', '', '', 0);
985
986 -- --------------------------------------------------------
987
988 --
989 -- Table structure for table `0_loc_stock`
990 --
991
992 DROP TABLE IF EXISTS `0_loc_stock`;
993 CREATE TABLE IF NOT EXISTS `0_loc_stock` (
994   `loc_code` char(5) NOT NULL default '',
995   `stock_id` char(20) NOT NULL default '',
996   `reorder_level` bigint(20) NOT NULL default '0',
997   PRIMARY KEY  (`loc_code`,`stock_id`),
998   KEY `stock_id` (`stock_id`)
999 ) ENGINE=InnoDB;
1000
1001 --
1002 -- Dumping data for table `0_loc_stock`
1003 --
1004
1005
1006 -- --------------------------------------------------------
1007
1008 --
1009 -- Table structure for table `0_movement_types`
1010 --
1011
1012 DROP TABLE IF EXISTS `0_movement_types`;
1013 CREATE TABLE IF NOT EXISTS `0_movement_types` (
1014   `id` int(11) NOT NULL auto_increment,
1015   `name` varchar(60) NOT NULL default '',
1016   `inactive` tinyint(1) NOT NULL default '0',
1017   PRIMARY KEY  (`id`),
1018   UNIQUE KEY `name` (`name`)
1019 ) ENGINE=MyISAM  AUTO_INCREMENT=2 ;
1020
1021 --
1022 -- Dumping data for table `0_movement_types`
1023 --
1024
1025 INSERT INTO `0_movement_types` VALUES(1, 'Adjustment', 0);
1026
1027 -- --------------------------------------------------------
1028
1029 --
1030 -- Table structure for table `0_payment_terms`
1031 --
1032
1033 DROP TABLE IF EXISTS `0_payment_terms`;
1034 CREATE TABLE IF NOT EXISTS `0_payment_terms` (
1035   `terms_indicator` int(11) NOT NULL auto_increment,
1036   `terms` char(80) NOT NULL default '',
1037   `days_before_due` smallint(6) NOT NULL default '0',
1038   `day_in_following_month` smallint(6) NOT NULL default '0',
1039   `inactive` tinyint(1) NOT NULL default '0',
1040   PRIMARY KEY  (`terms_indicator`),
1041   UNIQUE KEY `terms` (`terms`)
1042 ) ENGINE=MyISAM  AUTO_INCREMENT=5 ;
1043
1044 --
1045 -- Dumping data for table `0_payment_terms`
1046 --
1047
1048 INSERT INTO `0_payment_terms` VALUES(1, 'Due 15th Of the Following Month', 0, 17, 0);
1049 INSERT INTO `0_payment_terms` VALUES(2, 'Due By End Of The Following Month', 0, 30, 0);
1050 INSERT INTO `0_payment_terms` VALUES(3, 'Payment due within 10 days', 10, 0, 0);
1051 INSERT INTO `0_payment_terms` VALUES(4, 'Cash Only', 0, 0, 0);
1052
1053 -- --------------------------------------------------------
1054
1055 --
1056 -- Table structure for table `0_prices`
1057 --
1058
1059 DROP TABLE IF EXISTS `0_prices`;
1060 CREATE TABLE IF NOT EXISTS `0_prices` (
1061   `id` int(11) NOT NULL auto_increment,
1062   `stock_id` varchar(20) NOT NULL default '',
1063   `sales_type_id` int(11) NOT NULL default '0',
1064   `curr_abrev` char(3) NOT NULL default '',
1065   `price` double NOT NULL default '0',
1066   PRIMARY KEY  (`id`),
1067   UNIQUE KEY `price` (`stock_id`,`sales_type_id`,`curr_abrev`)
1068 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1069
1070 --
1071 -- Dumping data for table `0_prices`
1072 --
1073
1074
1075 -- --------------------------------------------------------
1076
1077 --
1078 -- Table structure for table `0_printers`
1079 --
1080
1081 DROP TABLE IF EXISTS `0_printers`;
1082 CREATE TABLE IF NOT EXISTS `0_printers` (
1083   `id` tinyint(3) unsigned NOT NULL auto_increment,
1084   `name` varchar(20) NOT NULL,
1085   `description` varchar(60) NOT NULL,
1086   `queue` varchar(20) NOT NULL,
1087   `host` varchar(40) NOT NULL,
1088   `port` smallint(11) unsigned NOT NULL,
1089   `timeout` tinyint(3) unsigned NOT NULL,
1090   PRIMARY KEY  (`id`),
1091   UNIQUE KEY `name` (`name`)
1092 ) ENGINE=MyISAM  AUTO_INCREMENT=4 ;
1093
1094 --
1095 -- Dumping data for table `0_printers`
1096 --
1097
1098 INSERT INTO `0_printers` VALUES(1, 'QL500', 'Label printer', 'QL500', 'server', 127, 20);
1099 INSERT INTO `0_printers` VALUES(2, 'Samsung', 'Main network printer', 'scx4521F', 'server', 515, 5);
1100 INSERT INTO `0_printers` VALUES(3, 'Local', 'Local print server at user IP', 'lp', '', 515, 10);
1101
1102 -- --------------------------------------------------------
1103
1104 --
1105 -- Table structure for table `0_print_profiles`
1106 --
1107
1108 DROP TABLE IF EXISTS `0_print_profiles`;
1109 CREATE TABLE IF NOT EXISTS `0_print_profiles` (
1110   `id` smallint(6) unsigned NOT NULL auto_increment,
1111   `profile` varchar(30) NOT NULL,
1112   `report` varchar(5) default NULL,
1113   `printer` tinyint(3) unsigned default NULL,
1114   PRIMARY KEY  (`id`),
1115   UNIQUE KEY `profile` (`profile`,`report`)
1116 ) ENGINE=MyISAM  AUTO_INCREMENT=10 ;
1117
1118 --
1119 -- Dumping data for table `0_print_profiles`
1120 --
1121
1122 INSERT INTO `0_print_profiles` VALUES(1, 'Out of office', '', 0);
1123 INSERT INTO `0_print_profiles` VALUES(2, 'Sales Department', '', 0);
1124 INSERT INTO `0_print_profiles` VALUES(3, 'Central', '', 2);
1125 INSERT INTO `0_print_profiles` VALUES(4, 'Sales Department', '104', 2);
1126 INSERT INTO `0_print_profiles` VALUES(5, 'Sales Department', '105', 2);
1127 INSERT INTO `0_print_profiles` VALUES(6, 'Sales Department', '107', 2);
1128 INSERT INTO `0_print_profiles` VALUES(7, 'Sales Department', '109', 2);
1129 INSERT INTO `0_print_profiles` VALUES(8, 'Sales Department', '110', 2);
1130 INSERT INTO `0_print_profiles` VALUES(9, 'Sales Department', '201', 2);
1131
1132 -- --------------------------------------------------------
1133
1134 --
1135 -- Table structure for table `0_purch_data`
1136 --
1137
1138 DROP TABLE IF EXISTS `0_purch_data`;
1139 CREATE TABLE IF NOT EXISTS `0_purch_data` (
1140   `supplier_id` int(11) NOT NULL default '0',
1141   `stock_id` char(20) NOT NULL default '',
1142   `price` double NOT NULL default '0',
1143   `suppliers_uom` char(50) NOT NULL default '',
1144   `conversion_factor` double NOT NULL default '1',
1145   `supplier_description` char(50) NOT NULL default '',
1146   PRIMARY KEY  (`supplier_id`,`stock_id`)
1147 ) ENGINE=MyISAM;
1148
1149 --
1150 -- Dumping data for table `0_purch_data`
1151 --
1152
1153
1154 -- --------------------------------------------------------
1155
1156 --
1157 -- Table structure for table `0_purch_orders`
1158 --
1159
1160 DROP TABLE IF EXISTS `0_purch_orders`;
1161 CREATE TABLE IF NOT EXISTS `0_purch_orders` (
1162   `order_no` int(11) NOT NULL auto_increment,
1163   `supplier_id` int(11) NOT NULL default '0',
1164   `comments` tinytext,
1165   `ord_date` date NOT NULL default '0000-00-00',
1166   `reference` tinytext NOT NULL,
1167   `requisition_no` tinytext,
1168   `into_stock_location` varchar(5) NOT NULL default '',
1169   `delivery_address` tinytext NOT NULL,
1170   `total` double NOT NULL default '0',
1171   `prep_amount` double NOT NULL DEFAULT '0',
1172   `alloc` double NOT NULL DEFAULT '0',
1173   `tax_included` tinyint(1) NOT NULL default '0',
1174   PRIMARY KEY  (`order_no`),
1175   KEY `ord_date` (`ord_date`)
1176 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1177
1178 --
1179 -- Dumping data for table `0_purch_orders`
1180 --
1181
1182
1183 -- --------------------------------------------------------
1184
1185 --
1186 -- Table structure for table `0_purch_order_details`
1187 --
1188
1189 DROP TABLE IF EXISTS `0_purch_order_details`;
1190 CREATE TABLE IF NOT EXISTS `0_purch_order_details` (
1191   `po_detail_item` int(11) NOT NULL auto_increment,
1192   `order_no` int(11) NOT NULL default '0',
1193   `item_code` varchar(20) NOT NULL default '',
1194   `description` tinytext,
1195   `delivery_date` date NOT NULL default '0000-00-00',
1196   `qty_invoiced` double NOT NULL default '0',
1197   `unit_price` double NOT NULL default '0',
1198   `act_price` double NOT NULL default '0',
1199   `std_cost_unit` double NOT NULL default '0',
1200   `quantity_ordered` double NOT NULL default '0',
1201   `quantity_received` double NOT NULL default '0',
1202   PRIMARY KEY  (`po_detail_item`),
1203   KEY `order` (`order_no`,`po_detail_item`),
1204   KEY `itemcode` (`item_code`)
1205 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1206
1207 --
1208 -- Dumping data for table `0_purch_order_details`
1209 --
1210
1211
1212 -- --------------------------------------------------------
1213
1214 --
1215 -- Table structure for table `0_quick_entries`
1216 --
1217
1218 DROP TABLE IF EXISTS `0_quick_entries`;
1219 CREATE TABLE IF NOT EXISTS `0_quick_entries` (
1220   `id` smallint(6) unsigned NOT NULL auto_increment,
1221   `type` tinyint(1) NOT NULL default '0',
1222   `description` varchar(60) NOT NULL,
1223   `base_amount` double NOT NULL default '0',
1224   `base_desc` varchar(60) default NULL,
1225   `bal_type` tinyint(1) NOT NULL default '0',
1226   PRIMARY KEY  (`id`),
1227   KEY `description` (`description`)
1228 ) ENGINE=MyISAM  AUTO_INCREMENT=4 ;
1229
1230 --
1231 -- Dumping data for table `0_quick_entries`
1232 --
1233
1234 INSERT INTO `0_quick_entries` VALUES(1, 1, 'Maintenance', 0, 'Amount', 0);
1235 INSERT INTO `0_quick_entries` VALUES(2, 4, 'Phone', 0, 'Amount', 0);
1236 INSERT INTO `0_quick_entries` VALUES(3, 2, 'Cash Sales', 0, 'Amount', 0);
1237
1238 -- --------------------------------------------------------
1239
1240 --
1241 -- Table structure for table `0_quick_entry_lines`
1242 --
1243
1244 DROP TABLE IF EXISTS `0_quick_entry_lines`;
1245 CREATE TABLE IF NOT EXISTS `0_quick_entry_lines` (
1246   `id` smallint(6) unsigned NOT NULL auto_increment,
1247   `qid` smallint(6) unsigned NOT NULL,
1248   `amount` double default '0',
1249   `action` varchar(2) NOT NULL,
1250   `dest_id` varchar(15) NOT NULL default '',
1251   `dimension_id` smallint(6) unsigned default NULL,
1252   `dimension2_id` smallint(6) unsigned default NULL,
1253   PRIMARY KEY  (`id`),
1254   KEY `qid` (`qid`)
1255 ) ENGINE=MyISAM  AUTO_INCREMENT=7 ;
1256
1257 --
1258 -- Dumping data for table `0_quick_entry_lines`
1259 --
1260
1261 INSERT INTO `0_quick_entry_lines` VALUES(1, 1, 0, 't-', '1', 0, 0);
1262 INSERT INTO `0_quick_entry_lines` VALUES(2, 2, 0, 't-', '1', 0, 0);
1263 INSERT INTO `0_quick_entry_lines` VALUES(3, 3, 0, 't-', '1', 0, 0);
1264 INSERT INTO `0_quick_entry_lines` VALUES(4, 3, 0, '=', '4010', 0, 0);
1265 INSERT INTO `0_quick_entry_lines` VALUES(5, 1, 0, '=', '5765', 0, 0);
1266 INSERT INTO `0_quick_entry_lines` VALUES(6, 2, 0, '=', '5780', 0, 0);
1267
1268 -- --------------------------------------------------------
1269
1270 --
1271 -- Table structure for table `0_recurrent_invoices`
1272 --
1273
1274 DROP TABLE IF EXISTS `0_recurrent_invoices`;
1275 CREATE TABLE IF NOT EXISTS `0_recurrent_invoices` (
1276   `id` smallint(6) unsigned NOT NULL auto_increment,
1277   `description` varchar(60) NOT NULL default '',
1278   `order_no` int(11) unsigned NOT NULL,
1279   `debtor_no` int(11) unsigned default NULL,
1280   `group_no` smallint(6) unsigned default NULL,
1281   `days` int(11) NOT NULL default '0',
1282   `monthly` int(11) NOT NULL default '0',
1283   `begin` date NOT NULL default '0000-00-00',
1284   `end` date NOT NULL default '0000-00-00',
1285   `last_sent` date NOT NULL default '0000-00-00',
1286   PRIMARY KEY  (`id`),
1287   UNIQUE KEY `description` (`description`)
1288 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1289
1290 --
1291 -- Dumping data for table `0_recurrent_invoices`
1292 --
1293
1294
1295 -- --------------------------------------------------------
1296
1297 --
1298 -- Table structure for table `0_refs`
1299 --
1300
1301 DROP TABLE IF EXISTS `0_refs`;
1302 CREATE TABLE IF NOT EXISTS `0_refs` (
1303   `id` int(11) NOT NULL default '0',
1304   `type` int(11) NOT NULL default '0',
1305   `reference` varchar(100) NOT NULL default '',
1306   PRIMARY KEY  (`id`,`type`),
1307   KEY `Type_and_Reference` (`type`,`reference`)
1308 ) ENGINE=InnoDB;
1309
1310 --
1311 -- Dumping data for table `0_refs`
1312 --
1313
1314
1315 -- --------------------------------------------------------
1316
1317 --
1318 -- Table structure for table `0_salesman`
1319 --
1320
1321 DROP TABLE IF EXISTS `0_salesman`;
1322 CREATE TABLE IF NOT EXISTS `0_salesman` (
1323   `salesman_code` int(11) NOT NULL auto_increment,
1324   `salesman_name` char(60) NOT NULL default '',
1325   `salesman_phone` char(30) NOT NULL default '',
1326   `salesman_fax` char(30) NOT NULL default '',
1327   `salesman_email` varchar(100) NOT NULL default '',
1328   `provision` double NOT NULL default '0',
1329   `break_pt` double NOT NULL default '0',
1330   `provision2` double NOT NULL default '0',
1331   `inactive` tinyint(1) NOT NULL default '0',
1332   PRIMARY KEY  (`salesman_code`),
1333   UNIQUE KEY `salesman_name` (`salesman_name`)
1334 ) ENGINE=MyISAM  AUTO_INCREMENT=2 ;
1335
1336 --
1337 -- Dumping data for table `0_salesman`
1338 --
1339
1340 INSERT INTO `0_salesman` VALUES(1, 'Sales Person', '', '', '', 5, 1000, 4, 0);
1341
1342 -- --------------------------------------------------------
1343
1344 --
1345 -- Table structure for table `0_sales_orders`
1346 --
1347
1348 DROP TABLE IF EXISTS `0_sales_orders`;
1349 CREATE TABLE IF NOT EXISTS `0_sales_orders` (
1350   `order_no` int(11) NOT NULL,
1351   `trans_type` smallint(6) NOT NULL default '30',
1352   `version` tinyint(1) unsigned NOT NULL default '0',
1353   `type` tinyint(1) NOT NULL default '0',
1354   `debtor_no` int(11) NOT NULL default '0',
1355   `branch_code` int(11) NOT NULL default '0',
1356   `reference` varchar(100) NOT NULL default '',
1357   `customer_ref` tinytext NOT NULL,
1358   `comments` tinytext,
1359   `ord_date` date NOT NULL default '0000-00-00',
1360   `order_type` int(11) NOT NULL default '0',
1361   `ship_via` int(11) NOT NULL default '0',
1362   `delivery_address` tinytext NOT NULL,
1363   `contact_phone` varchar(30) default NULL,
1364   `contact_email` varchar(100) default NULL,
1365   `deliver_to` tinytext NOT NULL,
1366   `freight_cost` double NOT NULL default '0',
1367   `from_stk_loc` varchar(5) NOT NULL default '',
1368   `delivery_date` date NOT NULL default '0000-00-00',
1369   `payment_terms` int(11) default NULL,
1370   `total` double NOT NULL default '0',
1371   `prep_amount` double NOT NULL DEFAULT '0',
1372   `alloc` double NOT NULL DEFAULT '0',
1373   PRIMARY KEY  (`trans_type`,`order_no`)
1374 ) ENGINE=InnoDB;
1375
1376 --
1377 -- Dumping data for table `0_sales_orders`
1378 --
1379
1380
1381 -- --------------------------------------------------------
1382
1383 --
1384 -- Table structure for table `0_sales_order_details`
1385 --
1386
1387 DROP TABLE IF EXISTS `0_sales_order_details`;
1388 CREATE TABLE IF NOT EXISTS `0_sales_order_details` (
1389   `id` int(11) NOT NULL auto_increment,
1390   `order_no` int(11) NOT NULL default '0',
1391   `trans_type` smallint(6) NOT NULL default '30',
1392   `stk_code` varchar(20) NOT NULL default '',
1393   `description` tinytext,
1394   `qty_sent` double NOT NULL default '0',
1395   `unit_price` double NOT NULL default '0',
1396   `quantity` double NOT NULL default '0',
1397   `invoiced` double NOT NULL DEFAULT '0',
1398   `discount_percent` double NOT NULL default '0',
1399   PRIMARY KEY  (`id`),
1400   KEY `sorder` (`trans_type`,`order_no`),
1401   KEY `stkcode` (`stk_code`)
1402 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1403
1404 --
1405 -- Dumping data for table `0_sales_order_details`
1406 --
1407
1408
1409 -- --------------------------------------------------------
1410
1411 --
1412 -- Table structure for table `0_sales_pos`
1413 --
1414
1415 DROP TABLE IF EXISTS `0_sales_pos`;
1416 CREATE TABLE IF NOT EXISTS `0_sales_pos` (
1417   `id` smallint(6) unsigned NOT NULL auto_increment,
1418   `pos_name` varchar(30) NOT NULL,
1419   `cash_sale` tinyint(1) NOT NULL,
1420   `credit_sale` tinyint(1) NOT NULL,
1421   `pos_location` varchar(5) NOT NULL,
1422   `pos_account` smallint(6) unsigned NOT NULL,
1423   `inactive` tinyint(1) NOT NULL default '0',
1424   PRIMARY KEY  (`id`),
1425   UNIQUE KEY `pos_name` (`pos_name`)
1426 ) ENGINE=MyISAM  AUTO_INCREMENT=2 ;
1427
1428 --
1429 -- Dumping data for table `0_sales_pos`
1430 --
1431
1432 INSERT INTO `0_sales_pos` VALUES(1, 'Default', 1, 1, 'DEF', 2, 0);
1433
1434 -- --------------------------------------------------------
1435
1436 --
1437 -- Table structure for table `0_sales_types`
1438 --
1439
1440 DROP TABLE IF EXISTS `0_sales_types`;
1441 CREATE TABLE IF NOT EXISTS `0_sales_types` (
1442   `id` int(11) NOT NULL auto_increment,
1443   `sales_type` char(50) NOT NULL default '',
1444   `tax_included` int(1) NOT NULL default '0',
1445   `factor` double NOT NULL default '1',
1446   `inactive` tinyint(1) NOT NULL default '0',
1447   PRIMARY KEY  (`id`),
1448   UNIQUE KEY `sales_type` (`sales_type`)
1449 ) ENGINE=MyISAM  AUTO_INCREMENT=3 ;
1450
1451 --
1452 -- Dumping data for table `0_sales_types`
1453 --
1454
1455 INSERT INTO `0_sales_types` VALUES(1, 'Retail', 1, 1, 0);
1456 INSERT INTO `0_sales_types` VALUES(2, 'Wholesale', 0, 0.7, 0);
1457
1458 -- --------------------------------------------------------
1459
1460 --
1461 -- Table structure for table `0_security_roles`
1462 --
1463
1464 DROP TABLE IF EXISTS `0_security_roles`;
1465 CREATE TABLE IF NOT EXISTS `0_security_roles` (
1466   `id` int(11) NOT NULL auto_increment,
1467   `role` varchar(30) NOT NULL,
1468   `description` varchar(50) default NULL,
1469   `sections` text,
1470   `areas` text,
1471   `inactive` tinyint(1) NOT NULL default '0',
1472   PRIMARY KEY  (`id`),
1473   UNIQUE KEY `role` (`role`)
1474 ) ENGINE=MyISAM  AUTO_INCREMENT=11 ;
1475
1476 --
1477 -- Dumping data for table `0_security_roles`
1478 --
1479
1480 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);
1481 INSERT INTO `0_security_roles` VALUES(2, 'System Administrator', 'System Administrator', '256;512;768;2816;3072;3328;5376;5632;5888;7936;8192;8448;10496;10752;11008;13056;13312;15616;15872;16128', '257;258;259;260;513;514;515;516;517;518;519;520;521;522;523;524;525;526;769;770;771;772;773;774;2817;2818;2819;2820;2821;2822;2823;3073;3074;3082;3075;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5634;5635;5636;5637;5641;5638;5639;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8195;8196;8197;8449;8450;8451;10497;10753;10754;10755;10756;10757;11009;11010;11011;11012;13057;13313;13314;13315;15617;15618;15619;15620;15621;15622;15623;15624;15628;15625;15626;15627;15873;15874;15875;15876;15877;15878;15879;15880;15883;15881;15882;16129;16130;16131;16132;775', 0);
1482 INSERT INTO `0_security_roles` VALUES(3, 'Salesman', 'Salesman', '768;3072;5632;8192;15872', '773;774;3073;3075;3081;5633;8194;15873;775', 0);
1483 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);
1484 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);
1485 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);
1486 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);
1487 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);
1488 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);
1489 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);
1490
1491 -- --------------------------------------------------------
1492
1493 --
1494 -- Table structure for table `0_shippers`
1495 --
1496
1497 DROP TABLE IF EXISTS `0_shippers`;
1498 CREATE TABLE IF NOT EXISTS `0_shippers` (
1499   `shipper_id` int(11) NOT NULL auto_increment,
1500   `shipper_name` varchar(60) NOT NULL default '',
1501   `phone` varchar(30) NOT NULL default '',
1502   `phone2` varchar(30) NOT NULL default '',
1503   `contact` tinytext NOT NULL,
1504   `address` tinytext NOT NULL,
1505   `inactive` tinyint(1) NOT NULL default '0',
1506   PRIMARY KEY  (`shipper_id`),
1507   UNIQUE KEY `name` (`shipper_name`)
1508 ) ENGINE=MyISAM  AUTO_INCREMENT=2 ;
1509
1510 --
1511 -- Dumping data for table `0_shippers`
1512 --
1513
1514 INSERT INTO `0_shippers` VALUES(1, 'Default', '', '', '', '', 0);
1515
1516 -- --------------------------------------------------------
1517
1518 --
1519 -- Table structure for table `0_sql_trail`
1520 --
1521
1522 DROP TABLE IF EXISTS `0_sql_trail`;
1523 CREATE TABLE IF NOT EXISTS `0_sql_trail` (
1524   `id` int(11) unsigned NOT NULL auto_increment,
1525   `sql` text NOT NULL,
1526   `result` tinyint(1) NOT NULL,
1527   `msg` varchar(255) NOT NULL,
1528   PRIMARY KEY  (`id`)
1529 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1530
1531 --
1532 -- Dumping data for table `0_sql_trail`
1533 --
1534
1535
1536 -- --------------------------------------------------------
1537
1538 --
1539 -- Table structure for table `0_stock_category`
1540 --
1541
1542 DROP TABLE IF EXISTS `0_stock_category`;
1543 CREATE TABLE IF NOT EXISTS `0_stock_category` (
1544   `category_id` int(11) NOT NULL auto_increment,
1545   `description` varchar(60) NOT NULL default '',
1546   `dflt_tax_type` int(11) NOT NULL default '1',
1547   `dflt_units` varchar(20) NOT NULL default 'each',
1548   `dflt_mb_flag` char(1) NOT NULL default 'B',
1549   `dflt_sales_act` varchar(15) NOT NULL default '',
1550   `dflt_cogs_act` varchar(15) NOT NULL default '',
1551   `dflt_inventory_act` varchar(15) NOT NULL default '',
1552   `dflt_adjustment_act` varchar(15) NOT NULL default '',
1553   `dflt_assembly_act` varchar(15) NOT NULL default '',
1554   `dflt_dim1` int(11) default NULL,
1555   `dflt_dim2` int(11) default NULL,
1556   `inactive` tinyint(1) NOT NULL default '0',
1557   `dflt_no_sale` tinyint(1) NOT NULL default '0',
1558   `dflt_no_sale` tinyint(1) NOT NULL default '0',
1559   PRIMARY KEY  (`category_id`),
1560   UNIQUE KEY `description` (`description`)
1561 ) ENGINE=MyISAM  AUTO_INCREMENT=5 ;
1562
1563 --
1564 -- Dumping data for table `0_stock_category`
1565 --
1566
1567 INSERT INTO `0_stock_category` VALUES(1, 'Components', 1, 'each', 'B', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1568 INSERT INTO `0_stock_category` VALUES(2, 'Charges', 1, 'each', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1569 INSERT INTO `0_stock_category` VALUES(3, 'Systems', 1, 'each', 'M', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1570 INSERT INTO `0_stock_category` VALUES(4, 'Services', 1, 'hrs', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1571
1572 -- --------------------------------------------------------
1573
1574 --
1575 -- Table structure for table `0_stock_master`
1576 --
1577
1578 DROP TABLE IF EXISTS `0_stock_master`;
1579 CREATE TABLE IF NOT EXISTS `0_stock_master` (
1580   `stock_id` varchar(20) NOT NULL default '',
1581   `category_id` int(11) NOT NULL default '0',
1582   `tax_type_id` int(11) NOT NULL default '0',
1583   `description` varchar(200) NOT NULL default '',
1584   `long_description` tinytext NOT NULL,
1585   `units` varchar(20) NOT NULL default 'each',
1586   `mb_flag` char(1) NOT NULL default 'B',
1587   `sales_account` varchar(15) NOT NULL default '',
1588   `cogs_account` varchar(15) NOT NULL default '',
1589   `inventory_account` varchar(15) NOT NULL default '',
1590   `adjustment_account` varchar(15) NOT NULL default '',
1591   `assembly_account` varchar(15) NOT NULL default '',
1592   `dimension_id` int(11) default NULL,
1593   `dimension2_id` int(11) default NULL,
1594   `actual_cost` double NOT NULL default '0',
1595   `last_cost` double NOT NULL default '0',
1596   `material_cost` double NOT NULL default '0',
1597   `labour_cost` double NOT NULL default '0',
1598   `overhead_cost` double NOT NULL default '0',
1599   `inactive` tinyint(1) NOT NULL default '0',
1600   `no_sale` tinyint(1) NOT NULL default '0',
1601   `no_purchase` tinyint(1) NOT NULL default '0',
1602   `editable` tinyint(1) NOT NULL default '0',
1603   PRIMARY KEY  (`stock_id`)
1604 ) ENGINE=InnoDB;
1605
1606 --
1607 -- Dumping data for table `0_stock_master`
1608 --
1609
1610
1611 -- --------------------------------------------------------
1612
1613 --
1614 -- Table structure for table `0_stock_moves`
1615 --
1616
1617 DROP TABLE IF EXISTS `0_stock_moves`;
1618 CREATE TABLE IF NOT EXISTS `0_stock_moves` (
1619   `trans_id` int(11) NOT NULL auto_increment,
1620   `trans_no` int(11) NOT NULL default '0',
1621   `stock_id` char(20) NOT NULL default '',
1622   `type` smallint(6) NOT NULL default '0',
1623   `loc_code` char(5) NOT NULL default '',
1624   `tran_date` date NOT NULL default '0000-00-00',
1625   `person_id` int(11) default NULL,
1626   `price` double NOT NULL default '0',
1627   `reference` char(40) NOT NULL default '',
1628   `qty` double NOT NULL default '1',
1629   `discount_percent` double NOT NULL default '0',
1630   `standard_cost` double NOT NULL default '0',
1631   `visible` tinyint(1) NOT NULL default '1',
1632   PRIMARY KEY  (`trans_id`),
1633   KEY `type` (`type`,`trans_no`),
1634   KEY `Move` (`stock_id`,`loc_code`,`tran_date`)
1635 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1636
1637 --
1638 -- Dumping data for table `0_stock_moves`
1639 --
1640
1641
1642 -- --------------------------------------------------------
1643
1644 --
1645 -- Table structure for table `0_suppliers`
1646 --
1647
1648 DROP TABLE IF EXISTS `0_suppliers`;
1649 CREATE TABLE IF NOT EXISTS `0_suppliers` (
1650   `supplier_id` int(11) NOT NULL auto_increment,
1651   `supp_name` varchar(60) NOT NULL default '',
1652   `supp_ref` varchar(30) NOT NULL default '',
1653   `address` tinytext NOT NULL,
1654   `supp_address` tinytext NOT NULL,
1655   `gst_no` varchar(25) NOT NULL default '',
1656   `contact` varchar(60) NOT NULL default '',
1657   `supp_account_no` varchar(40) NOT NULL default '',
1658   `website` varchar(100) NOT NULL default '',
1659   `bank_account` varchar(60) NOT NULL default '',
1660   `curr_code` char(3) default NULL,
1661   `payment_terms` int(11) default NULL,
1662   `tax_included` tinyint(1) NOT NULL default '0',
1663   `tax_algorithm` tinyint(1) NOT NULL default '1',
1664   `dimension_id` int(11) default '0',
1665   `dimension2_id` int(11) default '0',
1666   `tax_group_id` int(11) default NULL,
1667   `credit_limit` double NOT NULL default '0',
1668   `purchase_account` varchar(15) NOT NULL default '',
1669   `payable_account` varchar(15) NOT NULL default '',
1670   `payment_discount_account` varchar(15) NOT NULL default '',
1671   `notes` tinytext NOT NULL,
1672   `inactive` tinyint(1) NOT NULL default '0',
1673   PRIMARY KEY  (`supplier_id`),
1674   KEY `supp_ref` (`supp_ref`)
1675 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1676
1677 --
1678 -- Dumping data for table `0_suppliers`
1679 --
1680
1681
1682 -- --------------------------------------------------------
1683
1684 --
1685 -- Table structure for table `0_supp_allocations`
1686 --
1687
1688 DROP TABLE IF EXISTS `0_supp_allocations`;
1689 CREATE TABLE IF NOT EXISTS `0_supp_allocations` (
1690   `id` int(11) NOT NULL auto_increment,
1691   `amt` double unsigned default NULL,
1692   `date_alloc` date NOT NULL default '0000-00-00',
1693   `trans_no_from` int(11) default NULL,
1694   `trans_type_from` int(11) default NULL,
1695   `trans_no_to` int(11) default NULL,
1696   `trans_type_to` int(11) default NULL,
1697   PRIMARY KEY (`id`),
1698   UNIQUE KEY (`trans_type_from`,`trans_no_from`,`trans_type_to`,`trans_no_to`),
1699   KEY `From` (`trans_type_from`,`trans_no_from`),
1700   KEY `To` (`trans_type_to`,`trans_no_to`)
1701 ) ENGINE=InnoDB  AUTO_INCREMENT=1 ;
1702
1703 --
1704 -- Dumping data for table `0_supp_allocations`
1705 --
1706
1707
1708 -- --------------------------------------------------------
1709
1710 --
1711 -- Table structure for table `0_supp_invoice_items`
1712 --
1713
1714 DROP TABLE IF EXISTS `0_supp_invoice_items`;
1715 CREATE TABLE IF NOT EXISTS `0_supp_invoice_items` (
1716   `id` int(11) NOT NULL auto_increment,
1717   `supp_trans_no` int(11) default NULL,
1718   `supp_trans_type` int(11) default NULL,
1719   `gl_code` varchar(15) NOT NULL default '',
1720   `grn_item_id` int(11) default NULL,
1721   `po_detail_item_id` int(11) default NULL,
1722   `stock_id` varchar(20) NOT NULL default '',
1723   `description` tinytext,
1724   `quantity` double NOT NULL default '0',
1725   `unit_price` double NOT NULL default '0',
1726   `unit_tax` double NOT NULL default '0',
1727   `memo_` tinytext,
1728   PRIMARY KEY  (`id`),
1729   KEY `Transaction` (`supp_trans_type`,`supp_trans_no`,`stock_id`)
1730 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
1731
1732 --
1733 -- Dumping data for table `0_supp_invoice_items`
1734 --
1735
1736
1737 -- --------------------------------------------------------
1738
1739 --
1740 -- Table structure for table `0_supp_trans`
1741 --
1742
1743 DROP TABLE IF EXISTS `0_supp_trans`;
1744 CREATE TABLE IF NOT EXISTS `0_supp_trans` (
1745   `trans_no` int(11) unsigned NOT NULL default '0',
1746   `type` smallint(6) unsigned NOT NULL default '0',
1747   `supplier_id` int(11) unsigned default NULL,
1748   `reference` tinytext NOT NULL,
1749   `supp_reference` varchar(60) NOT NULL default '',
1750   `tran_date` date NOT NULL default '0000-00-00',
1751   `due_date` date NOT NULL default '0000-00-00',
1752   `ov_amount` double NOT NULL default '0',
1753   `ov_discount` double NOT NULL default '0',
1754   `ov_gst` double NOT NULL default '0',
1755   `rate` double NOT NULL default '1',
1756   `alloc` double NOT NULL default '0',
1757   `tax_included` tinyint(1) NOT NULL default '0',
1758   `tax_algorithm` tinyint(1) NOT NULL default '1',
1759   PRIMARY KEY  (`type`,`trans_no`),
1760   KEY `supplier_id` (`supplier_id`),
1761   KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
1762   KEY `type` (`type`),
1763   KEY `tran_date` (`tran_date`)
1764 ) ENGINE=InnoDB;
1765
1766 --
1767 -- Dumping data for table `0_supp_trans`
1768 --
1769
1770
1771 -- --------------------------------------------------------
1772
1773 --
1774 -- Table structure for table `0_sys_prefs`
1775 --
1776
1777 DROP TABLE IF EXISTS `0_sys_prefs`;
1778 CREATE TABLE IF NOT EXISTS `0_sys_prefs` (
1779   `name` varchar(35) NOT NULL default '',
1780   `category` varchar(30) default NULL,
1781   `type` varchar(20) NOT NULL default '',
1782   `length` smallint(6) default NULL,
1783   `value` text NOT NULL,
1784   PRIMARY KEY  (`name`),
1785   KEY `category` (`category`)
1786 ) ENGINE=MyISAM;
1787
1788 --
1789 -- Dumping data for table `0_sys_prefs`
1790 --
1791
1792 INSERT INTO `0_sys_prefs` VALUES('coy_name', 'setup.company', 'varchar', 60, 'Company name');
1793 INSERT INTO `0_sys_prefs` VALUES('gst_no', 'setup.company', 'varchar', 25, '');
1794 INSERT INTO `0_sys_prefs` VALUES('coy_no', 'setup.company', 'varchar', 25, '');
1795 INSERT INTO `0_sys_prefs` VALUES('tax_prd', 'setup.company', 'int', 11, '1');
1796 INSERT INTO `0_sys_prefs` VALUES('tax_last', 'setup.company', 'int', 11, '1');
1797 INSERT INTO `0_sys_prefs` VALUES('postal_address', 'setup.company', 'tinytext', 0, 'N/A');
1798 INSERT INTO `0_sys_prefs` VALUES('phone', 'setup.company', 'varchar', 30, '');
1799 INSERT INTO `0_sys_prefs` VALUES('fax', 'setup.company', 'varchar', 30, '');
1800 INSERT INTO `0_sys_prefs` VALUES('email', 'setup.company', 'varchar', 100, '');
1801 INSERT INTO `0_sys_prefs` VALUES('coy_logo', 'setup.company', 'varchar', 100, '');
1802 INSERT INTO `0_sys_prefs` VALUES('domicile', 'setup.company', 'varchar', 55, '');
1803 INSERT INTO `0_sys_prefs` VALUES('curr_default', 'setup.company', 'char', 3, 'USD');
1804 INSERT INTO `0_sys_prefs` VALUES('use_dimension', 'setup.company', 'tinyint', 1, '1');
1805 INSERT INTO `0_sys_prefs` VALUES('f_year', 'setup.company', 'int', 11, '6');
1806 INSERT INTO `0_sys_prefs` VALUES('no_item_list', 'setup.company', 'tinyint', 1, '0');
1807 INSERT INTO `0_sys_prefs` VALUES('no_customer_list', 'setup.company', 'tinyint', 1, '0');
1808 INSERT INTO `0_sys_prefs` VALUES('no_supplier_list', 'setup.company', 'tinyint', 1, '0');
1809 INSERT INTO `0_sys_prefs` VALUES('base_sales', 'setup.company', 'int', 11, '1');
1810 INSERT INTO `0_sys_prefs` VALUES('time_zone', 'setup.company', 'tinyint', 1, '0');
1811 INSERT INTO `0_sys_prefs` VALUES('add_pct', 'setup.company', 'int', 5, '-1');
1812 INSERT INTO `0_sys_prefs` VALUES('round_to', 'setup.company', 'int', 5, '1');
1813 INSERT INTO `0_sys_prefs` VALUES('login_tout', 'setup.company', 'smallint', 6, '600');
1814 INSERT INTO `0_sys_prefs` VALUES('past_due_days', 'glsetup.general', 'int', 11, '30');
1815 INSERT INTO `0_sys_prefs` VALUES('profit_loss_year_act', 'glsetup.general', 'varchar', 15, '9990');
1816 INSERT INTO `0_sys_prefs` VALUES('retained_earnings_act', 'glsetup.general', 'varchar', 15, '3590');
1817 INSERT INTO `0_sys_prefs` VALUES('bank_charge_act', 'glsetup.general', 'varchar', 15, '5690');
1818 INSERT INTO `0_sys_prefs` VALUES('exchange_diff_act', 'glsetup.general', 'varchar', 15, '4450');
1819 INSERT INTO `0_sys_prefs` VALUES('tax_algorithm', 'glsetup.customer', 'tinyint', 1, '1');
1820 INSERT INTO `0_sys_prefs` VALUES('default_credit_limit', 'glsetup.customer', 'int', 11, '1000');
1821 INSERT INTO `0_sys_prefs` VALUES('accumulate_shipping', 'glsetup.customer', 'tinyint', 1, '0');
1822 INSERT INTO `0_sys_prefs` VALUES('legal_text', 'glsetup.customer', 'tinytext', 0, '');
1823 INSERT INTO `0_sys_prefs` VALUES('freight_act', 'glsetup.customer', 'varchar', 15, '4430');
1824 INSERT INTO `0_sys_prefs` VALUES('debtors_act', 'glsetup.sales', 'varchar', 15, '1200');
1825 INSERT INTO `0_sys_prefs` VALUES('default_sales_act', 'glsetup.sales', 'varchar', 15, '4010');
1826 INSERT INTO `0_sys_prefs` VALUES('default_sales_discount_act', 'glsetup.sales', 'varchar', 15, '4510');
1827 INSERT INTO `0_sys_prefs` VALUES('default_prompt_payment_act', 'glsetup.sales', 'varchar', 15, '4500');
1828 INSERT INTO `0_sys_prefs` VALUES('default_delivery_required', 'glsetup.sales', 'smallint', 6, '1');
1829 INSERT INTO `0_sys_prefs` VALUES('default_receival_required', 'glsetup.purchase', 'smallint', 6, '10');
1830 INSERT INTO `0_sys_prefs` VALUES('default_dim_required', 'glsetup.dims', 'int', 11, '20');
1831 INSERT INTO `0_sys_prefs` VALUES('pyt_discount_act', 'glsetup.purchase', 'varchar', 15, '5060');
1832 INSERT INTO `0_sys_prefs` VALUES('creditors_act', 'glsetup.purchase', 'varchar', 15, '2100');
1833 INSERT INTO `0_sys_prefs` VALUES('po_over_receive', 'glsetup.purchase', 'int', 11, '10');
1834 INSERT INTO `0_sys_prefs` VALUES('po_over_charge', 'glsetup.purchase', 'int', 11, '10');
1835 INSERT INTO `0_sys_prefs` VALUES('allow_negative_stock', 'glsetup.inventory', 'tinyint', 1, '0');
1836 INSERT INTO `0_sys_prefs` VALUES('default_inventory_act', 'glsetup.items', 'varchar', 15, '1510');
1837 INSERT INTO `0_sys_prefs` VALUES('default_cogs_act', 'glsetup.items', 'varchar', 15, '5010');
1838 INSERT INTO `0_sys_prefs` VALUES('default_adj_act', 'glsetup.items', 'varchar', 15, '5040');
1839 INSERT INTO `0_sys_prefs` VALUES('default_inv_sales_act', 'glsetup.items', 'varchar', 15, '4010');
1840 INSERT INTO `0_sys_prefs` VALUES('default_assembly_act', 'glsetup.items', 'varchar', 15, '1530');
1841 INSERT INTO `0_sys_prefs` VALUES('default_workorder_required', 'glsetup.manuf', 'int', 11, '20');
1842 INSERT INTO `0_sys_prefs` VALUES('version_id', 'system', 'varchar', 11, '2.3rc');
1843 INSERT INTO `0_sys_prefs` VALUES('auto_curr_reval', 'setup.company', 'smallint', 6, '1');
1844 INSERT INTO `0_sys_prefs` VALUES('grn_clearing_act', 'glsetup.purchase', 'varchar', 15, '1550');
1845 INSERT INTO `0_sys_prefs` VALUES('bcc_email', 'setup.company', 'varchar', 100, '');
1846 INSERT INTO `0_sys_prefs` VALUES('deferred_income_act', 'glsetup.sales', 'varchar', '15', '');
1847 INSERT INTO `0_sys_prefs` VALUES('gl_closing_date','setup.closing_date', 'date', 8, '');
1848
1849 -- --------------------------------------------------------
1850
1851 --
1852 -- Table structure for table `0_sys_types`
1853 --
1854
1855 DROP TABLE IF EXISTS `0_sys_types`;
1856 CREATE TABLE IF NOT EXISTS `0_sys_types` (
1857   `type_id` smallint(6) NOT NULL default '0',
1858   `type_no` int(11) NOT NULL default '1',
1859   `next_reference` varchar(100) NOT NULL default '',
1860   PRIMARY KEY  (`type_id`)
1861 ) ENGINE=InnoDB;
1862
1863 --
1864 -- Dumping data for table `0_sys_types`
1865 --
1866
1867 INSERT INTO `0_sys_types` VALUES(0, 17, '1');
1868 INSERT INTO `0_sys_types` VALUES(1, 7, '1');
1869 INSERT INTO `0_sys_types` VALUES(2, 4, '1');
1870 INSERT INTO `0_sys_types` VALUES(4, 3, '1');
1871 INSERT INTO `0_sys_types` VALUES(10, 16, '1');
1872 INSERT INTO `0_sys_types` VALUES(11, 2, '1');
1873 INSERT INTO `0_sys_types` VALUES(12, 6, '1');
1874 INSERT INTO `0_sys_types` VALUES(13, 1, '1');
1875 INSERT INTO `0_sys_types` VALUES(16, 2, '1');
1876 INSERT INTO `0_sys_types` VALUES(17, 2, '1');
1877 INSERT INTO `0_sys_types` VALUES(18, 1, '1');
1878 INSERT INTO `0_sys_types` VALUES(20, 6, '1');
1879 INSERT INTO `0_sys_types` VALUES(21, 1, '1');
1880 INSERT INTO `0_sys_types` VALUES(22, 3, '1');
1881 INSERT INTO `0_sys_types` VALUES(25, 1, '1');
1882 INSERT INTO `0_sys_types` VALUES(26, 1, '1');
1883 INSERT INTO `0_sys_types` VALUES(28, 1, '1');
1884 INSERT INTO `0_sys_types` VALUES(29, 1, '1');
1885 INSERT INTO `0_sys_types` VALUES(30, 0, '1');
1886 INSERT INTO `0_sys_types` VALUES(32, 0, '1');
1887 INSERT INTO `0_sys_types` VALUES(35, 1, '1');
1888 INSERT INTO `0_sys_types` VALUES(40, 1, '1');
1889
1890 -- --------------------------------------------------------
1891
1892 --
1893 -- Table structure for table `0_tags`
1894 --
1895
1896 DROP TABLE IF EXISTS `0_tags`;
1897 CREATE TABLE IF NOT EXISTS `0_tags` (
1898   `id` int(11) NOT NULL auto_increment,
1899   `type` smallint(6) NOT NULL,
1900   `name` varchar(30) NOT NULL,
1901   `description` varchar(60) default NULL,
1902   `inactive` tinyint(1) NOT NULL default '0',
1903   PRIMARY KEY  (`id`),
1904   UNIQUE KEY `type` (`type`,`name`)
1905 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
1906
1907 --
1908 -- Dumping data for table `0_tags`
1909 --
1910
1911
1912 -- --------------------------------------------------------
1913
1914 --
1915 -- Table structure for table `0_tag_associations`
1916 --
1917
1918 DROP TABLE IF EXISTS `0_tag_associations`;
1919 CREATE TABLE IF NOT EXISTS `0_tag_associations` (
1920   `record_id` varchar(15) NOT NULL,
1921   `tag_id` int(11) NOT NULL,
1922   UNIQUE KEY `record_id` (`record_id`,`tag_id`)
1923 ) ENGINE=MyISAM;
1924
1925 --
1926 -- Dumping data for table `0_tag_associations`
1927 --
1928
1929
1930 -- --------------------------------------------------------
1931
1932 --
1933 -- Table structure for table `0_tax_groups`
1934 --
1935
1936 DROP TABLE IF EXISTS `0_tax_groups`;
1937 CREATE TABLE IF NOT EXISTS `0_tax_groups` (
1938   `id` int(11) NOT NULL auto_increment,
1939   `name` varchar(60) NOT NULL default '',
1940   `inactive` tinyint(1) NOT NULL default '0',
1941   PRIMARY KEY  (`id`),
1942   UNIQUE KEY `name` (`name`)
1943 ) ENGINE=InnoDB  AUTO_INCREMENT=3 ;
1944
1945 --
1946 -- Dumping data for table `0_tax_groups`
1947 --
1948
1949 INSERT INTO `0_tax_groups` VALUES(1, 'Tax', 0);
1950 INSERT INTO `0_tax_groups` VALUES(2, 'Tax Exempt', 0);
1951
1952 -- --------------------------------------------------------
1953
1954 --
1955 -- Table structure for table `0_tax_group_items`
1956 --
1957
1958 DROP TABLE IF EXISTS `0_tax_group_items`;
1959 CREATE TABLE IF NOT EXISTS `0_tax_group_items` (
1960   `tax_group_id` int(11) NOT NULL default '0',
1961   `tax_type_id` int(11) NOT NULL default '0',
1962   `tax_shipping` tinyint(1) NOT NULL default '0',
1963   PRIMARY KEY  (`tax_group_id`,`tax_type_id`)
1964 ) ENGINE=InnoDB;
1965
1966 --
1967 -- Dumping data for table `0_tax_group_items`
1968 --
1969
1970 INSERT INTO `0_tax_group_items` VALUES(1, 1, 1);
1971
1972 -- --------------------------------------------------------
1973
1974 --
1975 -- Table structure for table `0_tax_types`
1976 --
1977
1978 DROP TABLE IF EXISTS `0_tax_types`;
1979 CREATE TABLE IF NOT EXISTS `0_tax_types` (
1980   `id` int(11) NOT NULL auto_increment,
1981   `rate` double NOT NULL default '0',
1982   `sales_gl_code` varchar(15) NOT NULL default '',
1983   `purchasing_gl_code` varchar(15) NOT NULL default '',
1984   `name` varchar(60) NOT NULL default '',
1985   `inactive` tinyint(1) NOT NULL default '0',
1986   PRIMARY KEY  (`id`)
1987 ) ENGINE=InnoDB  AUTO_INCREMENT=2 ;
1988
1989 --
1990 -- Dumping data for table `0_tax_types`
1991 --
1992
1993 INSERT INTO `0_tax_types` VALUES(1, 5, '2150', '2150', 'Tax', 0);
1994
1995 -- --------------------------------------------------------
1996
1997 --
1998 -- Table structure for table `0_trans_tax_details`
1999 --
2000
2001 DROP TABLE IF EXISTS `0_trans_tax_details`;
2002 CREATE TABLE IF NOT EXISTS `0_trans_tax_details` (
2003   `id` int(11) NOT NULL auto_increment,
2004   `trans_type` smallint(6) default NULL,
2005   `trans_no` int(11) default NULL,
2006   `tran_date` date NOT NULL,
2007   `tax_type_id` int(11) NOT NULL default '0',
2008   `rate` double NOT NULL default '0',
2009   `ex_rate` double NOT NULL default '1',
2010   `included_in_price` tinyint(1) NOT NULL default '0',
2011   `net_amount` double NOT NULL default '0',
2012   `amount` double NOT NULL default '0',
2013   `memo` tinytext,
2014   PRIMARY KEY  (`id`),
2015   KEY `Type_and_Number` (`trans_type`,`trans_no`),
2016   KEY `tran_date` (`tran_date`)
2017 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2018
2019 --
2020 -- Dumping data for table `0_trans_tax_details`
2021 --
2022
2023
2024 -- --------------------------------------------------------
2025
2026 --
2027 -- Table structure for table `0_useronline`
2028 --
2029
2030 DROP TABLE IF EXISTS `0_useronline`;
2031 CREATE TABLE IF NOT EXISTS `0_useronline` (
2032   `id` int(11) NOT NULL auto_increment,
2033   `timestamp` int(15) NOT NULL default '0',
2034   `ip` varchar(40) NOT NULL default '',
2035   `file` varchar(100) NOT NULL default '',
2036   PRIMARY KEY  (`id`),
2037   KEY `timestamp` (`timestamp`),
2038   KEY `ip` (`ip`)
2039 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2040
2041 --
2042 -- Dumping data for table `0_useronline`
2043 --
2044
2045
2046 -- --------------------------------------------------------
2047
2048 --
2049 -- Table structure for table `0_users`
2050 --
2051
2052 DROP TABLE IF EXISTS `0_users`;
2053 CREATE TABLE IF NOT EXISTS `0_users` (
2054   `id` smallint(6) NOT NULL auto_increment,
2055   `user_id` varchar(60) NOT NULL default '',
2056   `password` varchar(100) NOT NULL default '',
2057   `real_name` varchar(100) NOT NULL default '',
2058   `role_id` int(11) NOT NULL default '1',
2059   `phone` varchar(30) NOT NULL default '',
2060   `email` varchar(100) default NULL,
2061   `language` varchar(20) default NULL,
2062   `date_format` tinyint(1) NOT NULL default '0',
2063   `date_sep` tinyint(1) NOT NULL default '0',
2064   `tho_sep` tinyint(1) NOT NULL default '0',
2065   `dec_sep` tinyint(1) NOT NULL default '0',
2066   `theme` varchar(20) NOT NULL default 'default',
2067   `page_size` varchar(20) NOT NULL default 'A4',
2068   `prices_dec` smallint(6) NOT NULL default '2',
2069   `qty_dec` smallint(6) NOT NULL default '2',
2070   `rates_dec` smallint(6) NOT NULL default '4',
2071   `percent_dec` smallint(6) NOT NULL default '1',
2072   `show_gl` tinyint(1) NOT NULL default '1',
2073   `show_codes` tinyint(1) NOT NULL default '0',
2074   `show_hints` tinyint(1) NOT NULL default '0',
2075   `last_visit_date` datetime default NULL,
2076   `query_size` tinyint(1) default '10',
2077   `graphic_links` tinyint(1) default '1',
2078   `pos` smallint(6) default '1',
2079   `print_profile` varchar(30) NOT NULL default '1',
2080   `rep_popup` tinyint(1) default '1',
2081   `sticky_doc_date` tinyint(1) default '0',
2082   `startup_tab` varchar(20) NOT NULL default '',
2083   `transaction_days` smallint(6) NOT NULL default '30',
2084   `inactive` tinyint(1) NOT NULL default '0',
2085   PRIMARY KEY  (`id`),
2086   UNIQUE KEY `user_id` (`user_id`)
2087 ) ENGINE=MyISAM  AUTO_INCREMENT=2 ;
2088
2089 --
2090 -- Dumping data for table `0_users`
2091 --
2092
2093 INSERT INTO `0_users` VALUES(1, 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', 2, '', 'adm@adm.com', 'en_US', 0, 0, 0, 0, 'default', 'Letter', 2, 2, 4, 1, 1, 0, 0, '2008-04-04 12:34:29', 10, 1, 1, '1', 1, 0, 'orders', 30, 0);
2094
2095 -- --------------------------------------------------------
2096
2097 --
2098 -- Table structure for table `0_voided`
2099 --
2100
2101 DROP TABLE IF EXISTS `0_voided`;
2102 CREATE TABLE IF NOT EXISTS `0_voided` (
2103   `type` int(11) NOT NULL default '0',
2104   `id` int(11) NOT NULL default '0',
2105   `date_` date NOT NULL default '0000-00-00',
2106   `memo_` tinytext NOT NULL,
2107   UNIQUE KEY `id` (`type`,`id`)
2108 ) ENGINE=InnoDB;
2109
2110 --
2111 -- Dumping data for table `0_voided`
2112 --
2113
2114
2115 -- --------------------------------------------------------
2116
2117 --
2118 -- Table structure for table `0_workcentres`
2119 --
2120
2121 DROP TABLE IF EXISTS `0_workcentres`;
2122 CREATE TABLE IF NOT EXISTS `0_workcentres` (
2123   `id` int(11) NOT NULL auto_increment,
2124   `name` char(40) NOT NULL default '',
2125   `description` char(50) NOT NULL default '',
2126   `inactive` tinyint(1) NOT NULL default '0',
2127   PRIMARY KEY  (`id`),
2128   UNIQUE KEY `name` (`name`)
2129 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
2130
2131 --
2132 -- Dumping data for table `0_workcentres`
2133 --
2134
2135
2136 -- --------------------------------------------------------
2137
2138 --
2139 -- Table structure for table `0_workorders`
2140 --
2141
2142 DROP TABLE IF EXISTS `0_workorders`;
2143 CREATE TABLE IF NOT EXISTS `0_workorders` (
2144   `id` int(11) NOT NULL auto_increment,
2145   `wo_ref` varchar(60) NOT NULL default '',
2146   `loc_code` varchar(5) NOT NULL default '',
2147   `units_reqd` double NOT NULL default '1',
2148   `stock_id` varchar(20) NOT NULL default '',
2149   `date_` date NOT NULL default '0000-00-00',
2150   `type` tinyint(4) NOT NULL default '0',
2151   `required_by` date NOT NULL default '0000-00-00',
2152   `released_date` date NOT NULL default '0000-00-00',
2153   `units_issued` double NOT NULL default '0',
2154   `closed` tinyint(1) NOT NULL default '0',
2155   `released` tinyint(1) NOT NULL default '0',
2156   `additional_costs` double NOT NULL default '0',
2157   PRIMARY KEY  (`id`),
2158   UNIQUE KEY `wo_ref` (`wo_ref`)
2159 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2160
2161 --
2162 -- Dumping data for table `0_workorders`
2163 --
2164
2165
2166 -- --------------------------------------------------------
2167
2168 --
2169 -- Table structure for table `0_wo_costing`
2170 --
2171
2172 DROP TABLE IF EXISTS `0_wo_costing`;
2173 CREATE TABLE `0_wo_costing` (
2174   `id` int(11) NOT NULL auto_increment,
2175   `workorder_id` int(11) NOT NULL default '0',
2176   `cost_type`   tinyint(1) NOT NULL default '0',
2177   `trans_type` int(11) NOT NULL default '0',
2178   `trans_no` int(11) NOT NULL default '0',
2179   `factor` double NOT NULL default '1',
2180   PRIMARY KEY  (`id`)
2181 ) ENGINE=InnoDB;
2182
2183 --
2184 -- Dumping data for table `0_wo_costing`
2185 --
2186
2187
2188 -- --------------------------------------------------------
2189
2190 --
2191 -- Table structure for table `0_wo_issues`
2192 --
2193
2194 DROP TABLE IF EXISTS `0_wo_issues`;
2195 CREATE TABLE IF NOT EXISTS `0_wo_issues` (
2196   `issue_no` int(11) NOT NULL auto_increment,
2197   `workorder_id` int(11) NOT NULL default '0',
2198   `reference` varchar(100) default NULL,
2199   `issue_date` date default NULL,
2200   `loc_code` varchar(5) default NULL,
2201   `workcentre_id` int(11) default NULL,
2202   PRIMARY KEY  (`issue_no`),
2203   KEY `workorder_id` (`workorder_id`)
2204 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2205
2206 --
2207 -- Dumping data for table `0_wo_issues`
2208 --
2209
2210
2211 -- --------------------------------------------------------
2212
2213 --
2214 -- Table structure for table `0_wo_issue_items`
2215 --
2216
2217 DROP TABLE IF EXISTS `0_wo_issue_items`;
2218 CREATE TABLE IF NOT EXISTS `0_wo_issue_items` (
2219   `id` int(11) NOT NULL auto_increment,
2220   `stock_id` varchar(40) default NULL,
2221   `issue_id` int(11) default NULL,
2222   `qty_issued` double default NULL,
2223   PRIMARY KEY  (`id`)
2224 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2225
2226 --
2227 -- Dumping data for table `0_wo_issue_items`
2228 --
2229
2230
2231 -- --------------------------------------------------------
2232
2233 --
2234 -- Table structure for table `0_wo_manufacture`
2235 --
2236
2237 DROP TABLE IF EXISTS `0_wo_manufacture`;
2238 CREATE TABLE IF NOT EXISTS `0_wo_manufacture` (
2239   `id` int(11) NOT NULL auto_increment,
2240   `reference` varchar(100) default NULL,
2241   `workorder_id` int(11) NOT NULL default '0',
2242   `quantity` double NOT NULL default '0',
2243   `date_` date NOT NULL default '0000-00-00',
2244   PRIMARY KEY  (`id`),
2245   KEY `workorder_id` (`workorder_id`)
2246 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2247
2248 --
2249 -- Dumping data for table `0_wo_manufacture`
2250 --
2251
2252
2253 -- --------------------------------------------------------
2254
2255 --
2256 -- Table structure for table `0_wo_requirements`
2257 --
2258
2259 DROP TABLE IF EXISTS `0_wo_requirements`;
2260 CREATE TABLE IF NOT EXISTS `0_wo_requirements` (
2261   `id` int(11) NOT NULL auto_increment,
2262   `workorder_id` int(11) NOT NULL default '0',
2263   `stock_id` char(20) NOT NULL default '',
2264   `workcentre` int(11) NOT NULL default '0',
2265   `units_req` double NOT NULL default '1',
2266   `std_cost` double NOT NULL default '0',
2267   `loc_code` char(5) NOT NULL default '',
2268   `units_issued` double NOT NULL default '0',
2269   PRIMARY KEY  (`id`),
2270   KEY `workorder_id` (`workorder_id`)
2271 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
2272
2273 --
2274 -- Dumping data for table `0_wo_requirements`
2275 --
2276