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