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