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