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.
8 -- Compatibility: 2.5.0
14 -- Structure of table `0_areas` --
16 DROP TABLE IF EXISTS `0_areas`;
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 ;
26 -- Data of table `0_areas` --
28 INSERT INTO `0_areas` VALUES
31 -- Structure of table `0_attachments` --
33 DROP TABLE IF EXISTS `0_attachments`;
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 '',
46 KEY `type_no` (`type_no`,`trans_no`)
49 -- Data of table `0_attachments` --
51 -- Structure of table `0_audit_trail` --
53 DROP TABLE IF EXISTS `0_audit_trail`;
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,
66 KEY `Seq` (`fiscal_year`,`gl_date`,`gl_seq`),
67 KEY `Type_and_Number` (`type`,`trans_no`)
68 ) ENGINE=InnoDB AUTO_INCREMENT=37 ;
70 -- Data of table `0_audit_trail` --
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');
110 -- Structure of table `0_bank_accounts` --
112 DROP TABLE IF EXISTS `0_bank_accounts`;
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',
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 ;
134 -- Data of table `0_bank_accounts` --
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');
140 -- Structure of table `0_bank_trans` --
142 DROP TABLE IF EXISTS `0_bank_trans`;
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,
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 ;
165 -- Data of table `0_bank_trans` --
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);
174 -- Structure of table `0_bom` --
176 DROP TABLE IF EXISTS `0_bom`;
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`),
188 KEY `loc_code` (`loc_code`),
189 KEY `parent` (`parent`,`loc_code`),
190 KEY `workcentre_added` (`workcentre_added`)
191 ) ENGINE=InnoDB AUTO_INCREMENT=5 ;
193 -- Data of table `0_bom` --
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');
201 -- Structure of table `0_budget_trans` --
203 DROP TABLE IF EXISTS `0_budget_trans`;
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',
214 KEY `Account` (`account`,`tran_date`,`dimension_id`,`dimension2_id`)
217 -- Data of table `0_budget_trans` --
219 -- Structure of table `0_chart_class` --
221 DROP TABLE IF EXISTS `0_chart_class`;
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',
231 -- Data of table `0_chart_class` --
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');
239 -- Structure of table `0_chart_master` --
241 DROP TABLE IF EXISTS `0_chart_master`;
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`)
254 -- Data of table `0_chart_master` --
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');
337 -- Structure of table `0_chart_types` --
339 DROP TABLE IF EXISTS `0_chart_types`;
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',
349 KEY `class_id` (`class_id`)
352 -- Data of table `0_chart_types` --
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');
368 -- Structure of table `0_comments` --
370 DROP TABLE IF EXISTS `0_comments`;
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',
377 KEY `type_and_id` (`type`,`id`)
380 -- Data of table `0_comments` --
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');
391 -- Structure of table `0_credit_status` --
393 DROP TABLE IF EXISTS `0_credit_status`;
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',
401 UNIQUE KEY `reason_description` (`reason_description`)
402 ) ENGINE=InnoDB AUTO_INCREMENT=5 ;
404 -- Data of table `0_credit_status` --
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');
411 -- Structure of table `0_crm_categories` --
413 DROP TABLE IF EXISTS `0_crm_categories`;
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',
424 UNIQUE KEY `type` (`type`,`action`),
425 UNIQUE KEY `type_2` (`type`,`name`)
426 ) ENGINE=InnoDB AUTO_INCREMENT=13 ;
428 -- Data of table `0_crm_categories` --
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');
444 -- Structure of table `0_crm_contacts` --
446 DROP TABLE IF EXISTS `0_crm_contacts`;
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',
455 KEY `type` (`type`,`action`)
456 ) ENGINE=InnoDB AUTO_INCREMENT=11 ;
458 -- Data of table `0_crm_contacts` --
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');
468 -- Structure of table `0_crm_persons` --
470 DROP TABLE IF EXISTS `0_crm_persons`;
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,
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',
487 ) ENGINE=InnoDB AUTO_INCREMENT=5 ;
489 -- Data of table `0_crm_persons` --
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');
497 -- Structure of table `0_currencies` --
499 DROP TABLE IF EXISTS `0_currencies`;
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`)
512 -- Data of table `0_currencies` --
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');
520 -- Structure of table `0_cust_allocations` --
522 DROP TABLE IF EXISTS `0_cust_allocations`;
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,
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 ;
540 -- Data of table `0_cust_allocations` --
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');
548 -- Structure of table `0_cust_branch` --
550 DROP TABLE IF EXISTS `0_cust_branch`;
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 ;
577 -- Data of table `0_cust_branch` --
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');
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,
594 -- Structure of table `0_debtor_trans` --
596 DROP TABLE IF EXISTS `0_debtor_trans`;
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_`)
628 -- Data of table `0_debtor_trans` --
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');
646 -- Structure of table `0_debtor_trans_details` --
648 DROP TABLE IF EXISTS `0_debtor_trans_details`;
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,
664 KEY `Transaction` (`debtor_trans_type`,`debtor_trans_no`),
665 KEY `src_id` (`src_id`)
666 ) ENGINE=InnoDB AUTO_INCREMENT=15 ;
668 -- Data of table `0_debtor_trans_details` --
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');
686 -- Structure of table `0_debtors_master` --
688 DROP TABLE IF EXISTS `0_debtors_master`;
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,
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`),
709 ) ENGINE=InnoDB AUTO_INCREMENT=3 ;
711 -- Data of table `0_debtors_master` --
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');
717 -- Structure of table `0_dimensions` --
719 DROP TABLE IF EXISTS `0_dimensions`;
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',
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 ;
736 -- Data of table `0_dimensions` --
738 INSERT INTO `0_dimensions` VALUES
739 ('1', '001/2018', 'Cost Centre', '1', '0', '2018-05-05', '2018-05-25');
741 -- Structure of table `0_exchange_rates` --
743 DROP TABLE IF EXISTS `0_exchange_rates`;
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',
752 UNIQUE KEY `curr_code` (`curr_code`,`date_`)
753 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
755 -- Data of table `0_exchange_rates` --
757 INSERT INTO `0_exchange_rates` VALUES
758 ('1', 'EUR', '1.123', '1.123', '2018-05-07');
760 -- Structure of table `0_fiscal_year` --
762 DROP TABLE IF EXISTS `0_fiscal_year`;
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',
770 UNIQUE KEY `begin` (`begin`),
771 UNIQUE KEY `end` (`end`)
772 ) ENGINE=InnoDB AUTO_INCREMENT=3 ;
774 -- Data of table `0_fiscal_year` --
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');
780 -- Structure of table `0_gl_trans` --
782 DROP TABLE IF EXISTS `0_gl_trans`;
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 ;
804 -- Data of table `0_gl_trans` --
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);
862 -- Structure of table `0_grn_batch` --
864 DROP TABLE IF EXISTS `0_grn_batch`;
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',
875 KEY `delivery_date` (`delivery_date`),
876 KEY `purch_order_no` (`purch_order_no`)
877 ) ENGINE=InnoDB AUTO_INCREMENT=4 ;
879 -- Data of table `0_grn_batch` --
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');
886 -- Structure of table `0_grn_items` --
888 DROP TABLE IF EXISTS `0_grn_items`;
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',
899 KEY `grn_batch_id` (`grn_batch_id`)
900 ) ENGINE=InnoDB AUTO_INCREMENT=6 ;
902 -- Data of table `0_grn_items` --
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');
911 -- Structure of table `0_groups` --
913 DROP TABLE IF EXISTS `0_groups`;
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',
920 UNIQUE KEY `description` (`description`)
921 ) ENGINE=InnoDB AUTO_INCREMENT=4 ;
923 -- Data of table `0_groups` --
925 INSERT INTO `0_groups` VALUES
927 ('2', 'Medium', '0'),
930 -- Structure of table `0_item_codes` --
932 DROP TABLE IF EXISTS `0_item_codes`;
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',
944 UNIQUE KEY `stock_id` (`stock_id`,`item_code`),
945 KEY `item_code` (`item_code`)
946 ) ENGINE=InnoDB AUTO_INCREMENT=9 ;
948 -- Data of table `0_item_codes` --
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');
960 -- Structure of table `0_item_tax_type_exemptions` --
962 DROP TABLE IF EXISTS `0_item_tax_type_exemptions`;
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`)
970 -- Data of table `0_item_tax_type_exemptions` --
972 -- Structure of table `0_item_tax_types` --
974 DROP TABLE IF EXISTS `0_item_tax_types`;
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',
982 UNIQUE KEY `name` (`name`)
983 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
985 -- Data of table `0_item_tax_types` --
987 INSERT INTO `0_item_tax_types` VALUES
988 ('1', 'Regular', '0', '0');
990 -- Structure of table `0_item_units` --
992 DROP TABLE IF EXISTS `0_item_units`;
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`)
1003 -- Data of table `0_item_units` --
1005 INSERT INTO `0_item_units` VALUES
1006 ('each', 'Each', '0', '0'),
1007 ('hr', 'Hours', '0', '0');
1009 -- Structure of table `0_journal` --
1011 DROP TABLE IF EXISTS `0_journal`;
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`)
1028 -- Data of table `0_journal` --
1030 INSERT INTO `0_journal` VALUES
1031 ('0', '1', '2018-12-31', '001/2012', '', '2018-12-31', '2018-12-31', 'USD', '2163.57', '1');
1033 -- Structure of table `0_loc_stock` --
1035 DROP TABLE IF EXISTS `0_loc_stock`;
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`)
1045 -- Data of table `0_loc_stock` --
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');
1055 -- Structure of table `0_locations` --
1057 DROP TABLE IF EXISTS `0_locations`;
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`)
1073 -- Data of table `0_locations` --
1075 INSERT INTO `0_locations` VALUES
1076 ('DEF', 'Default', 'N/A', '', '', '', '', '', '0', '0');
1078 -- Structure of table `0_payment_terms` --
1080 DROP TABLE IF EXISTS `0_payment_terms`;
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',
1091 UNIQUE KEY `terms` (`terms`)
1092 ) ENGINE=InnoDB AUTO_INCREMENT=6 ;
1094 -- Data of table `0_payment_terms` --
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');
1103 -- Structure of table `0_prices` --
1105 DROP TABLE IF EXISTS `0_prices`;
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',
1114 UNIQUE KEY `price` (`stock_id`,`sales_type_id`,`curr_abrev`)
1115 ) ENGINE=InnoDB AUTO_INCREMENT=4 ;
1117 -- Data of table `0_prices` --
1119 INSERT INTO `0_prices` VALUES
1120 ('1', '101', '1', 'USD', '300'),
1121 ('2', '102', '1', 'USD', '250'),
1122 ('3', '103', '1', 'USD', '50');
1124 -- Structure of table `0_print_profiles` --
1126 DROP TABLE IF EXISTS `0_print_profiles`;
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,
1134 UNIQUE KEY `profile` (`profile`,`report`)
1135 ) ENGINE=InnoDB AUTO_INCREMENT=10 ;
1137 -- Data of table `0_print_profiles` --
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');
1150 -- Structure of table `0_printers` --
1152 DROP TABLE IF EXISTS `0_printers`;
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,
1163 UNIQUE KEY `name` (`name`)
1164 ) ENGINE=InnoDB AUTO_INCREMENT=4 ;
1166 -- Data of table `0_printers` --
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');
1173 -- Structure of table `0_purch_data` --
1175 DROP TABLE IF EXISTS `0_purch_data`;
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`)
1187 -- Data of table `0_purch_data` --
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');
1194 -- Structure of table `0_purch_order_details` --
1196 DROP TABLE IF EXISTS `0_purch_order_details`;
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 ;
1215 -- Data of table `0_purch_order_details` --
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');
1224 -- Structure of table `0_purch_orders` --
1226 DROP TABLE IF EXISTS `0_purch_orders`;
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 ;
1245 -- Data of table `0_purch_orders` --
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');
1252 -- Structure of table `0_quick_entries` --
1254 DROP TABLE IF EXISTS `0_quick_entries`;
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',
1265 KEY `description` (`description`)
1266 ) ENGINE=InnoDB AUTO_INCREMENT=4 ;
1268 -- Data of table `0_quick_entries` --
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');
1275 -- Structure of table `0_quick_entry_lines` --
1277 DROP TABLE IF EXISTS `0_quick_entry_lines`;
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,
1290 ) ENGINE=InnoDB AUTO_INCREMENT=7 ;
1292 -- Data of table `0_quick_entry_lines` --
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');
1302 -- Structure of table `0_recurrent_invoices` --
1304 DROP TABLE IF EXISTS `0_recurrent_invoices`;
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',
1318 UNIQUE KEY `description` (`description`)
1319 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
1321 -- Data of table `0_recurrent_invoices` --
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');
1326 -- Structure of table `0_reflines` --
1328 DROP TABLE IF EXISTS `0_reflines`;
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',
1339 UNIQUE KEY `prefix` (`trans_type`,`prefix`)
1340 ) ENGINE=InnoDB AUTO_INCREMENT=23 ;
1342 -- Data of table `0_reflines` --
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');
1368 -- Structure of table `0_refs` --
1370 DROP TABLE IF EXISTS `0_refs`;
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`)
1380 -- Data of table `0_refs` --
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');
1405 -- Structure of table `0_sales_order_details` --
1407 DROP TABLE IF EXISTS `0_sales_order_details`;
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',
1421 KEY `sorder` (`trans_type`,`order_no`),
1422 KEY `stkcode` (`stk_code`)
1423 ) ENGINE=InnoDB AUTO_INCREMENT=12 ;
1425 -- Data of table `0_sales_order_details` --
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');
1440 -- Structure of table `0_sales_orders` --
1442 DROP TABLE IF EXISTS `0_sales_orders`;
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`)
1471 -- Data of table `0_sales_orders` --
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');
1483 -- Structure of table `0_sales_pos` --
1485 DROP TABLE IF EXISTS `0_sales_pos`;
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',
1496 UNIQUE KEY `pos_name` (`pos_name`)
1497 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
1499 -- Data of table `0_sales_pos` --
1501 INSERT INTO `0_sales_pos` VALUES
1502 ('1', 'Default', '1', '1', 'DEF', '2', '0');
1504 -- Structure of table `0_sales_types` --
1506 DROP TABLE IF EXISTS `0_sales_types`;
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',
1515 UNIQUE KEY `sales_type` (`sales_type`)
1516 ) ENGINE=InnoDB AUTO_INCREMENT=3 ;
1518 -- Data of table `0_sales_types` --
1520 INSERT INTO `0_sales_types` VALUES
1521 ('1', 'Retail', '1', '1', '0'),
1522 ('2', 'Wholesale', '0', '0.7', '0');
1524 -- Structure of table `0_salesman` --
1526 DROP TABLE IF EXISTS `0_salesman`;
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 ;
1542 -- Data of table `0_salesman` --
1544 INSERT INTO `0_salesman` VALUES
1545 ('1', 'Sales Person', '', '', '', '5', '1000', '4', '0');
1547 -- Structure of table `0_security_roles` --
1549 DROP TABLE IF EXISTS `0_security_roles`;
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,
1557 `inactive` tinyint(1) NOT NULL DEFAULT '0',
1559 UNIQUE KEY `role` (`role`)
1560 ) ENGINE=InnoDB AUTO_INCREMENT=11 ;
1562 -- Data of table `0_security_roles` --
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');
1576 -- Structure of table `0_shippers` --
1578 DROP TABLE IF EXISTS `0_shippers`;
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 ;
1592 -- Data of table `0_shippers` --
1594 INSERT INTO `0_shippers` VALUES
1595 ('1', 'Default', '', '', '', '', '0');
1597 -- Structure of table `0_stock_category` --
1599 DROP TABLE IF EXISTS `0_stock_category`;
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 ;
1622 -- Data of table `0_stock_category` --
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');
1631 -- Structure of table `0_stock_fa_class` --
1633 DROP TABLE IF EXISTS `0_stock_fa_class`;
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`)
1645 -- Data of table `0_stock_fa_class` --
1647 -- Structure of table `0_stock_master` --
1649 DROP TABLE IF EXISTS `0_stock_master`;
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`)
1685 -- Data of table `0_stock_master` --
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');
1696 -- Structure of table `0_stock_moves` --
1698 DROP TABLE IF EXISTS `0_stock_moves`;
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 ;
1716 -- Data of table `0_stock_moves` --
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');
1737 -- Structure of table `0_supp_allocations` --
1739 DROP TABLE IF EXISTS `0_supp_allocations`;
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,
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`)
1757 -- Data of table `0_supp_allocations` --
1759 -- Structure of table `0_supp_invoice_items` --
1761 DROP TABLE IF EXISTS `0_supp_invoice_items`;
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',
1776 `dimension_id` int(11) NOT NULL DEFAULT '0',
1777 `dimension2_id` int(11) NOT NULL DEFAULT '0',
1779 KEY `Transaction` (`supp_trans_type`,`supp_trans_no`,`stock_id`)
1780 ) ENGINE=InnoDB AUTO_INCREMENT=3 ;
1782 -- Data of table `0_supp_invoice_items` --
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');
1788 -- Structure of table `0_supp_trans` --
1790 DROP TABLE IF EXISTS `0_supp_trans`;
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`)
1811 -- Data of table `0_supp_trans` --
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');
1817 -- Structure of table `0_suppliers` --
1819 DROP TABLE IF EXISTS `0_suppliers`;
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 ;
1848 -- Data of table `0_suppliers` --
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');
1854 -- Structure of table `0_sys_prefs` --
1856 DROP TABLE IF EXISTS `0_sys_prefs`;
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`)
1868 -- Data of table `0_sys_prefs` --
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');
1947 -- Structure of table `0_tag_associations` --
1949 DROP TABLE IF EXISTS `0_tag_associations`;
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`)
1957 -- Data of table `0_tag_associations` --
1959 -- Structure of table `0_tags` --
1961 DROP TABLE IF EXISTS `0_tags`;
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',
1970 UNIQUE KEY `type` (`type`,`name`)
1973 -- Data of table `0_tags` --
1975 -- Structure of table `0_tax_group_items` --
1977 DROP TABLE IF EXISTS `0_tax_group_items`;
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`)
1985 -- Data of table `0_tax_group_items` --
1987 INSERT INTO `0_tax_group_items` VALUES
1990 -- Structure of table `0_tax_groups` --
1992 DROP TABLE IF EXISTS `0_tax_groups`;
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',
2000 UNIQUE KEY `name` (`name`)
2001 ) ENGINE=InnoDB AUTO_INCREMENT=3 ;
2003 -- Data of table `0_tax_groups` --
2005 INSERT INTO `0_tax_groups` VALUES
2006 ('1', 'Tax', '0', '0'),
2007 ('2', 'Export/Import', '1', '0');
2009 -- Structure of table `0_tax_types` --
2011 DROP TABLE IF EXISTS `0_tax_types`;
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',
2021 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
2023 -- Data of table `0_tax_types` --
2025 INSERT INTO `0_tax_types` VALUES
2026 ('1', '5', '2150', '2150', 'Tax', '0');
2028 -- Structure of table `0_trans_tax_details` --
2030 DROP TABLE IF EXISTS `0_trans_tax_details`;
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',
2044 `reg_type` tinyint(1) DEFAULT NULL,
2045 `vat_category` int(11) NOT NULL DEFAULT '0',
2046 `tax_group_id` tinyint(2) DEFAULT NULL,
2048 KEY `Type_and_Number` (`trans_type`,`trans_no`),
2049 KEY `tran_date` (`tran_date`)
2050 ) ENGINE=InnoDB AUTO_INCREMENT=11 ;
2052 -- Data of table `0_trans_tax_details` --
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');
2066 -- Structure of table `0_useronline` --
2068 DROP TABLE IF EXISTS `0_useronline`;
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 '',
2076 KEY `timestamp` (`timestamp`),
2080 -- Data of table `0_useronline` --
2083 -- Structure of table `0_users` --
2085 DROP TABLE IF EXISTS `0_users`;
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',
2124 UNIQUE KEY `user_id` (`user_id`)
2125 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
2127 -- Data of table `0_users` --
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');
2132 -- Structure of table `0_voided` --
2134 DROP TABLE IF EXISTS `0_voided`;
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`)
2144 -- Data of table `0_voided` --
2147 -- Structure of table `0_wo_costing` --
2149 DROP TABLE IF EXISTS `0_wo_costing`;
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',
2161 -- Data of table `0_wo_costing` --
2163 -- Structure of table `0_wo_issue_items` --
2165 DROP TABLE IF EXISTS `0_wo_issue_items`;
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',
2176 -- Data of table `0_wo_issue_items` --
2179 -- Structure of table `0_wo_issues` --
2181 DROP TABLE IF EXISTS `0_wo_issues`;
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`)
2194 -- Data of table `0_wo_issues` --
2196 -- Structure of table `0_wo_manufacture` --
2198 DROP TABLE IF EXISTS `0_wo_manufacture`;
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',
2207 KEY `workorder_id` (`workorder_id`)
2208 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
2210 -- Data of table `0_wo_manufacture` --
2212 INSERT INTO `0_wo_manufacture` VALUES
2213 ('1', '001/2018', '1', '2', '2018-05-05');
2215 -- Structure of table `0_wo_requirements` --
2217 DROP TABLE IF EXISTS `0_wo_requirements`;
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',
2229 KEY `workorder_id` (`workorder_id`)
2230 ) ENGINE=InnoDB AUTO_INCREMENT=9 ;
2232 -- Data of table `0_wo_requirements` --
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');
2244 -- Structure of table `0_workcentres` --
2246 DROP TABLE IF EXISTS `0_workcentres`;
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',
2254 UNIQUE KEY `name` (`name`)
2255 ) ENGINE=InnoDB AUTO_INCREMENT=2 ;
2257 -- Data of table `0_workcentres` --
2259 INSERT INTO `0_workcentres` VALUES
2260 ('1', 'Work Centre', '', '0');
2262 -- Structure of table `0_workorders` --
2264 DROP TABLE IF EXISTS `0_workorders`;
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',
2280 KEY `wo_ref` (`wo_ref`)
2281 ) ENGINE=InnoDB AUTO_INCREMENT=4 ;
2283 -- Data of table `0_workorders` --
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');