Further changes in manufacturing, added unit_cost in issues and requirements
[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 Finished Goods', '2', 0);
254 INSERT INTO `0_chart_master` VALUES ('1550', '', 'Goods Received Clearing account', '2', 0);
255 INSERT INTO `0_chart_master` VALUES ('1820', '', 'Office Furniture & Equipment', '3', 0);
256 INSERT INTO `0_chart_master` VALUES ('1825', '', 'Accum. Amort. -Furn. & Equip.', '3', 0);
257 INSERT INTO `0_chart_master` VALUES ('1840', '', 'Vehicle', '3', 0);
258 INSERT INTO `0_chart_master` VALUES ('1845', '', 'Accum. Amort. -Vehicle', '3', 0);
259 INSERT INTO `0_chart_master` VALUES ('2100', '', 'Accounts Payable', '4', 0);
260 INSERT INTO `0_chart_master` VALUES ('2110', '', 'Accrued Income Tax - Federal', '4', 0);
261 INSERT INTO `0_chart_master` VALUES ('2120', '', 'Accrued Income Tax - State', '4', 0);
262 INSERT INTO `0_chart_master` VALUES ('2130', '', 'Accrued Franchise Tax', '4', 0);
263 INSERT INTO `0_chart_master` VALUES ('2140', '', 'Accrued Real & Personal Prop Tax', '4', 0);
264 INSERT INTO `0_chart_master` VALUES ('2150', '', 'Sales Tax', '4', 0);
265 INSERT INTO `0_chart_master` VALUES ('2160', '', 'Accrued Use Tax Payable', '4', 0);
266 INSERT INTO `0_chart_master` VALUES ('2210', '', 'Accrued Wages', '4', 0);
267 INSERT INTO `0_chart_master` VALUES ('2220', '', 'Accrued Comp Time', '4', 0);
268 INSERT INTO `0_chart_master` VALUES ('2230', '', 'Accrued Holiday Pay', '4', 0);
269 INSERT INTO `0_chart_master` VALUES ('2240', '', 'Accrued Vacation Pay', '4', 0);
270 INSERT INTO `0_chart_master` VALUES ('2310', '', 'Accr. Benefits - 401K', '4', 0);
271 INSERT INTO `0_chart_master` VALUES ('2320', '', 'Accr. Benefits - Stock Purchase', '4', 0);
272 INSERT INTO `0_chart_master` VALUES ('2330', '', 'Accr. Benefits - Med, Den', '4', 0);
273 INSERT INTO `0_chart_master` VALUES ('2340', '', 'Accr. Benefits - Payroll Taxes', '4', 0);
274 INSERT INTO `0_chart_master` VALUES ('2350', '', 'Accr. Benefits - Credit Union', '4', 0);
275 INSERT INTO `0_chart_master` VALUES ('2360', '', 'Accr. Benefits - Savings Bond', '4', 0);
276 INSERT INTO `0_chart_master` VALUES ('2370', '', 'Accr. Benefits - Garnish', '4', 0);
277 INSERT INTO `0_chart_master` VALUES ('2380', '', 'Accr. Benefits - Charity Cont.', '4', 0);
278 INSERT INTO `0_chart_master` VALUES ('2620', '', 'Bank Loans', '5', 0);
279 INSERT INTO `0_chart_master` VALUES ('2680', '', 'Loans from Shareholders', '5', 0);
280 INSERT INTO `0_chart_master` VALUES ('3350', '', 'Common Shares', '6', 0);
281 INSERT INTO `0_chart_master` VALUES ('3590', '', 'Retained Earnings - prior years', '7', 0);
282 INSERT INTO `0_chart_master` VALUES ('4010', '', 'Sales', '8', 0);
283 INSERT INTO `0_chart_master` VALUES ('4430', '', 'Shipping & Handling', '9', 0);
284 INSERT INTO `0_chart_master` VALUES ('4440', '', 'Interest', '9', 0);
285 INSERT INTO `0_chart_master` VALUES ('4450', '', 'Foreign Exchange Gain', '9', 0);
286 INSERT INTO `0_chart_master` VALUES ('4500', '', 'Prompt Payment Discounts', '9', 0);
287 INSERT INTO `0_chart_master` VALUES ('4510', '', 'Discounts Given', '9', 0);
288 INSERT INTO `0_chart_master` VALUES ('5010', '', 'Cost of Goods Sold - Retail', '10', 0);
289 INSERT INTO `0_chart_master` VALUES ('5020', '', 'Material Usage Varaiance', '10', 0);
290 INSERT INTO `0_chart_master` VALUES ('5030', '', 'Consumable Materials', '10', 0);
291 INSERT INTO `0_chart_master` VALUES ('5040', '', 'Purchase price Variance', '10', 0);
292 INSERT INTO `0_chart_master` VALUES ('5050', '', 'Purchases of materials', '10', 0);
293 INSERT INTO `0_chart_master` VALUES ('5060', '', 'Discounts Received', '10', 0);
294 INSERT INTO `0_chart_master` VALUES ('5100', '', 'Freight', '10', 0);
295 INSERT INTO `0_chart_master` VALUES ('5410', '', 'Wages & Salaries', '11', 0);
296 INSERT INTO `0_chart_master` VALUES ('5420', '', 'Wages - Overtime', '11', 0);
297 INSERT INTO `0_chart_master` VALUES ('5430', '', 'Benefits - Comp Time', '11', 0);
298 INSERT INTO `0_chart_master` VALUES ('5440', '', 'Benefits - Payroll Taxes', '11', 0);
299 INSERT INTO `0_chart_master` VALUES ('5450', '', 'Benefits - Workers Comp', '11', 0);
300 INSERT INTO `0_chart_master` VALUES ('5460', '', 'Benefits - Pension', '11', 0);
301 INSERT INTO `0_chart_master` VALUES ('5470', '', 'Benefits - General Benefits', '11', 0);
302 INSERT INTO `0_chart_master` VALUES ('5510', '', 'Inc Tax Exp - Federal', '11', 0);
303 INSERT INTO `0_chart_master` VALUES ('5520', '', 'Inc Tax Exp - State', '11', 0);
304 INSERT INTO `0_chart_master` VALUES ('5530', '', 'Taxes - Real Estate', '11', 0);
305 INSERT INTO `0_chart_master` VALUES ('5540', '', 'Taxes - Personal Property', '11', 0);
306 INSERT INTO `0_chart_master` VALUES ('5550', '', 'Taxes - Franchise', '11', 0);
307 INSERT INTO `0_chart_master` VALUES ('5560', '', 'Taxes - Foreign Withholding', '11', 0);
308 INSERT INTO `0_chart_master` VALUES ('5610', '', 'Accounting & Legal', '12', 0);
309 INSERT INTO `0_chart_master` VALUES ('5615', '', 'Advertising & Promotions', '12', 0);
310 INSERT INTO `0_chart_master` VALUES ('5620', '', 'Bad Debts', '12', 0);
311 INSERT INTO `0_chart_master` VALUES ('5660', '', 'Amortization Expense', '12', 0);
312 INSERT INTO `0_chart_master` VALUES ('5685', '', 'Insurance', '12', 0);
313 INSERT INTO `0_chart_master` VALUES ('5690', '', 'Interest & Bank Charges', '12', 0);
314 INSERT INTO `0_chart_master` VALUES ('5700', '', 'Office Supplies', '12', 0);
315 INSERT INTO `0_chart_master` VALUES ('5760', '', 'Rent', '12', 0);
316 INSERT INTO `0_chart_master` VALUES ('5765', '', 'Repair & Maintenance', '12', 0);
317 INSERT INTO `0_chart_master` VALUES ('5780', '', 'Telephone', '12', 0);
318 INSERT INTO `0_chart_master` VALUES ('5785', '', 'Travel & Entertainment', '12', 0);
319 INSERT INTO `0_chart_master` VALUES ('5790', '', 'Utilities', '12', 0);
320 INSERT INTO `0_chart_master` VALUES ('5795', '', 'Registrations', '12', 0);
321 INSERT INTO `0_chart_master` VALUES ('5800', '', 'Licenses', '12', 0);
322 INSERT INTO `0_chart_master` VALUES ('5810', '', 'Foreign Exchange Loss', '12', 0);
323 INSERT INTO `0_chart_master` VALUES ('9990', '', 'Year Profit/Loss', '12', 0);
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   `fixed_asset` tinyint(1) NOT NULL DEFAULT '0',
982   `inactive` tinyint(1) NOT NULL default '0',
983   PRIMARY KEY (`loc_code`)
984 ) ENGINE=InnoDB;
985
986 --
987 -- Dumping data for table `0_locations`
988 --
989
990 INSERT INTO `0_locations` VALUES ('DEF', 'Default', 'N/A', '', '', '', '', '', 0, 0);
991
992 -- --------------------------------------------------------
993
994 --
995 -- Table structure for table `0_loc_stock`
996 --
997
998 DROP TABLE IF EXISTS `0_loc_stock`;
999 CREATE TABLE IF NOT EXISTS `0_loc_stock` (
1000   `loc_code` char(5) NOT NULL default '',
1001   `stock_id` char(20) NOT NULL default '',
1002   `reorder_level` double NOT NULL default '0',
1003   PRIMARY KEY (`loc_code`,`stock_id`),
1004   KEY `stock_id` (`stock_id`)
1005 ) ENGINE=InnoDB;
1006
1007 --
1008 -- Dumping data for table `0_loc_stock`
1009 --
1010
1011 -- --------------------------------------------------------
1012
1013 --
1014 -- Table structure for table `0_payment_terms`
1015 --
1016
1017 DROP TABLE IF EXISTS `0_payment_terms`;
1018 CREATE TABLE IF NOT EXISTS `0_payment_terms` (
1019   `terms_indicator` int(11) NOT NULL auto_increment,
1020   `terms` char(80) NOT NULL default '',
1021   `days_before_due` smallint(6) NOT NULL default '0',
1022   `day_in_following_month` smallint(6) NOT NULL default '0',
1023   `inactive` tinyint(1) NOT NULL default '0',
1024   PRIMARY KEY (`terms_indicator`),
1025   UNIQUE KEY `terms` (`terms`)
1026 ) ENGINE=InnoDB AUTO_INCREMENT=5 ;
1027
1028 --
1029 -- Dumping data for table `0_payment_terms`
1030 --
1031
1032 INSERT INTO `0_payment_terms` VALUES (1, 'Due 15th Of the Following Month', 0, 17, 0);
1033 INSERT INTO `0_payment_terms` VALUES (2, 'Due By End Of The Following Month', 0, 30, 0);
1034 INSERT INTO `0_payment_terms` VALUES (3, 'Payment due within 10 days', 10, 0, 0);
1035 INSERT INTO `0_payment_terms` VALUES (4, 'Cash Only', 0, 0, 0);
1036
1037 -- --------------------------------------------------------
1038
1039 --
1040 -- Table structure for table `0_prices`
1041 --
1042
1043 DROP TABLE IF EXISTS `0_prices`;
1044 CREATE TABLE IF NOT EXISTS `0_prices` (
1045   `id` int(11) NOT NULL auto_increment,
1046   `stock_id` varchar(20) NOT NULL default '',
1047   `sales_type_id` int(11) NOT NULL default '0',
1048   `curr_abrev` char(3) NOT NULL default '',
1049   `price` double NOT NULL default '0',
1050   PRIMARY KEY (`id`),
1051   UNIQUE KEY `price` (`stock_id`,`sales_type_id`,`curr_abrev`)
1052 ) ENGINE=InnoDB;
1053
1054 --
1055 -- Dumping data for table `0_prices`
1056 --
1057
1058 -- --------------------------------------------------------
1059
1060 --
1061 -- Table structure for table `0_printers`
1062 --
1063
1064 DROP TABLE IF EXISTS `0_printers`;
1065 CREATE TABLE IF NOT EXISTS `0_printers` (
1066   `id` tinyint(3) unsigned NOT NULL auto_increment,
1067   `name` varchar(20) NOT NULL,
1068   `description` varchar(60) NOT NULL,
1069   `queue` varchar(20) NOT NULL,
1070   `host` varchar(40) NOT NULL,
1071   `port` smallint(11) unsigned NOT NULL,
1072   `timeout` tinyint(3) unsigned NOT NULL,
1073   PRIMARY KEY (`id`),
1074   UNIQUE KEY `name` (`name`)
1075 ) ENGINE=InnoDB AUTO_INCREMENT=4 ;
1076
1077 --
1078 -- Dumping data for table `0_printers`
1079 --
1080
1081 INSERT INTO `0_printers` VALUES (1, 'QL500', 'Label printer', 'QL500', 'server', 127, 20);
1082 INSERT INTO `0_printers` VALUES (2, 'Samsung', 'Main network printer', 'scx4521F', 'server', 515, 5);
1083 INSERT INTO `0_printers` VALUES (3, 'Local', 'Local print server at user IP', 'lp', '', 515, 10);
1084
1085 -- --------------------------------------------------------
1086
1087 --
1088 -- Table structure for table `0_print_profiles`
1089 --
1090
1091 DROP TABLE IF EXISTS `0_print_profiles`;
1092 CREATE TABLE IF NOT EXISTS `0_print_profiles` (
1093   `id` smallint(6) unsigned NOT NULL auto_increment,
1094   `profile` varchar(30) NOT NULL,
1095   `report` varchar(5) default NULL,
1096   `printer` tinyint(3) unsigned default NULL,
1097   PRIMARY KEY (`id`),
1098   UNIQUE KEY `profile` (`profile`,`report`)
1099 ) ENGINE=InnoDB AUTO_INCREMENT=10 ;
1100
1101 --
1102 -- Dumping data for table `0_print_profiles`
1103 --
1104
1105 INSERT INTO `0_print_profiles` VALUES (1, 'Out of office', '', 0);
1106 INSERT INTO `0_print_profiles` VALUES (2, 'Sales Department', '', 0);
1107 INSERT INTO `0_print_profiles` VALUES (3, 'Central', '', 2);
1108 INSERT INTO `0_print_profiles` VALUES (4, 'Sales Department', '104', 2);
1109 INSERT INTO `0_print_profiles` VALUES (5, 'Sales Department', '105', 2);
1110 INSERT INTO `0_print_profiles` VALUES (6, 'Sales Department', '107', 2);
1111 INSERT INTO `0_print_profiles` VALUES (7, 'Sales Department', '109', 2);
1112 INSERT INTO `0_print_profiles` VALUES (8, 'Sales Department', '110', 2);
1113 INSERT INTO `0_print_profiles` VALUES (9, 'Sales Department', '201', 2);
1114
1115 -- --------------------------------------------------------
1116
1117 --
1118 -- Table structure for table `0_purch_data`
1119 --
1120
1121 DROP TABLE IF EXISTS `0_purch_data`;
1122 CREATE TABLE IF NOT EXISTS `0_purch_data` (
1123   `supplier_id` int(11) NOT NULL default '0',
1124   `stock_id` char(20) NOT NULL default '',
1125   `price` double NOT NULL default '0',
1126   `suppliers_uom` char(50) NOT NULL default '',
1127   `conversion_factor` double NOT NULL default '1',
1128   `supplier_description` char(50) NOT NULL default '',
1129   PRIMARY KEY (`supplier_id`,`stock_id`)
1130 ) ENGINE=InnoDB;
1131
1132 --
1133 -- Dumping data for table `0_purch_data`
1134 --
1135
1136 -- --------------------------------------------------------
1137
1138 --
1139 -- Table structure for table `0_purch_orders`
1140 --
1141
1142 DROP TABLE IF EXISTS `0_purch_orders`;
1143 CREATE TABLE IF NOT EXISTS `0_purch_orders` (
1144   `order_no` int(11) NOT NULL auto_increment,
1145   `supplier_id` int(11) NOT NULL default '0',
1146   `comments` tinytext,
1147   `ord_date` date NOT NULL default '0000-00-00',
1148   `reference` tinytext NOT NULL,
1149   `requisition_no` tinytext,
1150   `into_stock_location` varchar(5) NOT NULL default '',
1151   `delivery_address` tinytext NOT NULL,
1152   `total` double NOT NULL default '0',
1153   `prep_amount` double NOT NULL DEFAULT '0',
1154   `alloc` double NOT NULL DEFAULT '0',
1155   `tax_included` tinyint(1) NOT NULL default '0',
1156   PRIMARY KEY (`order_no`),
1157   KEY `ord_date` (`ord_date`)
1158 ) ENGINE=InnoDB;
1159
1160 --
1161 -- Dumping data for table `0_purch_orders`
1162 --
1163
1164 -- --------------------------------------------------------
1165
1166 --
1167 -- Table structure for table `0_purch_order_details`
1168 --
1169
1170 DROP TABLE IF EXISTS `0_purch_order_details`;
1171 CREATE TABLE IF NOT EXISTS `0_purch_order_details` (
1172   `po_detail_item` int(11) NOT NULL auto_increment,
1173   `order_no` int(11) NOT NULL default '0',
1174   `item_code` varchar(20) NOT NULL default '',
1175   `description` tinytext,
1176   `delivery_date` date NOT NULL default '0000-00-00',
1177   `qty_invoiced` double NOT NULL default '0',
1178   `unit_price` double NOT NULL default '0',
1179   `act_price` double NOT NULL default '0',
1180   `std_cost_unit` double NOT NULL default '0',
1181   `quantity_ordered` double NOT NULL default '0',
1182   `quantity_received` double NOT NULL default '0',
1183   PRIMARY KEY (`po_detail_item`),
1184   KEY `order` (`order_no`,`po_detail_item`),
1185   KEY `itemcode` (`item_code`)
1186 ) ENGINE=InnoDB;
1187
1188 --
1189 -- Dumping data for table `0_purch_order_details`
1190 --
1191
1192 -- --------------------------------------------------------
1193
1194 --
1195 -- Table structure for table `0_quick_entries`
1196 --
1197
1198 DROP TABLE IF EXISTS `0_quick_entries`;
1199 CREATE TABLE IF NOT EXISTS `0_quick_entries` (
1200   `id` smallint(6) unsigned NOT NULL auto_increment,
1201   `type` tinyint(1) NOT NULL default '0',
1202   `description` varchar(60) NOT NULL,
1203   `usage` varchar(120) NULL,
1204   `base_amount` double NOT NULL default '0',
1205   `base_desc` varchar(60) default NULL,
1206   `bal_type` tinyint(1) NOT NULL default '0',
1207   PRIMARY KEY (`id`),
1208   KEY `description` (`description`)
1209 ) ENGINE=InnoDB AUTO_INCREMENT=4 ;
1210
1211 --
1212 -- Dumping data for table `0_quick_entries`
1213 --
1214
1215 INSERT INTO `0_quick_entries` VALUES (1, 1, 'Maintenance', NULL, 0, 'Amount', 0);
1216 INSERT INTO `0_quick_entries` VALUES (2, 4, 'Phone', NULL, 0, 'Amount', 0);
1217 INSERT INTO `0_quick_entries` VALUES (3, 2, 'Cash Sales', 'Retail sales without invoice', 0, 'Amount', 0);
1218
1219 -- --------------------------------------------------------
1220
1221 --
1222 -- Table structure for table `0_quick_entry_lines`
1223 --
1224
1225 DROP TABLE IF EXISTS `0_quick_entry_lines`;
1226 CREATE TABLE IF NOT EXISTS `0_quick_entry_lines` (
1227   `id` smallint(6) unsigned NOT NULL auto_increment,
1228   `qid` smallint(6) unsigned NOT NULL,
1229   `amount` double default '0',
1230   `memo` tinytext NOT NULL,
1231   `action` varchar(2) NOT NULL,
1232   `dest_id` varchar(15) NOT NULL default '',
1233   `dimension_id` smallint(6) unsigned default NULL,
1234   `dimension2_id` smallint(6) unsigned default NULL,
1235   PRIMARY KEY (`id`),
1236   KEY `qid` (`qid`)
1237 ) ENGINE=InnoDB AUTO_INCREMENT=7 ;
1238
1239 --
1240 -- Dumping data for table `0_quick_entry_lines`
1241 --
1242
1243 INSERT INTO `0_quick_entry_lines` VALUES (1, 1, 0, '', 't-', '1', 0, 0);
1244 INSERT INTO `0_quick_entry_lines` VALUES (2, 2, 0, '', 't-', '1', 0, 0);
1245 INSERT INTO `0_quick_entry_lines` VALUES (3, 3, 0, '', 't-', '1', 0, 0);
1246 INSERT INTO `0_quick_entry_lines` VALUES (4, 3, 0, '', '=', '4010', 0, 0);
1247 INSERT INTO `0_quick_entry_lines` VALUES (5, 1, 0, '', '=', '5765', 0, 0);
1248 INSERT INTO `0_quick_entry_lines` VALUES (6, 2, 0, '', '=', '5780', 0, 0);
1249
1250 -- --------------------------------------------------------
1251
1252 --
1253 -- Table structure for table `0_recurrent_invoices`
1254 --
1255
1256 DROP TABLE IF EXISTS `0_recurrent_invoices`;
1257 CREATE TABLE IF NOT EXISTS `0_recurrent_invoices` (
1258   `id` smallint(6) unsigned NOT NULL auto_increment,
1259   `description` varchar(60) NOT NULL default '',
1260   `order_no` int(11) unsigned NOT NULL,
1261   `debtor_no` int(11) unsigned default NULL,
1262   `group_no` smallint(6) unsigned default NULL,
1263   `days` int(11) NOT NULL default '0',
1264   `monthly` int(11) NOT NULL default '0',
1265   `begin` date NOT NULL default '0000-00-00',
1266   `end` date NOT NULL default '0000-00-00',
1267   `last_sent` date NOT NULL default '0000-00-00',
1268   PRIMARY KEY (`id`),
1269   UNIQUE KEY `description` (`description`)
1270 ) ENGINE=InnoDB;
1271
1272 --
1273 -- Dumping data for table `0_recurrent_invoices`
1274 --
1275
1276 -- --------------------------------------------------------
1277
1278 --
1279 --- Table structure for table `0_reflines`
1280 --
1281
1282 DROP TABLE IF EXISTS `0_reflines`;
1283
1284 CREATE TABLE `0_reflines` (
1285   `id` int(11) NOT NULL AUTO_INCREMENT,
1286   `trans_type` int(11) NOT NULL,
1287   `prefix` char(5) NOT NULL DEFAULT '',
1288   `pattern` varchar(35) NOT NULL DEFAULT '1',
1289   `description` varchar(60) NOT NULL DEFAULT '',
1290   `default` tinyint(1) NOT NULL DEFAULT '0',
1291   `inactive` tinyint(1) NOT NULL DEFAULT '0',
1292   PRIMARY KEY (`id`),
1293   UNIQUE KEY `prefix` (`trans_type`, `prefix`)
1294 ) ENGINE=InnoDB AUTO_INCREMENT=23;
1295
1296 --
1297 --- Dumping data for table `0_reflines`
1298 --
1299
1300 INSERT INTO `0_reflines` VALUES
1301 ('1', '0', '', '{001}/{YYYY}', '', '1', '0'),
1302 ('2', '1', '', '{001}/{YYYY}', '', '1', '0'),
1303 ('3', '2', '', '{001}/{YYYY}', '', '1', '0'),
1304 ('4', '4', '', '{001}/{YYYY}', '', '1', '0'),
1305 ('5', '10', '', '{001}/{YYYY}', '', '1', '0'),
1306 ('6', '11', '', '{001}/{YYYY}', '', '1', '0'),
1307 ('7', '12', '', '{001}/{YYYY}', '', '1', '0'),
1308 ('8', '13', '', '{001}/{YYYY}', '', '1', '0'),
1309 ('9', '16', '', '{001}/{YYYY}', '', '1', '0'),
1310 ('10', '17', '', '{001}/{YYYY}', '', '1', '0'),
1311 ('11', '18', '', '{001}/{YYYY}', '', '1', '0'),
1312 ('12', '20', '', '{001}/{YYYY}', '', '1', '0'),
1313 ('13', '21', '', '{001}/{YYYY}', '', '1', '0'),
1314 ('14', '22', '', '{001}/{YYYY}', '', '1', '0'),
1315 ('15', '25', '', '{001}/{YYYY}', '', '1', '0'),
1316 ('16', '26', '', '{001}/{YYYY}', '', '1', '0'),
1317 ('17', '28', '', '{001}/{YYYY}', '', '1', '0'),
1318 ('18', '29', '', '{001}/{YYYY}', '', '1', '0'),
1319 ('19', '30', '', '{001}/{YYYY}', '', '1', '0'),
1320 ('20', '32', '', '{001}/{YYYY}', '', '1', '0'),
1321 ('21', '35', '', '{001}/{YYYY}', '', '1', '0'),
1322 ('22', '40', '', '{001}/{YYYY}', '', '1', '0');
1323
1324 -- --------------------------------------------------------
1325
1326 --
1327 -- Table structure for table `0_refs`
1328 --
1329
1330 DROP TABLE IF EXISTS `0_refs`;
1331 CREATE TABLE IF NOT EXISTS `0_refs` (
1332   `id` int(11) NOT NULL default '0',
1333   `type` int(11) NOT NULL default '0',
1334   `reference` varchar(100) NOT NULL default '',
1335   PRIMARY KEY (`id`,`type`),
1336   KEY `Type_and_Reference` (`type`,`reference`)
1337 ) ENGINE=InnoDB;
1338
1339 --
1340 -- Dumping data for table `0_refs`
1341 --
1342
1343 -- --------------------------------------------------------
1344
1345 --
1346 -- Table structure for table `0_salesman`
1347 --
1348
1349 DROP TABLE IF EXISTS `0_salesman`;
1350 CREATE TABLE IF NOT EXISTS `0_salesman` (
1351   `salesman_code` int(11) NOT NULL auto_increment,
1352   `salesman_name` char(60) NOT NULL default '',
1353   `salesman_phone` char(30) NOT NULL default '',
1354   `salesman_fax` char(30) NOT NULL default '',
1355   `salesman_email` varchar(100) NOT NULL default '',
1356   `provision` double NOT NULL default '0',
1357   `break_pt` double NOT NULL default '0',
1358   `provision2` double NOT NULL default '0',
1359   `inactive` tinyint(1) NOT NULL default '0',
1360   PRIMARY KEY (`salesman_code`),
1361   UNIQUE KEY `salesman_name` (`salesman_name`)
1362 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
1363
1364 --
1365 -- Dumping data for table `0_salesman`
1366 --
1367
1368 INSERT INTO `0_salesman` VALUES (1, 'Sales Person', '', '', '', 5, 1000, 4, 0);
1369
1370 -- --------------------------------------------------------
1371
1372 --
1373 -- Table structure for table `0_sales_orders`
1374 --
1375
1376 DROP TABLE IF EXISTS `0_sales_orders`;
1377 CREATE TABLE IF NOT EXISTS `0_sales_orders` (
1378   `order_no` int(11) NOT NULL,
1379   `trans_type` smallint(6) NOT NULL default '30',
1380   `version` tinyint(1) unsigned NOT NULL default '0',
1381   `type` tinyint(1) NOT NULL default '0',
1382   `debtor_no` int(11) NOT NULL default '0',
1383   `branch_code` int(11) NOT NULL default '0',
1384   `reference` varchar(100) NOT NULL default '',
1385   `customer_ref` tinytext NOT NULL,
1386   `comments` tinytext,
1387   `ord_date` date NOT NULL default '0000-00-00',
1388   `order_type` int(11) NOT NULL default '0',
1389   `ship_via` int(11) NOT NULL default '0',
1390   `delivery_address` tinytext NOT NULL,
1391   `contact_phone` varchar(30) default NULL,
1392   `contact_email` varchar(100) default NULL,
1393   `deliver_to` tinytext NOT NULL,
1394   `freight_cost` double NOT NULL default '0',
1395   `from_stk_loc` varchar(5) NOT NULL default '',
1396   `delivery_date` date NOT NULL default '0000-00-00',
1397   `payment_terms` int(11) default NULL,
1398   `total` double NOT NULL default '0',
1399   `prep_amount` double NOT NULL DEFAULT '0',
1400   `alloc` double NOT NULL DEFAULT '0',
1401   PRIMARY KEY (`trans_type`,`order_no`)
1402 ) ENGINE=InnoDB;
1403
1404 --
1405 -- Dumping data for table `0_sales_orders`
1406 --
1407
1408 -- --------------------------------------------------------
1409
1410 --
1411 -- Table structure for table `0_sales_order_details`
1412 --
1413
1414 DROP TABLE IF EXISTS `0_sales_order_details`;
1415 CREATE TABLE IF NOT EXISTS `0_sales_order_details` (
1416   `id` int(11) NOT NULL auto_increment,
1417   `order_no` int(11) NOT NULL default '0',
1418   `trans_type` smallint(6) NOT NULL default '30',
1419   `stk_code` varchar(20) NOT NULL default '',
1420   `description` tinytext,
1421   `qty_sent` double NOT NULL default '0',
1422   `unit_price` double NOT NULL default '0',
1423   `quantity` double NOT NULL default '0',
1424   `invoiced` double NOT NULL DEFAULT '0',
1425   `discount_percent` double NOT NULL default '0',
1426   PRIMARY KEY (`id`),
1427   KEY `sorder` (`trans_type`,`order_no`),
1428   KEY `stkcode` (`stk_code`)
1429 ) ENGINE=InnoDB;
1430
1431 --
1432 -- Dumping data for table `0_sales_order_details`
1433 --
1434
1435 -- --------------------------------------------------------
1436
1437 --
1438 -- Table structure for table `0_sales_pos`
1439 --
1440
1441 DROP TABLE IF EXISTS `0_sales_pos`;
1442 CREATE TABLE IF NOT EXISTS `0_sales_pos` (
1443   `id` smallint(6) unsigned NOT NULL auto_increment,
1444   `pos_name` varchar(30) NOT NULL,
1445   `cash_sale` tinyint(1) NOT NULL,
1446   `credit_sale` tinyint(1) NOT NULL,
1447   `pos_location` varchar(5) NOT NULL,
1448   `pos_account` smallint(6) unsigned NOT NULL,
1449   `inactive` tinyint(1) NOT NULL default '0',
1450   PRIMARY KEY (`id`),
1451   UNIQUE KEY `pos_name` (`pos_name`)
1452 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
1453
1454 --
1455 -- Dumping data for table `0_sales_pos`
1456 --
1457
1458 INSERT INTO `0_sales_pos` VALUES (1, 'Default', 1, 1, 'DEF', 2, 0);
1459
1460 -- --------------------------------------------------------
1461
1462 --
1463 -- Table structure for table `0_sales_types`
1464 --
1465
1466 DROP TABLE IF EXISTS `0_sales_types`;
1467 CREATE TABLE IF NOT EXISTS `0_sales_types` (
1468   `id` int(11) NOT NULL auto_increment,
1469   `sales_type` char(50) NOT NULL default '',
1470   `tax_included` int(1) NOT NULL default '0',
1471   `factor` double NOT NULL default '1',
1472   `inactive` tinyint(1) NOT NULL default '0',
1473   PRIMARY KEY (`id`),
1474   UNIQUE KEY `sales_type` (`sales_type`)
1475 ) ENGINE=InnoDB AUTO_INCREMENT=3 ;
1476
1477 --
1478 -- Dumping data for table `0_sales_types`
1479 --
1480
1481 INSERT INTO `0_sales_types` VALUES (1, 'Retail', 1, 1, 0);
1482 INSERT INTO `0_sales_types` VALUES (2, 'Wholesale', 0, 0.7, 0);
1483
1484 -- --------------------------------------------------------
1485
1486 --
1487 -- Table structure for table `0_security_roles`
1488 --
1489
1490 DROP TABLE IF EXISTS `0_security_roles`;
1491 CREATE TABLE IF NOT EXISTS `0_security_roles` (
1492   `id` int(11) NOT NULL auto_increment,
1493   `role` varchar(30) NOT NULL,
1494   `description` varchar(50) default NULL,
1495   `sections` text,
1496   `areas` text,
1497   `inactive` tinyint(1) NOT NULL default '0',
1498   PRIMARY KEY (`id`),
1499   UNIQUE KEY `role` (`role`)
1500 ) ENGINE=InnoDB AUTO_INCREMENT=11 ;
1501
1502 --
1503 -- Dumping data for table `0_security_roles`
1504 --
1505
1506 INSERT INTO `0_security_roles` VALUES (1, 'Inquiries', 'Inquiries', '768;2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15872;16128', '257;258;259;260;513;514;515;516;517;518;519;520;521;522;523;524;525;773;774;2822;3073;3075;3076;3077;3329;3330;3331;3332;3333;3334;3335;5377;5633;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8450;8451;10497;10753;11009;11010;11012;13313;13315;15617;15618;15619;15620;15621;15622;15623;15624;15625;15626;15873;15882;16129;16130;16131;16132;775', 0);
1507 INSERT INTO `0_security_roles` VALUES (2, 'System Administrator', 'System Administrator', '256;512;768;2816;3072;3328;5376;5632;5888;7936;8192;8448;9472;9728;10496;10752;11008;13056;13312;15616;15872;16128', '257;258;259;260;513;514;515;516;517;518;519;520;521;522;523;524;525;526;769;770;771;772;773;774;2817;2818;2819;2820;2821;2822;2823;3073;3074;3082;3075;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5634;5635;5636;5637;5641;5638;5639;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8195;8196;8197;8449;8450;8451;9217;9218;9220;9473;9474;9475;9476;9729;10497;10753;10754;10755;10756;10757;11009;11010;11011;11012;13057;13313;13314;13315;15617;15618;15619;15620;15621;15622;15623;15624;15628;15625;15626;15627;15873;15874;15875;15876;15877;15878;15879;15880;15883;15881;15882;16129;16130;16131;16132;775', 0);
1508 INSERT INTO `0_security_roles` VALUES (3, 'Salesman', 'Salesman', '768;3072;5632;8192;15872', '773;774;3073;3075;3081;5633;8194;15873;775', 0);
1509 INSERT INTO `0_security_roles` VALUES (4, 'Stock Manager', 'Stock Manager', '768;2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15872;16128', '2818;2822;3073;3076;3077;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5633;5640;5889;5890;5891;8193;8194;8450;8451;10753;11009;11010;11012;13313;13315;15882;16129;16130;16131;16132;775', 0);
1510 INSERT INTO `0_security_roles` VALUES (5, 'Production Manager', 'Production Manager', '512;768;2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '521;523;524;2818;2819;2820;2821;2822;2823;3073;3074;3076;3077;3078;3079;3080;3081;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5633;5640;5640;5889;5890;5891;8193;8194;8196;8197;8450;8451;10753;10755;11009;11010;11012;13313;13315;15617;15619;15620;15621;15624;15624;15876;15877;15880;15882;16129;16130;16131;16132;775', 0);
1511 INSERT INTO `0_security_roles` VALUES (6, 'Purchase Officer', 'Purchase Officer', '512;768;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '521;523;524;2818;2819;2820;2821;2822;2823;3073;3074;3076;3077;3078;3079;3080;3081;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5377;5633;5635;5640;5640;5889;5890;5891;8193;8194;8196;8197;8449;8450;8451;10753;10755;11009;11010;11012;13313;13315;15617;15619;15620;15621;15624;15624;15876;15877;15880;15882;16129;16130;16131;16132;775', 0);
1512 INSERT INTO `0_security_roles` VALUES (7, 'AR Officer', 'AR Officer', '512;768;2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '521;523;524;771;773;774;2818;2819;2820;2821;2822;2823;3073;3073;3074;3075;3076;3077;3078;3079;3080;3081;3081;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5633;5633;5634;5637;5638;5639;5640;5640;5889;5890;5891;8193;8194;8194;8196;8197;8450;8451;10753;10755;11009;11010;11012;13313;13315;15617;15619;15620;15621;15624;15624;15873;15876;15877;15878;15880;15882;16129;16130;16131;16132;775', 0);
1513 INSERT INTO `0_security_roles` VALUES (8, 'AP Officer', 'AP Officer', '512;768;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '257;258;259;260;521;523;524;769;770;771;772;773;774;2818;2819;2820;2821;2822;2823;3073;3074;3082;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5635;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8196;8197;8449;8450;8451;10497;10753;10755;11009;11010;11012;13057;13313;13315;15617;15619;15620;15621;15624;15876;15877;15880;15882;16129;16130;16131;16132;775', 0);
1514 INSERT INTO `0_security_roles` VALUES (9, 'Accountant', 'New Accountant', '512;768;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '257;258;259;260;521;523;524;771;772;773;774;2818;2819;2820;2821;2822;2823;3073;3074;3075;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5634;5635;5637;5638;5639;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8196;8197;8449;8450;8451;10497;10753;10755;11009;11010;11012;13313;13315;15617;15618;15619;15620;15621;15624;15873;15876;15877;15878;15880;15882;16129;16130;16131;16132;775', 0);
1515 INSERT INTO `0_security_roles` VALUES (10, 'Sub Admin', 'Sub Admin', '512;768;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '257;258;259;260;521;523;524;771;772;773;774;2818;2819;2820;2821;2822;2823;3073;3074;3082;3075;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5634;5635;5637;5638;5639;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8196;8197;8449;8450;8451;10497;10753;10755;11009;11010;11012;13057;13313;13315;15617;15619;15620;15621;15624;15873;15874;15876;15877;15878;15879;15880;15882;16129;16130;16131;16132;775', 0);
1516
1517 -- --------------------------------------------------------
1518
1519 --
1520 -- Table structure for table `0_shippers`
1521 --
1522
1523 DROP TABLE IF EXISTS `0_shippers`;
1524 CREATE TABLE IF NOT EXISTS `0_shippers` (
1525   `shipper_id` int(11) NOT NULL auto_increment,
1526   `shipper_name` varchar(60) NOT NULL default '',
1527   `phone` varchar(30) NOT NULL default '',
1528   `phone2` varchar(30) NOT NULL default '',
1529   `contact` tinytext NOT NULL,
1530   `address` tinytext NOT NULL,
1531   `inactive` tinyint(1) NOT NULL default '0',
1532   PRIMARY KEY (`shipper_id`),
1533   UNIQUE KEY `name` (`shipper_name`)
1534 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
1535
1536 --
1537 -- Dumping data for table `0_shippers`
1538 --
1539
1540 INSERT INTO `0_shippers` VALUES (1, 'Default', '', '', '', '', 0);
1541
1542 -- --------------------------------------------------------
1543
1544 --
1545 -- Table structure for table `0_sql_trail`
1546 --
1547
1548 DROP TABLE IF EXISTS `0_sql_trail`;
1549 CREATE TABLE IF NOT EXISTS `0_sql_trail` (
1550   `id` int(11) unsigned NOT NULL auto_increment,
1551   `sql` text NOT NULL,
1552   `result` tinyint(1) NOT NULL,
1553   `msg` varchar(255) NOT NULL,
1554   PRIMARY KEY (`id`)
1555 ) ENGINE=InnoDB;
1556
1557 --
1558 -- Dumping data for table `0_sql_trail`
1559 --
1560
1561 -- --------------------------------------------------------
1562
1563 --
1564 -- Table structure for table `0_stock_category`
1565 --
1566
1567 DROP TABLE IF EXISTS `0_stock_category`;
1568 CREATE TABLE IF NOT EXISTS `0_stock_category` (
1569   `category_id` int(11) NOT NULL auto_increment,
1570   `description` varchar(60) NOT NULL default '',
1571   `dflt_tax_type` int(11) NOT NULL default '1',
1572   `dflt_units` varchar(20) NOT NULL default 'each',
1573   `dflt_mb_flag` char(1) NOT NULL default 'B',
1574   `dflt_sales_act` varchar(15) NOT NULL default '',
1575   `dflt_cogs_act` varchar(15) NOT NULL default '',
1576   `dflt_inventory_act` varchar(15) NOT NULL default '',
1577   `dflt_adjustment_act` varchar(15) NOT NULL default '',
1578   `dflt_assembly_act` varchar(15) NOT NULL default '',
1579   `dflt_dim1` int(11) default NULL,
1580   `dflt_dim2` int(11) default NULL,
1581   `inactive` tinyint(1) NOT NULL default '0',
1582   `dflt_no_sale` tinyint(1) NOT NULL default '0',
1583   `dflt_no_purchase` tinyint(1) NOT NULL default '0',
1584   PRIMARY KEY (`category_id`),
1585   UNIQUE KEY `description` (`description`)
1586 ) ENGINE=InnoDB AUTO_INCREMENT=5 ;
1587
1588 --
1589 -- Dumping data for table `0_stock_category`
1590 --
1591
1592 INSERT INTO `0_stock_category` VALUES (1, 'Components', 1, 'each', 'B', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1593 INSERT INTO `0_stock_category` VALUES (2, 'Charges', 1, 'each', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1594 INSERT INTO `0_stock_category` VALUES (3, 'Systems', 1, 'each', 'M', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1595 INSERT INTO `0_stock_category` VALUES (4, 'Services', 1, 'hr', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
1596
1597 -- --------------------------------------------------------
1598
1599 --
1600 -- Structure of table `0_stock_fa_class` ###
1601 --
1602
1603 DROP TABLE IF EXISTS `0_stock_fa_class`;
1604 CREATE TABLE `0_stock_fa_class` (
1605   `fa_class_id` varchar(20) NOT NULL DEFAULT '',
1606   `parent_id` varchar(20) NOT NULL DEFAULT '',
1607   `description` varchar(200) NOT NULL DEFAULT '',
1608   `long_description` tinytext NOT NULL,
1609   `depreciation_rate` double NOT NULL DEFAULT '0',
1610   `inactive` tinyint(1) NOT NULL DEFAULT '0',
1611   PRIMARY KEY (`fa_class_id`)
1612 ) ENGINE=InnoDB;
1613
1614 -- --------------------------------------------------------
1615
1616 --
1617 -- Table structure for table `0_stock_master`
1618 --
1619
1620 DROP TABLE IF EXISTS `0_stock_master`;
1621 CREATE TABLE IF NOT EXISTS `0_stock_master` (
1622   `stock_id` varchar(20) NOT NULL default '',
1623   `category_id` int(11) NOT NULL default '0',
1624   `tax_type_id` int(11) NOT NULL default '0',
1625   `description` varchar(200) NOT NULL default '',
1626   `long_description` tinytext NOT NULL,
1627   `units` varchar(20) NOT NULL default 'each',
1628   `mb_flag` char(1) NOT NULL default 'B',
1629   `sales_account` varchar(15) NOT NULL default '',
1630   `cogs_account` varchar(15) NOT NULL default '',
1631   `inventory_account` varchar(15) NOT NULL default '',
1632   `adjustment_account` varchar(15) NOT NULL default '',
1633   `assembly_account` varchar(15) NOT NULL default '',
1634   `dimension_id` int(11) default NULL,
1635   `dimension2_id` int(11) default NULL,
1636   `purchase_cost` double NOT NULL default '0',
1637   `last_cost` double NOT NULL default '0',
1638   `material_cost` double NOT NULL default '0',
1639   `labour_cost` double NOT NULL default '0',
1640   `overhead_cost` double NOT NULL default '0',
1641   `inactive` tinyint(1) NOT NULL default '0',
1642   `no_sale` tinyint(1) NOT NULL default '0',
1643   `no_purchase` tinyint(1) NOT NULL default '0',
1644   `editable` tinyint(1) NOT NULL default '0',
1645   `depreciation_method` char(1) NOT NULL DEFAULT 'S',
1646   `depreciation_rate` double NOT NULL DEFAULT '0',
1647   `depreciation_factor` double NOT NULL DEFAULT '1',
1648   `depreciation_start` date NOT NULL DEFAULT '0000-00-00',
1649   `depreciation_date` date NOT NULL DEFAULT '0000-00-00',
1650   `fa_class_id` varchar(20) NOT NULL DEFAULT '',
1651   PRIMARY KEY (`stock_id`)
1652 ) ENGINE=InnoDB;
1653
1654 --
1655 -- Dumping data for table `0_stock_master`
1656 --
1657
1658 -- --------------------------------------------------------
1659
1660 --
1661 -- Table structure for table `0_stock_moves`
1662 --
1663
1664 DROP TABLE IF EXISTS `0_stock_moves`;
1665 CREATE TABLE `0_stock_moves` (
1666   `trans_id` int(11) NOT NULL AUTO_INCREMENT,
1667   `trans_no` int(11) NOT NULL DEFAULT '0',
1668   `stock_id` char(20) NOT NULL DEFAULT '',
1669   `type` smallint(6) NOT NULL DEFAULT '0',
1670   `loc_code` char(5) NOT NULL DEFAULT '',
1671   `tran_date` date NOT NULL DEFAULT '0000-00-00',
1672   `price` double NOT NULL DEFAULT '0',
1673   `reference` char(40) NOT NULL DEFAULT '',
1674   `qty` double NOT NULL DEFAULT '1',
1675   `standard_cost` double NOT NULL DEFAULT '0',
1676   PRIMARY KEY (`trans_id`),
1677   KEY `type` (`type`,`trans_no`),
1678   KEY `Move` (`stock_id`,`loc_code`,`tran_date`)
1679 ) ENGINE=InnoDB ;
1680
1681 --
1682 -- Dumping data for table `0_stock_moves`
1683 --
1684
1685 -- --------------------------------------------------------
1686
1687 --
1688 -- Table structure for table `0_suppliers`
1689 --
1690
1691 DROP TABLE IF EXISTS `0_suppliers`;
1692 CREATE TABLE IF NOT EXISTS `0_suppliers` (
1693   `supplier_id` int(11) NOT NULL auto_increment,
1694   `supp_name` varchar(60) NOT NULL default '',
1695   `supp_ref` varchar(30) NOT NULL default '',
1696   `address` tinytext NOT NULL,
1697   `supp_address` tinytext NOT NULL,
1698   `gst_no` varchar(25) NOT NULL default '',
1699   `contact` varchar(60) NOT NULL default '',
1700   `supp_account_no` varchar(40) NOT NULL default '',
1701   `website` varchar(100) NOT NULL default '',
1702   `bank_account` varchar(60) NOT NULL default '',
1703   `curr_code` char(3) default NULL,
1704   `payment_terms` int(11) default NULL,
1705   `tax_included` tinyint(1) NOT NULL default '0',
1706   `dimension_id` int(11) default '0',
1707   `dimension2_id` int(11) default '0',
1708   `tax_group_id` int(11) default NULL,
1709   `credit_limit` double NOT NULL default '0',
1710   `purchase_account` varchar(15) NOT NULL default '',
1711   `payable_account` varchar(15) NOT NULL default '',
1712   `payment_discount_account` varchar(15) NOT NULL default '',
1713   `notes` tinytext NOT NULL,
1714   `inactive` tinyint(1) NOT NULL default '0',
1715   PRIMARY KEY (`supplier_id`),
1716   KEY `supp_ref` (`supp_ref`)
1717 ) ENGINE=InnoDB;
1718
1719 --
1720 -- Dumping data for table `0_suppliers`
1721 --
1722
1723 -- --------------------------------------------------------
1724
1725 --
1726 -- Table structure for table `0_supp_allocations`
1727 --
1728
1729 DROP TABLE IF EXISTS `0_supp_allocations`;
1730 CREATE TABLE IF NOT EXISTS `0_supp_allocations` (
1731   `id` int(11) NOT NULL auto_increment,
1732   `person_id` int(11) DEFAULT NULL,
1733   `amt` double unsigned default NULL,
1734   `date_alloc` date NOT NULL default '0000-00-00',
1735   `trans_no_from` int(11) default NULL,
1736   `trans_type_from` int(11) default NULL,
1737   `trans_no_to` int(11) default NULL,
1738   `trans_type_to` int(11) default NULL,
1739   PRIMARY KEY (`id`),
1740   UNIQUE KEY `trans_type_from` (`person_id`,`trans_type_from`,`trans_no_from`,`trans_type_to`,`trans_no_to`),
1741   KEY `From` (`trans_type_from`,`trans_no_from`),
1742   KEY `To` (`trans_type_to`,`trans_no_to`)
1743 ) ENGINE=InnoDB ;
1744
1745 --
1746 -- Dumping data for table `0_supp_allocations`
1747 --
1748
1749 -- --------------------------------------------------------
1750
1751 --
1752 -- Table structure for table `0_supp_invoice_items`
1753 --
1754
1755 DROP TABLE IF EXISTS `0_supp_invoice_items`;
1756 CREATE TABLE IF NOT EXISTS `0_supp_invoice_items` (
1757   `id` int(11) NOT NULL auto_increment,
1758   `supp_trans_no` int(11) default NULL,
1759   `supp_trans_type` int(11) default NULL,
1760   `gl_code` varchar(15) NOT NULL default '',
1761   `grn_item_id` int(11) default NULL,
1762   `po_detail_item_id` int(11) default NULL,
1763   `stock_id` varchar(20) NOT NULL default '',
1764   `description` tinytext,
1765   `quantity` double NOT NULL default '0',
1766   `unit_price` double NOT NULL default '0',
1767   `unit_tax` double NOT NULL default '0',
1768   `memo_` tinytext,
1769   `dimension_id` int(11) NOT NULL DEFAULT '0',
1770   `dimension2_id` int(11) NOT NULL DEFAULT '0',
1771   PRIMARY KEY (`id`),
1772   KEY `Transaction` (`supp_trans_type`,`supp_trans_no`,`stock_id`)
1773 ) ENGINE=InnoDB;
1774
1775 --
1776 -- Dumping data for table `0_supp_invoice_items`
1777 --
1778
1779 -- --------------------------------------------------------
1780
1781 --
1782 -- Table structure for table `0_supp_trans`
1783 --
1784
1785 DROP TABLE IF EXISTS `0_supp_trans`;
1786 CREATE TABLE IF NOT EXISTS `0_supp_trans` (
1787   `trans_no` int(11) unsigned NOT NULL default '0',
1788   `type` smallint(6) unsigned NOT NULL default '0',
1789   `supplier_id` int(11) unsigned default NULL,
1790   `reference` tinytext NOT NULL,
1791   `supp_reference` varchar(60) NOT NULL default '',
1792   `tran_date` date NOT NULL default '0000-00-00',
1793   `due_date` date NOT NULL default '0000-00-00',
1794   `ov_amount` double NOT NULL default '0',
1795   `ov_discount` double NOT NULL default '0',
1796   `ov_gst` double NOT NULL default '0',
1797   `rate` double NOT NULL default '1',
1798   `alloc` double NOT NULL default '0',
1799   `tax_included` tinyint(1) NOT NULL default '0',
1800   PRIMARY KEY (`type`,`trans_no`),
1801   KEY `supplier_id` (`supplier_id`),
1802   KEY `tran_date` (`tran_date`)
1803 ) ENGINE=InnoDB;
1804
1805 --
1806 -- Dumping data for table `0_supp_trans`
1807 --
1808
1809 -- --------------------------------------------------------
1810
1811 --
1812 -- Table structure for table `0_sys_prefs`
1813 --
1814
1815 DROP TABLE IF EXISTS `0_sys_prefs`;
1816 CREATE TABLE IF NOT EXISTS `0_sys_prefs` (
1817   `name` varchar(35) NOT NULL default '',
1818   `category` varchar(30) default NULL,
1819   `type` varchar(20) NOT NULL default '',
1820   `length` smallint(6) default NULL,
1821   `value` TEXT NOT NULL DEFAULT '',
1822   PRIMARY KEY (`name`),
1823   KEY `category` (`category`)
1824 ) ENGINE=InnoDB;
1825
1826 --
1827 -- Dumping data for table `0_sys_prefs`
1828 --
1829
1830 INSERT INTO `0_sys_prefs` VALUES ('coy_name', 'setup.company', 'varchar', 60, 'Company name');
1831 INSERT INTO `0_sys_prefs` VALUES ('gst_no', 'setup.company', 'varchar', 25, '');
1832 INSERT INTO `0_sys_prefs` VALUES ('coy_no', 'setup.company', 'varchar', 25, '');
1833 INSERT INTO `0_sys_prefs` VALUES ('tax_prd', 'setup.company', 'int', 11, '1');
1834 INSERT INTO `0_sys_prefs` VALUES ('tax_last', 'setup.company', 'int', 11, '1');
1835 INSERT INTO `0_sys_prefs` VALUES ('postal_address', 'setup.company', 'tinytext', 0, 'N/A');
1836 INSERT INTO `0_sys_prefs` VALUES ('phone', 'setup.company', 'varchar', 30, '');
1837 INSERT INTO `0_sys_prefs` VALUES ('fax', 'setup.company', 'varchar', 30, '');
1838 INSERT INTO `0_sys_prefs` VALUES ('email', 'setup.company', 'varchar', 100, '');
1839 INSERT INTO `0_sys_prefs` VALUES ('coy_logo', 'setup.company', 'varchar', 100, '');
1840 INSERT INTO `0_sys_prefs` VALUES ('domicile', 'setup.company', 'varchar', 55, '');
1841 INSERT INTO `0_sys_prefs` VALUES ('curr_default', 'setup.company', 'char', 3, 'USD');
1842 INSERT INTO `0_sys_prefs` VALUES ('use_dimension', 'setup.company', 'tinyint', 1, '1');
1843 INSERT INTO `0_sys_prefs` VALUES ('f_year', 'setup.company', 'int', 11, '1');
1844 INSERT INTO `0_sys_prefs` VALUES ('no_item_list', 'setup.company', 'tinyint', 1, '0');
1845 INSERT INTO `0_sys_prefs` VALUES ('no_customer_list', 'setup.company', 'tinyint', 1, '0');
1846 INSERT INTO `0_sys_prefs` VALUES ('no_supplier_list', 'setup.company', 'tinyint', 1, '0');
1847 INSERT INTO `0_sys_prefs` VALUES ('base_sales', 'setup.company', 'int', 11, '1');
1848 INSERT INTO `0_sys_prefs` VALUES ('time_zone', 'setup.company', 'tinyint', 1, '0');
1849 INSERT INTO `0_sys_prefs` VALUES ('add_pct', 'setup.company', 'int', 5, '-1');
1850 INSERT INTO `0_sys_prefs` VALUES ('round_to', 'setup.company', 'int', 5, '1');
1851 INSERT INTO `0_sys_prefs` VALUES ('login_tout', 'setup.company', 'smallint', 6, '600');
1852 INSERT INTO `0_sys_prefs` VALUES ('past_due_days', 'glsetup.general', 'int', 11, '30');
1853 INSERT INTO `0_sys_prefs` VALUES ('profit_loss_year_act', 'glsetup.general', 'varchar', 15, '9990');
1854 INSERT INTO `0_sys_prefs` VALUES ('retained_earnings_act', 'glsetup.general', 'varchar', 15, '3590');
1855 INSERT INTO `0_sys_prefs` VALUES ('bank_charge_act', 'glsetup.general', 'varchar', 15, '5690');
1856 INSERT INTO `0_sys_prefs` VALUES ('exchange_diff_act', 'glsetup.general', 'varchar', 15, '4450');
1857 INSERT INTO `0_sys_prefs` VALUES ('tax_algorithm', 'glsetup.customer', 'tinyint', 1, '1');
1858 INSERT INTO `0_sys_prefs` VALUES ('default_credit_limit', 'glsetup.customer', 'int', 11, '1000');
1859 INSERT INTO `0_sys_prefs` VALUES ('accumulate_shipping', 'glsetup.customer', 'tinyint', 1, '0');
1860 INSERT INTO `0_sys_prefs` VALUES ('legal_text', 'glsetup.customer', 'tinytext', 0, '');
1861 INSERT INTO `0_sys_prefs` VALUES ('freight_act', 'glsetup.customer', 'varchar', 15, '4430');
1862 INSERT INTO `0_sys_prefs` VALUES ('debtors_act', 'glsetup.sales', 'varchar', 15, '1200');
1863 INSERT INTO `0_sys_prefs` VALUES ('default_sales_act', 'glsetup.sales', 'varchar', 15, '4010');
1864 INSERT INTO `0_sys_prefs` VALUES ('default_sales_discount_act', 'glsetup.sales', 'varchar', 15, '4510');
1865 INSERT INTO `0_sys_prefs` VALUES ('default_prompt_payment_act', 'glsetup.sales', 'varchar', 15, '4500');
1866 INSERT INTO `0_sys_prefs` VALUES ('default_delivery_required', 'glsetup.sales', 'smallint', 6, '1');
1867 INSERT INTO `0_sys_prefs` VALUES ('default_receival_required', 'glsetup.purchase', 'smallint', 6, '10');
1868 INSERT INTO `0_sys_prefs` VALUES ('default_quote_valid_days', 'glsetup.sales', 'smallint', 6, '30');
1869 INSERT INTO `0_sys_prefs` VALUES ('default_dim_required', 'glsetup.dims', 'int', 11, '20');
1870 INSERT INTO `0_sys_prefs` VALUES ('pyt_discount_act', 'glsetup.purchase', 'varchar', 15, '5060');
1871 INSERT INTO `0_sys_prefs` VALUES ('creditors_act', 'glsetup.purchase', 'varchar', 15, '2100');
1872 INSERT INTO `0_sys_prefs` VALUES ('po_over_receive', 'glsetup.purchase', 'int', 11, '10');
1873 INSERT INTO `0_sys_prefs` VALUES ('po_over_charge', 'glsetup.purchase', 'int', 11, '10');
1874 INSERT INTO `0_sys_prefs` VALUES ('allow_negative_stock', 'glsetup.inventory', 'tinyint', 1, '0');
1875 INSERT INTO `0_sys_prefs` VALUES ('default_inventory_act', 'glsetup.items', 'varchar', 15, '1510');
1876 INSERT INTO `0_sys_prefs` VALUES ('default_cogs_act', 'glsetup.items', 'varchar', 15, '5010');
1877 INSERT INTO `0_sys_prefs` VALUES ('default_adj_act', 'glsetup.items', 'varchar', 15, '5040');
1878 INSERT INTO `0_sys_prefs` VALUES ('default_inv_sales_act', 'glsetup.items', 'varchar', 15, '4010');
1879 INSERT INTO `0_sys_prefs` VALUES ('default_assembly_act', 'glsetup.items', 'varchar', 15, '1530');
1880 INSERT INTO `0_sys_prefs` VALUES ('default_workorder_required', 'glsetup.manuf', 'int', 11, '20');
1881 INSERT INTO `0_sys_prefs` VALUES ('version_id', 'system', 'varchar', 11, '2.4.1');
1882 INSERT INTO `0_sys_prefs` VALUES ('auto_curr_reval', 'setup.company', 'smallint', 6, '1');
1883 INSERT INTO `0_sys_prefs` VALUES ('grn_clearing_act', 'glsetup.purchase', 'varchar', 15, '1550');
1884 INSERT INTO `0_sys_prefs` VALUES ('bcc_email', 'setup.company', 'varchar', 100, '');
1885 INSERT INTO `0_sys_prefs` VALUES ('deferred_income_act', 'glsetup.sales', 'varchar', '15', '');
1886 INSERT INTO `0_sys_prefs` VALUES ('gl_closing_date','setup.closing_date', 'date', 8, '');
1887 INSERT INTO `0_sys_prefs` VALUES ('alternative_tax_include_on_docs','setup.company', 'tinyint', 1, '0');
1888 INSERT INTO `0_sys_prefs` VALUES ('no_zero_lines_amount','glsetup.sales', 'tinyint', 1, '1');
1889 INSERT INTO `0_sys_prefs` VALUES ('show_po_item_codes','glsetup.purchase', 'tinyint', 1, '0');
1890 INSERT INTO `0_sys_prefs` VALUES ('accounts_alpha','glsetup.general', 'tinyint', 1, '0');
1891 INSERT INTO `0_sys_prefs` VALUES ('loc_notification','glsetup.inventory', 'tinyint', 1, '0');
1892 INSERT INTO `0_sys_prefs` VALUES ('print_invoice_no','glsetup.sales', 'tinyint', 1, '0');
1893 INSERT INTO `0_sys_prefs` VALUES ('allow_negative_prices','glsetup.inventory', 'tinyint', 1, '1');
1894 INSERT INTO `0_sys_prefs` VALUES ('print_item_images_on_quote','glsetup.inventory', 'tinyint', 1, '0');
1895 INSERT INTO `0_sys_prefs` VALUES ('suppress_tax_rates','setup.company', 'tinyint', 1, '0');
1896 INSERT INTO `0_sys_prefs` VALUES ('default_loss_on_asset_disposal_act', 'glsetup.items', 'varchar', '15', '5660');
1897 INSERT INTO `0_sys_prefs` VALUES ('depreciation_period', 'glsetup.company', 'tinyint', '1', '1');
1898 INSERT INTO `0_sys_prefs` VALUES ('use_manufacturing','setup.company', 'tinyint', 1, '1');
1899 INSERT INTO `0_sys_prefs` VALUES ('use_fixed_assets','setup.company', 'tinyint', 1, '1');
1900 INSERT INTO `0_sys_prefs` VALUES ('wip_act', 'glsetup.manuf', 'varchar', '15', '1530');
1901
1902 -- --------------------------------------------------------
1903
1904 --
1905 -- Table structure for table `0_tags`
1906 --
1907
1908 DROP TABLE IF EXISTS `0_tags`;
1909 CREATE TABLE IF NOT EXISTS `0_tags` (
1910   `id` int(11) NOT NULL auto_increment,
1911   `type` smallint(6) NOT NULL,
1912   `name` varchar(30) NOT NULL,
1913   `description` varchar(60) default NULL,
1914   `inactive` tinyint(1) NOT NULL default '0',
1915   PRIMARY KEY (`id`),
1916   UNIQUE KEY `type` (`type`,`name`)
1917 ) ENGINE=InnoDB;
1918
1919 --
1920 -- Dumping data for table `0_tags`
1921 --
1922
1923 -- --------------------------------------------------------
1924
1925 --
1926 -- Table structure for table `0_tag_associations`
1927 --
1928
1929 DROP TABLE IF EXISTS `0_tag_associations`;
1930 CREATE TABLE IF NOT EXISTS `0_tag_associations` (
1931   `record_id` varchar(15) NOT NULL,
1932   `tag_id` int(11) NOT NULL,
1933   UNIQUE KEY `record_id` (`record_id`,`tag_id`)
1934 ) ENGINE=InnoDB;
1935
1936 --
1937 -- Dumping data for table `0_tag_associations`
1938 --
1939
1940 -- --------------------------------------------------------
1941
1942 --
1943 -- Table structure for table `0_tax_groups`
1944 --
1945
1946 DROP TABLE IF EXISTS `0_tax_groups`;
1947 CREATE TABLE IF NOT EXISTS `0_tax_groups` (
1948   `id` int(11) NOT NULL auto_increment,
1949   `name` varchar(60) NOT NULL default '',
1950   `inactive` tinyint(1) NOT NULL default '0',
1951   PRIMARY KEY (`id`),
1952   UNIQUE KEY `name` (`name`)
1953 ) ENGINE=InnoDB AUTO_INCREMENT=3 ;
1954
1955 --
1956 -- Dumping data for table `0_tax_groups`
1957 --
1958
1959 INSERT INTO `0_tax_groups` VALUES (1, 'Tax', 0);
1960 INSERT INTO `0_tax_groups` VALUES (2, 'Tax Exempt', 0);
1961
1962 -- --------------------------------------------------------
1963
1964 --
1965 -- Table structure for table `0_tax_group_items`
1966 --
1967
1968 DROP TABLE IF EXISTS `0_tax_group_items`;
1969 CREATE TABLE IF NOT EXISTS `0_tax_group_items` (
1970   `tax_group_id` int(11) NOT NULL default '0',
1971   `tax_type_id` int(11) NOT NULL default '0',
1972   `tax_shipping` tinyint(1) NOT NULL default '0',
1973   PRIMARY KEY (`tax_group_id`,`tax_type_id`)
1974 ) ENGINE=InnoDB;
1975
1976 --
1977 -- Dumping data for table `0_tax_group_items`
1978 --
1979
1980 INSERT INTO `0_tax_group_items` VALUES (1, 1, 1);
1981
1982 -- --------------------------------------------------------
1983
1984 --
1985 -- Table structure for table `0_tax_types`
1986 --
1987
1988 DROP TABLE IF EXISTS `0_tax_types`;
1989 CREATE TABLE IF NOT EXISTS `0_tax_types` (
1990   `id` int(11) NOT NULL auto_increment,
1991   `rate` double NOT NULL default '0',
1992   `sales_gl_code` varchar(15) NOT NULL default '',
1993   `purchasing_gl_code` varchar(15) NOT NULL default '',
1994   `name` varchar(60) NOT NULL default '',
1995   `inactive` tinyint(1) NOT NULL default '0',
1996   PRIMARY KEY (`id`)
1997 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
1998
1999 --
2000 -- Dumping data for table `0_tax_types`
2001 --
2002
2003 INSERT INTO `0_tax_types` VALUES (1, 5, '2150', '2150', 'Tax', 0);
2004
2005 -- --------------------------------------------------------
2006
2007 --
2008 -- Table structure for table `0_trans_tax_details`
2009 --
2010
2011 DROP TABLE IF EXISTS `0_trans_tax_details`;
2012 CREATE TABLE IF NOT EXISTS `0_trans_tax_details` (
2013   `id` int(11) NOT NULL auto_increment,
2014   `trans_type` smallint(6) default NULL,
2015   `trans_no` int(11) default NULL,
2016   `tran_date` date NOT NULL,
2017   `tax_type_id` int(11) NOT NULL default '0',
2018   `rate` double NOT NULL default '0',
2019   `ex_rate` double NOT NULL default '1',
2020   `included_in_price` tinyint(1) NOT NULL default '0',
2021   `net_amount` double NOT NULL default '0',
2022   `amount` double NOT NULL default '0',
2023   `memo` tinytext,
2024   `reg_type` tinyint(1) default NULL,
2025   PRIMARY KEY (`id`),
2026   KEY `Type_and_Number` (`trans_type`,`trans_no`),
2027   KEY `tran_date` (`tran_date`)
2028 ) ENGINE=InnoDB;
2029
2030 --
2031 -- Dumping data for table `0_trans_tax_details`
2032 --
2033
2034 -- --------------------------------------------------------
2035
2036 --
2037 -- Table structure for table `0_useronline`
2038 --
2039
2040 DROP TABLE IF EXISTS `0_useronline`;
2041 CREATE TABLE IF NOT EXISTS `0_useronline` (
2042   `id` int(11) NOT NULL auto_increment,
2043   `timestamp` int(15) NOT NULL default '0',
2044   `ip` varchar(40) NOT NULL default '',
2045   `file` varchar(100) NOT NULL default '',
2046   PRIMARY KEY (`id`),
2047   KEY `timestamp` (`timestamp`),
2048   KEY `ip` (`ip`)
2049 ) ENGINE=InnoDB;
2050
2051 --
2052 -- Dumping data for table `0_useronline`
2053 --
2054
2055 -- --------------------------------------------------------
2056
2057 --
2058 -- Table structure for table `0_users`
2059 --
2060
2061 DROP TABLE IF EXISTS `0_users`;
2062 CREATE TABLE IF NOT EXISTS `0_users` (
2063   `id` smallint(6) NOT NULL auto_increment,
2064   `user_id` varchar(60) NOT NULL default '',
2065   `password` varchar(100) NOT NULL default '',
2066   `real_name` varchar(100) NOT NULL default '',
2067   `role_id` int(11) NOT NULL default '1',
2068   `phone` varchar(30) NOT NULL default '',
2069   `email` varchar(100) default NULL,
2070   `language` varchar(20) default NULL,
2071   `date_format` tinyint(1) NOT NULL default '0',
2072   `date_sep` tinyint(1) NOT NULL default '0',
2073   `tho_sep` tinyint(1) NOT NULL default '0',
2074   `dec_sep` tinyint(1) NOT NULL default '0',
2075   `theme` varchar(20) NOT NULL default 'default',
2076   `page_size` varchar(20) NOT NULL default 'A4',
2077   `prices_dec` smallint(6) NOT NULL default '2',
2078   `qty_dec` smallint(6) NOT NULL default '2',
2079   `rates_dec` smallint(6) NOT NULL default '4',
2080   `percent_dec` smallint(6) NOT NULL default '1',
2081   `show_gl` tinyint(1) NOT NULL default '1',
2082   `show_codes` tinyint(1) NOT NULL default '0',
2083   `show_hints` tinyint(1) NOT NULL default '0',
2084   `last_visit_date` datetime default NULL,
2085   `query_size` tinyint(1) unsigned NOT NULL default '10',
2086   `graphic_links` tinyint(1) default '1',
2087   `pos` smallint(6) default '1',
2088   `print_profile` varchar(30) NOT NULL default '',
2089   `rep_popup` tinyint(1) default '1',
2090   `sticky_doc_date` tinyint(1) default '0',
2091   `startup_tab` varchar(20) NOT NULL default '',
2092   `transaction_days` smallint(6) NOT NULL default '30',
2093   `save_report_selections` smallint(6) NOT NULL default '0',
2094   `use_date_picker` tinyint(1) NOT NULL default '1',
2095   `def_print_destination` tinyint(1) NOT NULL default '0',
2096   `def_print_orientation` tinyint(1) NOT NULL default '0',
2097   `inactive` tinyint(1) NOT NULL default '0',
2098   PRIMARY KEY (`id`),
2099   UNIQUE KEY `user_id` (`user_id`)
2100 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
2101
2102 --
2103 -- Dumping data for table `0_users`
2104 --
2105
2106 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);
2107
2108 -- --------------------------------------------------------
2109
2110 --
2111 -- Table structure for table `0_voided`
2112 --
2113
2114 DROP TABLE IF EXISTS `0_voided`;
2115 CREATE TABLE IF NOT EXISTS `0_voided` (
2116   `type` int(11) NOT NULL default '0',
2117   `id` int(11) NOT NULL default '0',
2118   `date_` date NOT NULL default '0000-00-00',
2119   `memo_` tinytext NOT NULL,
2120   UNIQUE KEY `id` (`type`,`id`)
2121 ) ENGINE=InnoDB;
2122
2123 --
2124 -- Dumping data for table `0_voided`
2125 --
2126
2127 -- --------------------------------------------------------
2128
2129 --
2130 -- Table structure for table `0_workcentres`
2131 --
2132
2133 DROP TABLE IF EXISTS `0_workcentres`;
2134 CREATE TABLE IF NOT EXISTS `0_workcentres` (
2135   `id` int(11) NOT NULL auto_increment,
2136   `name` char(40) NOT NULL default '',
2137   `description` char(50) NOT NULL default '',
2138   `inactive` tinyint(1) NOT NULL default '0',
2139   PRIMARY KEY (`id`),
2140   UNIQUE KEY `name` (`name`)
2141 ) ENGINE=InnoDB;
2142
2143 --
2144 -- Dumping data for table `0_workcentres`
2145 --
2146
2147 -- --------------------------------------------------------
2148
2149 --
2150 -- Table structure for table `0_workorders`
2151 --
2152
2153 DROP TABLE IF EXISTS `0_workorders`;
2154 CREATE TABLE IF NOT EXISTS `0_workorders` (
2155   `id` int(11) NOT NULL auto_increment,
2156   `wo_ref` varchar(60) NOT NULL default '',
2157   `loc_code` varchar(5) NOT NULL default '',
2158   `units_reqd` double NOT NULL default '1',
2159   `stock_id` varchar(20) NOT NULL default '',
2160   `date_` date NOT NULL default '0000-00-00',
2161   `type` tinyint(4) NOT NULL default '0',
2162   `required_by` date NOT NULL default '0000-00-00',
2163   `released_date` date NOT NULL default '0000-00-00',
2164   `units_issued` double NOT NULL default '0',
2165   `closed` tinyint(1) NOT NULL default '0',
2166   `released` tinyint(1) NOT NULL default '0',
2167   `additional_costs` double NOT NULL default '0',
2168   PRIMARY KEY (`id`),
2169   UNIQUE KEY `wo_ref` (`wo_ref`)
2170 ) ENGINE=InnoDB;
2171
2172 --
2173 -- Dumping data for table `0_workorders`
2174 --
2175
2176 -- --------------------------------------------------------
2177
2178 --
2179 -- Table structure for table `0_wo_costing`
2180 --
2181
2182 DROP TABLE IF EXISTS `0_wo_costing`;
2183 CREATE TABLE `0_wo_costing` (
2184   `id` int(11) NOT NULL auto_increment,
2185   `workorder_id` int(11) NOT NULL default '0',
2186   `cost_type` tinyint(1) NOT NULL default '0',
2187   `trans_type` int(11) NOT NULL default '0',
2188   `trans_no` int(11) NOT NULL default '0',
2189   `factor` double NOT NULL default '1',
2190   PRIMARY KEY (`id`)
2191 ) ENGINE=InnoDB;
2192
2193 --
2194 -- Dumping data for table `0_wo_costing`
2195 --
2196
2197 -- --------------------------------------------------------
2198
2199 --
2200 -- Table structure for table `0_wo_issues`
2201 --
2202
2203 DROP TABLE IF EXISTS `0_wo_issues`;
2204 CREATE TABLE IF NOT EXISTS `0_wo_issues` (
2205   `issue_no` int(11) NOT NULL auto_increment,
2206   `workorder_id` int(11) NOT NULL default '0',
2207   `reference` varchar(100) default NULL,
2208   `issue_date` date default NULL,
2209   `loc_code` varchar(5) default NULL,
2210   `workcentre_id` int(11) default NULL,
2211   PRIMARY KEY (`issue_no`),
2212   KEY `workorder_id` (`workorder_id`)
2213 ) ENGINE=InnoDB;
2214
2215 --
2216 -- Dumping data for table `0_wo_issues`
2217 --
2218
2219 -- --------------------------------------------------------
2220
2221 --
2222 -- Table structure for table `0_wo_issue_items`
2223 --
2224
2225 DROP TABLE IF EXISTS `0_wo_issue_items`;
2226 CREATE TABLE IF NOT EXISTS `0_wo_issue_items` (
2227   `id` int(11) NOT NULL auto_increment,
2228   `stock_id` varchar(40) default NULL,
2229   `issue_id` int(11) default NULL,
2230   `qty_issued` double default NULL,
2231   `unit_cost` double NOT NULL default '0',
2232   PRIMARY KEY (`id`)
2233 ) ENGINE=InnoDB;
2234
2235 --
2236 -- Dumping data for table `0_wo_issue_items`
2237 --
2238
2239 -- --------------------------------------------------------
2240
2241 --
2242 -- Table structure for table `0_wo_manufacture`
2243 --
2244
2245 DROP TABLE IF EXISTS `0_wo_manufacture`;
2246 CREATE TABLE IF NOT EXISTS `0_wo_manufacture` (
2247   `id` int(11) NOT NULL auto_increment,
2248   `reference` varchar(100) default NULL,
2249   `workorder_id` int(11) NOT NULL default '0',
2250   `quantity` double NOT NULL default '0',
2251   `date_` date NOT NULL default '0000-00-00',
2252   PRIMARY KEY (`id`),
2253   KEY `workorder_id` (`workorder_id`)
2254 ) ENGINE=InnoDB;
2255
2256 --
2257 -- Dumping data for table `0_wo_manufacture`
2258 --
2259
2260 -- --------------------------------------------------------
2261
2262 --
2263 -- Table structure for table `0_wo_requirements`
2264 --
2265
2266 DROP TABLE IF EXISTS `0_wo_requirements`;
2267 CREATE TABLE IF NOT EXISTS `0_wo_requirements` (
2268   `id` int(11) NOT NULL auto_increment,
2269   `workorder_id` int(11) NOT NULL default '0',
2270   `stock_id` char(20) NOT NULL default '',
2271   `workcentre` int(11) NOT NULL default '0',
2272   `units_req` double NOT NULL default '1',
2273   `unit_cost` double NOT NULL default '0',
2274   `loc_code` char(5) NOT NULL default '',
2275   `units_issued` double NOT NULL default '0',
2276   PRIMARY KEY (`id`),
2277   KEY `workorder_id` (`workorder_id`)
2278 ) ENGINE=InnoDB;
2279
2280 --
2281 -- Dumping data for table `0_wo_requirements`
2282 --
2283