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