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