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