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