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