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