1 # MySQL dump of database 'fa' on host 'localhost'
2 # Backup Date and Time: 2009-01-30 11:03
3 # Built by FrontAccounting 2.1.0 CVS
4 # http://frontaccounting.net
5 # Company: Company name
7 # Database: en_US-new.sql release 2.1
10 ### Structure of table `0_areas` ###
12 DROP TABLE IF EXISTS `0_areas`;
14 CREATE TABLE `0_areas` (
15 `area_code` int(11) NOT NULL auto_increment,
16 `description` varchar(60) NOT NULL default '',
17 `inactive` tinyint(1) NOT NULL default '0',
18 PRIMARY KEY (`area_code`),
19 UNIQUE KEY `description` (`description`)
20 ) TYPE=MyISAM AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
23 ### Data of table `0_areas` ###
25 INSERT INTO `0_areas` VALUES ('1', 'USA', '0');
28 ### Structure of table `0_attachments` ###
30 DROP TABLE IF EXISTS `0_attachments`;
32 CREATE TABLE `0_attachments` (
33 `id` int(11) unsigned NOT NULL auto_increment,
34 `description` varchar(60) NOT NULL default '',
35 `type_no` int(11) NOT NULL default '0',
36 `trans_no` int(11) NOT NULL default '0',
37 `unique_name` varchar(60) NOT NULL default '',
38 `tran_date` date NOT NULL default '0000-00-00',
39 `filename` varchar(60) NOT NULL default '',
40 `filesize` int(11) NOT NULL default '0',
41 `filetype` varchar(60) NOT NULL default '',
43 KEY `type_no` (`type_no`,`trans_no`)
44 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
47 ### Data of table `0_attachments` ###
51 ### Structure of table `0_bank_accounts` ###
53 DROP TABLE IF EXISTS `0_bank_accounts`;
55 CREATE TABLE `0_bank_accounts` (
56 `account_code` varchar(11) NOT NULL default '',
57 `account_type` smallint(6) NOT NULL default '0',
58 `bank_account_name` varchar(60) NOT NULL default '',
59 `bank_account_number` varchar(100) NOT NULL default '',
60 `bank_name` varchar(60) NOT NULL default '',
61 `bank_address` tinytext,
62 `bank_curr_code` char(3) NOT NULL default '',
63 `id` smallint(6) NOT NULL auto_increment,
64 `last_reconciled_date` timestamp NOT NULL default '0000-00-00 00:00:00',
65 `ending_reconcile_balance` double NOT NULL default '0',
66 `inactive` tinyint(1) NOT NULL default '0',
68 KEY `bank_account_name` (`bank_account_name`),
69 KEY `bank_account_number` (`bank_account_number`)
70 ) TYPE=MyISAM AUTO_INCREMENT=3 AUTO_INCREMENT=3 ;
73 ### Data of table `0_bank_accounts` ###
75 INSERT INTO `0_bank_accounts` VALUES ('1700', '0', 'Current account', 'N/A', 'N/A', '', 'USD', '1', '0000-00-00 00:00:00', '0', '0');
76 INSERT INTO `0_bank_accounts` VALUES ('1705', '0', 'Petty Cash account', 'N/A', 'N/A', '', 'USD', '2', '0000-00-00 00:00:00', '0', '0');
79 ### Structure of table `0_bank_trans` ###
81 DROP TABLE IF EXISTS `0_bank_trans`;
83 CREATE TABLE `0_bank_trans` (
84 `id` int(11) NOT NULL auto_increment,
85 `type` smallint(6) default NULL,
86 `trans_no` int(11) default NULL,
87 `bank_act` varchar(11) default NULL,
88 `ref` varchar(40) default NULL,
89 `trans_date` date NOT NULL default '0000-00-00',
90 `amount` double default NULL,
91 `dimension_id` int(11) NOT NULL default '0',
92 `dimension2_id` int(11) NOT NULL default '0',
93 `person_type_id` int(11) NOT NULL default '0',
95 `reconciled` date default NULL,
97 KEY `bank_act` (`bank_act`,`ref`),
98 KEY `type` (`type`,`trans_no`)
99 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
102 ### Data of table `0_bank_trans` ###
106 ### Structure of table `0_bom` ###
108 DROP TABLE IF EXISTS `0_bom`;
110 CREATE TABLE `0_bom` (
111 `id` int(11) NOT NULL auto_increment,
112 `parent` char(20) NOT NULL default '',
113 `component` char(20) NOT NULL default '',
114 `workcentre_added` int(11) NOT NULL default '0',
115 `loc_code` char(5) NOT NULL default '',
116 `quantity` double NOT NULL default '1',
117 PRIMARY KEY (`parent`,`component`,`workcentre_added`,`loc_code`),
118 KEY `component` (`component`),
120 KEY `loc_code` (`loc_code`),
121 KEY `parent` (`parent`,`loc_code`),
122 KEY `Parent_2` (`parent`),
123 KEY `workcentre_added` (`workcentre_added`)
124 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
127 ### Data of table `0_bom` ###
131 ### Structure of table `0_budget_trans` ###
133 DROP TABLE IF EXISTS `0_budget_trans`;
135 CREATE TABLE `0_budget_trans` (
136 `counter` int(11) NOT NULL auto_increment,
137 `type` smallint(6) NOT NULL default '0',
138 `type_no` bigint(16) NOT NULL default '1',
139 `tran_date` date NOT NULL default '0000-00-00',
140 `account` varchar(11) NOT NULL default '',
141 `memo_` tinytext NOT NULL,
142 `amount` double NOT NULL default '0',
143 `dimension_id` int(11) default '0',
144 `dimension2_id` int(11) default '0',
145 `person_type_id` int(11) default NULL,
146 `person_id` tinyblob,
147 PRIMARY KEY (`counter`),
148 KEY `Type_and_Number` (`type`,`type_no`)
149 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
152 ### Data of table `0_budget_trans` ###
156 ### Structure of table `0_chart_class` ###
158 DROP TABLE IF EXISTS `0_chart_class`;
160 CREATE TABLE `0_chart_class` (
161 `cid` int(11) NOT NULL default '0',
162 `class_name` varchar(60) NOT NULL default '',
163 `balance_sheet` tinyint(1) NOT NULL default '0',
168 ### Data of table `0_chart_class` ###
170 INSERT INTO `0_chart_class` VALUES ('1', 'Assets', '1');
171 INSERT INTO `0_chart_class` VALUES ('2', 'Liabilities', '1');
172 INSERT INTO `0_chart_class` VALUES ('3', 'Income', '0');
173 INSERT INTO `0_chart_class` VALUES ('4', 'Costs', '0');
176 ### Structure of table `0_chart_master` ###
178 DROP TABLE IF EXISTS `0_chart_master`;
180 CREATE TABLE `0_chart_master` (
181 `account_code` varchar(11) NOT NULL default '',
182 `account_code2` varchar(11) default '',
183 `account_name` varchar(60) NOT NULL default '',
184 `account_type` int(11) NOT NULL default '0',
185 `inactive` tinyint(1) NOT NULL default '0',
186 PRIMARY KEY (`account_code`),
187 KEY `account_code` (`account_code`),
188 KEY `account_name` (`account_name`)
192 ### Data of table `0_chart_master` ###
194 INSERT INTO `0_chart_master` VALUES ('3000', '', 'Sales', '1', '0');
195 INSERT INTO `0_chart_master` VALUES ('3010', '', 'Sales - Wholesale', '1', '0');
196 INSERT INTO `0_chart_master` VALUES ('3020', '', 'Sales of Other items', '1', '0');
197 INSERT INTO `0_chart_master` VALUES ('3400', '', 'Difference On Exchange', '1', '0');
198 INSERT INTO `0_chart_master` VALUES ('5000', '', 'Direct Labour', '2', '0');
199 INSERT INTO `0_chart_master` VALUES ('5050', '', 'Direct Labour Recovery', '2', '0');
200 INSERT INTO `0_chart_master` VALUES ('4200', '', 'Material Usage Varaiance', '2', '0');
201 INSERT INTO `0_chart_master` VALUES ('4210', '', 'Consumable Materials', '2', '0');
202 INSERT INTO `0_chart_master` VALUES ('4220', '', 'Purchase price Variance', '2', '0');
203 INSERT INTO `0_chart_master` VALUES ('4000', '', 'Purchases of materials', '2', '0');
204 INSERT INTO `0_chart_master` VALUES ('4250', '', 'Discounts Received', '2', '0');
205 INSERT INTO `0_chart_master` VALUES ('4260', '', 'Exchange Variation', '2', '0');
206 INSERT INTO `0_chart_master` VALUES ('4300', '', 'Freight Inwards', '2', '0');
207 INSERT INTO `0_chart_master` VALUES ('4010', '', 'Cost of Goods Sold - Retail', '2', '0');
208 INSERT INTO `0_chart_master` VALUES ('6790', '', 'Bank Charges', '5', '0');
209 INSERT INTO `0_chart_master` VALUES ('6800', '', 'Entertainments', '5', '0');
210 INSERT INTO `0_chart_master` VALUES ('6810', '', 'Legal Expenses', '5', '0');
211 INSERT INTO `0_chart_master` VALUES ('6600', '', 'Repairs and Maintenance Office', '5', '0');
212 INSERT INTO `0_chart_master` VALUES ('6730', '', 'phone', '5', '0');
213 INSERT INTO `0_chart_master` VALUES ('8200', '', 'Bank Interest', '52', '0');
214 INSERT INTO `0_chart_master` VALUES ('6840', '', 'Credit Control', '5', '0');
215 INSERT INTO `0_chart_master` VALUES ('7040', '', 'Depreciation Office Equipment', '51', '0');
216 INSERT INTO `0_chart_master` VALUES ('3800', '', 'Freight Outwards', '5', '0');
217 INSERT INTO `0_chart_master` VALUES ('4500', '', 'Packaging', '5', '0');
218 INSERT INTO `0_chart_master` VALUES ('6400', '', 'Commissions', '5', '0');
219 INSERT INTO `0_chart_master` VALUES ('3200', '', 'Prompt Payment Discounts', '1', '0');
220 INSERT INTO `0_chart_master` VALUES ('6700', '', 'General Expenses', '5', '0');
221 INSERT INTO `0_chart_master` VALUES ('5200', '', 'Indirect Labour', '2', '0');
222 INSERT INTO `0_chart_master` VALUES ('5210', '', 'Overhead Recovery', '5', '0');
223 INSERT INTO `0_chart_master` VALUES ('1700', '', 'Bank account', '10', '0');
224 INSERT INTO `0_chart_master` VALUES ('1705', '', 'Petty Cash', '10', '0');
225 INSERT INTO `0_chart_master` VALUES ('1710', '', 'Foreign currency account', '10', '0');
226 INSERT INTO `0_chart_master` VALUES ('1500', '', 'Accounts Receivable', '20', '0');
227 INSERT INTO `0_chart_master` VALUES ('1400', '', 'Stocks of Raw Materials', '45', '0');
228 INSERT INTO `0_chart_master` VALUES ('1410', '', 'Stocks of Work In Progress', '45', '0');
229 INSERT INTO `0_chart_master` VALUES ('1420', '', 'Stocks of Finsihed Goods', '45', '0');
230 INSERT INTO `0_chart_master` VALUES ('1430', '', 'Goods Received Clearing account', '30', '0');
231 INSERT INTO `0_chart_master` VALUES ('2630', '', 'Accounts Payable', '30', '0');
232 INSERT INTO `0_chart_master` VALUES ('2660', '', 'VAT out 5', '30', '0');
233 INSERT INTO `0_chart_master` VALUES ('2662', '', 'VAT out 1', '30', '0');
234 INSERT INTO `0_chart_master` VALUES ('2664', '', 'VAT out 25', '30', '0');
235 INSERT INTO `0_chart_master` VALUES ('2680', '', 'VAT In 5', '30', '0');
236 INSERT INTO `0_chart_master` VALUES ('2682', '', 'VAT In 25', '30', '0');
237 INSERT INTO `0_chart_master` VALUES ('2050', '', 'Retained Earnings', '50', '0');
238 INSERT INTO `0_chart_master` VALUES ('2000', '', 'Share Capital', '50', '0');
241 ### Structure of table `0_chart_types` ###
243 DROP TABLE IF EXISTS `0_chart_types`;
245 CREATE TABLE `0_chart_types` (
246 `id` int(11) NOT NULL auto_increment,
247 `name` varchar(60) NOT NULL default '',
248 `class_id` tinyint(1) NOT NULL default '0',
249 `parent` int(11) NOT NULL default '-1',
252 ) TYPE=MyISAM AUTO_INCREMENT=53 AUTO_INCREMENT=53 ;
255 ### Data of table `0_chart_types` ###
257 INSERT INTO `0_chart_types` VALUES ('1', 'Sales', '3', '-1');
258 INSERT INTO `0_chart_types` VALUES ('2', 'Cost of Sales', '4', '-1');
259 INSERT INTO `0_chart_types` VALUES ('5', 'Expenses', '4', '-1');
260 INSERT INTO `0_chart_types` VALUES ('10', 'Cash/Bank', '1', '-1');
261 INSERT INTO `0_chart_types` VALUES ('20', 'Accounts Receivable', '1', '-1');
262 INSERT INTO `0_chart_types` VALUES ('30', 'Accounts Payable', '2', '-1');
263 INSERT INTO `0_chart_types` VALUES ('40', 'Fixed Assets', '1', '-1');
264 INSERT INTO `0_chart_types` VALUES ('45', 'Inventory', '1', '-1');
265 INSERT INTO `0_chart_types` VALUES ('50', 'Equity', '2', '-1');
266 INSERT INTO `0_chart_types` VALUES ('51', 'Depreciations', '4', '-1');
267 INSERT INTO `0_chart_types` VALUES ('52', 'Financials', '4', '-1');
270 ### Structure of table `0_comments` ###
272 DROP TABLE IF EXISTS `0_comments`;
274 CREATE TABLE `0_comments` (
275 `type` int(11) NOT NULL default '0',
276 `id` int(11) NOT NULL default '0',
277 `date_` date default '0000-00-00',
282 ### Data of table `0_comments` ###
286 ### Structure of table `0_company` ###
288 DROP TABLE IF EXISTS `0_company`;
290 CREATE TABLE `0_company` (
291 `coy_code` int(11) NOT NULL default '1',
292 `coy_name` varchar(60) NOT NULL default '',
293 `gst_no` varchar(25) NOT NULL default '',
294 `coy_no` varchar(25) NOT NULL default '0',
295 `tax_prd` int(11) NOT NULL default '1',
296 `tax_last` int(11) NOT NULL default '1',
297 `postal_address` tinytext NOT NULL,
298 `phone` varchar(30) NOT NULL default '',
299 `fax` varchar(30) NOT NULL default '',
300 `email` varchar(100) NOT NULL default '',
301 `coy_logo` varchar(100) NOT NULL default '',
302 `domicile` varchar(55) NOT NULL default '',
303 `curr_default` char(3) NOT NULL default '',
304 `debtors_act` varchar(11) NOT NULL default '',
305 `pyt_discount_act` varchar(11) NOT NULL default '',
306 `creditors_act` varchar(11) NOT NULL default '',
307 `grn_act` varchar(11) NOT NULL default '',
308 `exchange_diff_act` varchar(11) NOT NULL default '',
309 `purch_exchange_diff_act` varchar(11) NOT NULL default '',
310 `retained_earnings_act` varchar(11) NOT NULL default '',
311 `freight_act` varchar(11) NOT NULL default '',
312 `default_sales_act` varchar(11) NOT NULL default '',
313 `default_sales_discount_act` varchar(11) NOT NULL default '',
314 `default_prompt_payment_act` varchar(11) NOT NULL default '',
315 `default_inventory_act` varchar(11) NOT NULL default '',
316 `default_cogs_act` varchar(11) NOT NULL default '',
317 `default_adj_act` varchar(11) NOT NULL default '',
318 `default_inv_sales_act` varchar(11) NOT NULL default '',
319 `default_assembly_act` varchar(11) NOT NULL default '',
320 `payroll_act` varchar(11) NOT NULL default '',
321 `allow_negative_stock` tinyint(1) NOT NULL default '0',
322 `po_over_receive` int(11) NOT NULL default '10',
323 `po_over_charge` int(11) NOT NULL default '10',
324 `default_credit_limit` int(11) NOT NULL default '1000',
325 `default_workorder_required` int(11) NOT NULL default '20',
326 `default_dim_required` int(11) NOT NULL default '20',
327 `past_due_days` int(11) NOT NULL default '30',
328 `use_dimension` tinyint(1) default '0',
329 `f_year` int(11) NOT NULL default '1',
330 `no_item_list` tinyint(1) NOT NULL default '0',
331 `no_customer_list` tinyint(1) NOT NULL default '0',
332 `no_supplier_list` tinyint(1) NOT NULL default '0',
333 `base_sales` int(11) NOT NULL default '-1',
334 `foreign_codes` tinyint(1) NOT NULL default '0',
335 `accumulate_shipping` tinyint(1) NOT NULL default '0',
336 `legal_text` tinytext NOT NULL,
337 `default_delivery_required` smallint(6) NOT NULL default '1',
338 PRIMARY KEY (`coy_code`)
342 ### Data of table `0_company` ###
344 INSERT INTO `0_company` VALUES ('1', 'Company name', '', '', '1', '1', 'N/A', '', '', '', '', '', 'USD', '1500', '4250', '2630', '1430', '4260', '4220', '2050', '3800', '3000', '3000', '3200', '1420', '4010', '4210', '3000', '1410', '5000', '0', '10', '10', '1000', '20', '20', '30', '1', '1', '0', '0', '0', '-1', '0', '0', '', '1');
347 ### Structure of table `0_credit_status` ###
349 DROP TABLE IF EXISTS `0_credit_status`;
351 CREATE TABLE `0_credit_status` (
352 `id` int(11) NOT NULL auto_increment,
353 `reason_description` char(100) NOT NULL default '',
354 `dissallow_invoices` tinyint(1) NOT NULL default '0',
355 `inactive` tinyint(1) NOT NULL default '0',
357 UNIQUE KEY `reason_description` (`reason_description`)
358 ) TYPE=MyISAM AUTO_INCREMENT=5 AUTO_INCREMENT=5 ;
361 ### Data of table `0_credit_status` ###
363 INSERT INTO `0_credit_status` VALUES ('1', 'Good History', '0', '0');
364 INSERT INTO `0_credit_status` VALUES ('3', 'No more work until payment received', '1', '0');
365 INSERT INTO `0_credit_status` VALUES ('4', 'In liquidation', '1', '0');
368 ### Structure of table `0_currencies` ###
370 DROP TABLE IF EXISTS `0_currencies`;
372 CREATE TABLE `0_currencies` (
373 `currency` varchar(60) NOT NULL default '',
374 `curr_abrev` char(3) NOT NULL default '',
375 `curr_symbol` varchar(10) NOT NULL default '',
376 `country` varchar(100) NOT NULL default '',
377 `hundreds_name` varchar(15) NOT NULL default '',
378 `inactive` tinyint(1) NOT NULL default '0',
379 PRIMARY KEY (`curr_abrev`)
383 ### Data of table `0_currencies` ###
385 INSERT INTO `0_currencies` VALUES ('Euro', 'EUR', '?', 'Europe', 'Cents', '0');
386 INSERT INTO `0_currencies` VALUES ('Pounds', 'GBP', '?', 'England', 'Pence', '0');
387 INSERT INTO `0_currencies` VALUES ('US Dollars', 'USD', '$', 'United States', 'Cents', '0');
390 ### Structure of table `0_cust_allocations` ###
392 DROP TABLE IF EXISTS `0_cust_allocations`;
394 CREATE TABLE `0_cust_allocations` (
395 `id` int(11) NOT NULL auto_increment,
396 `amt` double unsigned default NULL,
397 `date_alloc` date NOT NULL default '0000-00-00',
398 `trans_no_from` int(11) default NULL,
399 `trans_type_from` int(11) default NULL,
400 `trans_no_to` int(11) default NULL,
401 `trans_type_to` int(11) default NULL,
403 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
406 ### Data of table `0_cust_allocations` ###
410 ### Structure of table `0_cust_branch` ###
412 DROP TABLE IF EXISTS `0_cust_branch`;
414 CREATE TABLE `0_cust_branch` (
415 `branch_code` int(11) NOT NULL auto_increment,
416 `debtor_no` int(11) NOT NULL default '0',
417 `br_name` varchar(60) NOT NULL default '',
418 `br_address` tinytext NOT NULL,
419 `area` int(11) default NULL,
420 `salesman` int(11) NOT NULL default '0',
421 `phone` varchar(30) NOT NULL default '',
422 `fax` varchar(30) NOT NULL default '',
423 `contact_name` varchar(60) NOT NULL default '',
424 `email` varchar(100) NOT NULL default '',
425 `default_location` varchar(5) NOT NULL default '',
426 `tax_group_id` int(11) default NULL,
427 `sales_account` varchar(11) default NULL,
428 `sales_discount_account` varchar(11) default NULL,
429 `receivables_account` varchar(11) default NULL,
430 `payment_discount_account` varchar(11) default NULL,
431 `default_ship_via` int(11) NOT NULL default '1',
432 `disable_trans` tinyint(4) NOT NULL default '0',
433 `br_post_address` tinytext NOT NULL,
434 `group_no` int(11) NOT NULL default '0',
435 PRIMARY KEY (`branch_code`,`debtor_no`),
436 KEY `branch_code` (`branch_code`),
437 KEY `br_name` (`br_name`)
438 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
441 ### Data of table `0_cust_branch` ###
445 ### Structure of table `0_debtor_trans` ###
447 DROP TABLE IF EXISTS `0_debtor_trans`;
449 CREATE TABLE `0_debtor_trans` (
450 `trans_no` int(11) unsigned NOT NULL default '0',
451 `type` smallint(6) unsigned NOT NULL default '0',
452 `version` tinyint(1) unsigned NOT NULL default '0',
453 `debtor_no` int(11) unsigned default NULL,
454 `branch_code` int(11) NOT NULL default '-1',
455 `tran_date` date NOT NULL default '0000-00-00',
456 `due_date` date NOT NULL default '0000-00-00',
457 `reference` varchar(60) NOT NULL default '',
458 `tpe` int(11) NOT NULL default '0',
459 `order_` int(11) NOT NULL default '0',
460 `ov_amount` double NOT NULL default '0',
461 `ov_gst` double NOT NULL default '0',
462 `ov_freight` double NOT NULL default '0',
463 `ov_freight_tax` double NOT NULL default '0',
464 `ov_discount` double NOT NULL default '0',
465 `alloc` double NOT NULL default '0',
466 `rate` double NOT NULL default '1',
467 `ship_via` int(11) default NULL,
468 `trans_link` int(11) NOT NULL default '0',
469 `dimension_id` int(11) NOT NULL default '0',
470 `dimension2_id` int(11) NOT NULL default '0',
471 PRIMARY KEY (`trans_no`,`type`),
472 KEY `debtor_no` (`debtor_no`,`branch_code`)
476 ### Data of table `0_debtor_trans` ###
480 ### Structure of table `0_debtor_trans_details` ###
482 DROP TABLE IF EXISTS `0_debtor_trans_details`;
484 CREATE TABLE `0_debtor_trans_details` (
485 `id` int(11) NOT NULL auto_increment,
486 `debtor_trans_no` int(11) default NULL,
487 `debtor_trans_type` int(11) default NULL,
488 `stock_id` varchar(20) NOT NULL default '',
489 `description` tinytext,
490 `unit_price` double NOT NULL default '0',
491 `unit_tax` double NOT NULL default '0',
492 `quantity` double NOT NULL default '0',
493 `discount_percent` double NOT NULL default '0',
494 `standard_cost` double NOT NULL default '0',
495 `qty_done` double NOT NULL default '0',
497 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
500 ### Data of table `0_debtor_trans_details` ###
504 ### Structure of table `0_debtors_master` ###
506 DROP TABLE IF EXISTS `0_debtors_master`;
508 CREATE TABLE `0_debtors_master` (
509 `debtor_no` int(11) NOT NULL auto_increment,
510 `name` varchar(60) NOT NULL default '',
512 `email` varchar(100) NOT NULL default '',
513 `tax_id` varchar(55) NOT NULL default '',
514 `curr_code` char(3) NOT NULL default '',
515 `sales_type` int(11) NOT NULL default '1',
516 `dimension_id` int(11) NOT NULL default '0',
517 `dimension2_id` int(11) NOT NULL default '0',
518 `credit_status` int(11) NOT NULL default '0',
519 `payment_terms` int(11) default NULL,
520 `discount` double NOT NULL default '0',
521 `pymt_discount` double NOT NULL default '0',
522 `credit_limit` float NOT NULL default '1000',
523 `inactive` tinyint(1) NOT NULL default '0',
524 PRIMARY KEY (`debtor_no`),
525 UNIQUE KEY `name` (`name`)
526 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
529 ### Data of table `0_debtors_master` ###
533 ### Structure of table `0_dimensions` ###
535 DROP TABLE IF EXISTS `0_dimensions`;
537 CREATE TABLE `0_dimensions` (
538 `id` int(11) NOT NULL auto_increment,
539 `reference` varchar(60) NOT NULL default '',
540 `name` varchar(60) NOT NULL default '',
541 `type_` tinyint(1) NOT NULL default '1',
542 `closed` tinyint(1) NOT NULL default '0',
543 `date_` date NOT NULL default '0000-00-00',
544 `due_date` date NOT NULL default '0000-00-00',
546 UNIQUE KEY `reference` (`reference`)
547 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
550 ### Data of table `0_dimensions` ###
554 ### Structure of table `0_exchange_rates` ###
556 DROP TABLE IF EXISTS `0_exchange_rates`;
558 CREATE TABLE `0_exchange_rates` (
559 `id` int(11) NOT NULL auto_increment,
560 `curr_code` char(3) NOT NULL default '',
561 `rate_buy` double NOT NULL default '0',
562 `rate_sell` double NOT NULL default '0',
563 `date_` date NOT NULL default '0000-00-00',
565 UNIQUE KEY `curr_code` (`curr_code`,`date_`)
566 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
569 ### Data of table `0_exchange_rates` ###
573 ### Structure of table `0_fiscal_year` ###
575 DROP TABLE IF EXISTS `0_fiscal_year`;
577 CREATE TABLE `0_fiscal_year` (
578 `id` int(11) NOT NULL auto_increment,
579 `begin` date default '0000-00-00',
580 `end` date default '0000-00-00',
581 `closed` tinyint(1) NOT NULL default '0',
583 ) TYPE=InnoDB AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
586 ### Data of table `0_fiscal_year` ###
588 INSERT INTO `0_fiscal_year` VALUES ('1', '2008-01-01', '2008-12-31', '0');
591 ### Structure of table `0_gl_trans` ###
593 DROP TABLE IF EXISTS `0_gl_trans`;
595 CREATE TABLE `0_gl_trans` (
596 `counter` int(11) NOT NULL auto_increment,
597 `type` smallint(6) NOT NULL default '0',
598 `type_no` bigint(16) NOT NULL default '1',
599 `tran_date` date NOT NULL default '0000-00-00',
600 `account` varchar(11) NOT NULL default '',
601 `memo_` tinytext NOT NULL,
602 `amount` double NOT NULL default '0',
603 `dimension_id` int(11) NOT NULL default '0',
604 `dimension2_id` int(11) NOT NULL default '0',
605 `person_type_id` int(11) default NULL,
606 `person_id` tinyblob,
607 PRIMARY KEY (`counter`),
608 KEY `Type_and_Number` (`type`,`type_no`)
609 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
612 ### Data of table `0_gl_trans` ###
616 ### Structure of table `0_grn_batch` ###
618 DROP TABLE IF EXISTS `0_grn_batch`;
620 CREATE TABLE `0_grn_batch` (
621 `id` int(11) NOT NULL auto_increment,
622 `supplier_id` int(11) NOT NULL default '0',
623 `purch_order_no` int(11) default NULL,
624 `reference` varchar(60) NOT NULL default '',
625 `delivery_date` date NOT NULL default '0000-00-00',
626 `loc_code` varchar(5) default NULL,
628 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
631 ### Data of table `0_grn_batch` ###
635 ### Structure of table `0_grn_items` ###
637 DROP TABLE IF EXISTS `0_grn_items`;
639 CREATE TABLE `0_grn_items` (
640 `id` int(11) NOT NULL auto_increment,
641 `grn_batch_id` int(11) default NULL,
642 `po_detail_item` int(11) NOT NULL default '0',
643 `item_code` varchar(20) NOT NULL default '',
644 `description` tinytext,
645 `qty_recd` double NOT NULL default '0',
646 `quantity_inv` double NOT NULL default '0',
648 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
651 ### Data of table `0_grn_items` ###
655 ### Structure of table `0_groups` ###
657 DROP TABLE IF EXISTS `0_groups`;
659 CREATE TABLE `0_groups` (
660 `id` smallint(6) unsigned NOT NULL auto_increment,
661 `description` varchar(60) NOT NULL default '',
662 `inactive` tinyint(1) NOT NULL default '0',
664 UNIQUE KEY `description` (`description`)
665 ) TYPE=MyISAM AUTO_INCREMENT=4 AUTO_INCREMENT=4 ;
668 ### Data of table `0_groups` ###
670 INSERT INTO `0_groups` VALUES ('1', 'Small', '0');
671 INSERT INTO `0_groups` VALUES ('2', 'Medium', '0');
672 INSERT INTO `0_groups` VALUES ('3', 'Large', '0');
675 ### Structure of table `0_item_codes` ###
677 DROP TABLE IF EXISTS `0_item_codes`;
679 CREATE TABLE `0_item_codes` (
680 `id` int(11) unsigned NOT NULL auto_increment,
681 `item_code` varchar(20) NOT NULL,
682 `stock_id` varchar(20) NOT NULL,
683 `description` varchar(200) NOT NULL default '',
684 `category_id` smallint(6) unsigned NOT NULL,
685 `quantity` double NOT NULL default '1',
686 `is_foreign` tinyint(1) NOT NULL default '0',
687 `inactive` tinyint(1) NOT NULL default '0',
689 UNIQUE KEY `stock_id` (`stock_id`,`item_code`)
690 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
693 ### Data of table `0_item_codes` ###
697 ### Structure of table `0_item_tax_type_exemptions` ###
699 DROP TABLE IF EXISTS `0_item_tax_type_exemptions`;
701 CREATE TABLE `0_item_tax_type_exemptions` (
702 `item_tax_type_id` int(11) NOT NULL default '0',
703 `tax_type_id` int(11) NOT NULL default '0',
704 PRIMARY KEY (`item_tax_type_id`,`tax_type_id`)
708 ### Data of table `0_item_tax_type_exemptions` ###
712 ### Structure of table `0_item_tax_types` ###
714 DROP TABLE IF EXISTS `0_item_tax_types`;
716 CREATE TABLE `0_item_tax_types` (
717 `id` int(11) NOT NULL auto_increment,
718 `name` varchar(60) NOT NULL default '',
719 `exempt` tinyint(1) NOT NULL default '0',
721 UNIQUE KEY `name` (`name`)
722 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
725 ### Data of table `0_item_tax_types` ###
729 ### Structure of table `0_item_units` ###
731 DROP TABLE IF EXISTS `0_item_units`;
733 CREATE TABLE `0_item_units` (
734 `abbr` varchar(20) NOT NULL,
735 `name` varchar(40) NOT NULL,
736 `decimals` tinyint(2) NOT NULL,
737 `inactive` tinyint(1) NOT NULL default '0',
738 PRIMARY KEY (`abbr`),
739 UNIQUE KEY `name` (`name`)
743 ### Data of table `0_item_units` ###
745 INSERT INTO `0_item_units` VALUES ('ea.', 'Each', '0', '0');
748 ### Structure of table `0_loc_stock` ###
750 DROP TABLE IF EXISTS `0_loc_stock`;
752 CREATE TABLE `0_loc_stock` (
753 `loc_code` char(5) NOT NULL default '',
754 `stock_id` char(20) NOT NULL default '',
755 `reorder_level` bigint(20) NOT NULL default '0',
756 PRIMARY KEY (`loc_code`,`stock_id`),
757 KEY `stock_id` (`stock_id`)
761 ### Data of table `0_loc_stock` ###
765 ### Structure of table `0_locations` ###
767 DROP TABLE IF EXISTS `0_locations`;
769 CREATE TABLE `0_locations` (
770 `loc_code` varchar(5) NOT NULL default '',
771 `location_name` varchar(60) NOT NULL default '',
772 `delivery_address` tinytext NOT NULL,
773 `phone` varchar(30) NOT NULL default '',
774 `fax` varchar(30) NOT NULL default '',
775 `email` varchar(100) NOT NULL default '',
776 `contact` varchar(30) NOT NULL default '',
777 `inactive` tinyint(1) NOT NULL default '0',
778 PRIMARY KEY (`loc_code`)
782 ### Data of table `0_locations` ###
784 INSERT INTO `0_locations` VALUES ('DEF', 'Default', 'N/A', '', '', '', '', '0');
787 ### Structure of table `0_movement_types` ###
789 DROP TABLE IF EXISTS `0_movement_types`;
791 CREATE TABLE `0_movement_types` (
792 `id` int(11) NOT NULL auto_increment,
793 `name` varchar(60) NOT NULL default '',
795 UNIQUE KEY `name` (`name`)
796 ) TYPE=MyISAM AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
799 ### Data of table `0_movement_types` ###
801 INSERT INTO `0_movement_types` VALUES ('1', 'Adjustment');
804 ### Structure of table `0_payment_terms` ###
806 DROP TABLE IF EXISTS `0_payment_terms`;
808 CREATE TABLE `0_payment_terms` (
809 `terms_indicator` int(11) NOT NULL auto_increment,
810 `terms` char(80) NOT NULL default '',
811 `days_before_due` smallint(6) NOT NULL default '0',
812 `day_in_following_month` smallint(6) NOT NULL default '0',
813 `inactive` tinyint(1) NOT NULL default '0',
814 PRIMARY KEY (`terms_indicator`),
815 UNIQUE KEY `terms` (`terms`)
816 ) TYPE=MyISAM AUTO_INCREMENT=5 AUTO_INCREMENT=5 ;
819 ### Data of table `0_payment_terms` ###
821 INSERT INTO `0_payment_terms` VALUES ('1', 'Due 15th Of the Following Month', '0', '17', '0');
822 INSERT INTO `0_payment_terms` VALUES ('2', 'Due By End Of The Following Month', '0', '30', '0');
823 INSERT INTO `0_payment_terms` VALUES ('3', 'Payment due within 10 days', '10', '0', '0');
824 INSERT INTO `0_payment_terms` VALUES ('4', 'Cash Only', '1', '0', '0');
827 ### Structure of table `0_prices` ###
829 DROP TABLE IF EXISTS `0_prices`;
831 CREATE TABLE `0_prices` (
832 `id` int(11) NOT NULL auto_increment,
833 `stock_id` varchar(20) NOT NULL default '',
834 `sales_type_id` int(11) NOT NULL default '0',
835 `curr_abrev` char(3) NOT NULL default '',
836 `price` double NOT NULL default '0',
838 UNIQUE KEY `price` (`stock_id`,`sales_type_id`,`curr_abrev`)
839 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
842 ### Data of table `0_prices` ###
846 ### Structure of table `0_print_profiles` ###
848 DROP TABLE IF EXISTS `0_print_profiles`;
850 CREATE TABLE `0_print_profiles` (
851 `id` smallint(6) unsigned NOT NULL auto_increment,
852 `profile` varchar(30) NOT NULL,
853 `report` varchar(5) default NULL,
854 `printer` tinyint(3) unsigned default NULL,
856 UNIQUE KEY `profile` (`profile`,`report`)
857 ) TYPE=MyISAM AUTO_INCREMENT=10 AUTO_INCREMENT=10 ;
860 ### Data of table `0_print_profiles` ###
862 INSERT INTO `0_print_profiles` VALUES ('1', 'Out of office', '', '0');
863 INSERT INTO `0_print_profiles` VALUES ('2', 'Sales Department', '', '0');
864 INSERT INTO `0_print_profiles` VALUES ('3', 'Central', '', '2');
865 INSERT INTO `0_print_profiles` VALUES ('4', 'Sales Department', '104', '2');
866 INSERT INTO `0_print_profiles` VALUES ('5', 'Sales Department', '105', '2');
867 INSERT INTO `0_print_profiles` VALUES ('6', 'Sales Department', '107', '2');
868 INSERT INTO `0_print_profiles` VALUES ('7', 'Sales Department', '109', '2');
869 INSERT INTO `0_print_profiles` VALUES ('8', 'Sales Department', '110', '2');
870 INSERT INTO `0_print_profiles` VALUES ('9', 'Sales Department', '201', '2');
873 ### Structure of table `0_printers` ###
875 DROP TABLE IF EXISTS `0_printers`;
877 CREATE TABLE `0_printers` (
878 `id` tinyint(3) unsigned NOT NULL auto_increment,
879 `name` varchar(20) NOT NULL,
880 `description` varchar(60) NOT NULL,
881 `queue` varchar(20) NOT NULL,
882 `host` varchar(40) NOT NULL,
883 `port` smallint(11) unsigned NOT NULL,
884 `timeout` tinyint(3) unsigned NOT NULL,
886 UNIQUE KEY `name` (`name`)
887 ) TYPE=MyISAM AUTO_INCREMENT=4 AUTO_INCREMENT=4 ;
890 ### Data of table `0_printers` ###
892 INSERT INTO `0_printers` VALUES ('1', 'QL500', 'Label printer', 'QL500', 'server', '127', '20');
893 INSERT INTO `0_printers` VALUES ('2', 'Samsung', 'Main network printer', 'scx4521F', 'server', '515', '5');
894 INSERT INTO `0_printers` VALUES ('3', 'Local', 'Local print server at user IP', 'lp', '', '515', '10');
897 ### Structure of table `0_purch_data` ###
899 DROP TABLE IF EXISTS `0_purch_data`;
901 CREATE TABLE `0_purch_data` (
902 `supplier_id` int(11) NOT NULL default '0',
903 `stock_id` char(20) NOT NULL default '',
904 `price` double NOT NULL default '0',
905 `suppliers_uom` char(50) NOT NULL default '',
906 `conversion_factor` double NOT NULL default '1',
907 `supplier_description` char(50) NOT NULL default '',
908 PRIMARY KEY (`supplier_id`,`stock_id`)
912 ### Data of table `0_purch_data` ###
916 ### Structure of table `0_purch_order_details` ###
918 DROP TABLE IF EXISTS `0_purch_order_details`;
920 CREATE TABLE `0_purch_order_details` (
921 `po_detail_item` int(11) NOT NULL auto_increment,
922 `order_no` int(11) NOT NULL default '0',
923 `item_code` varchar(20) NOT NULL default '',
924 `description` tinytext,
925 `delivery_date` date NOT NULL default '0000-00-00',
926 `qty_invoiced` double NOT NULL default '0',
927 `unit_price` double NOT NULL default '0',
928 `act_price` double NOT NULL default '0',
929 `std_cost_unit` double NOT NULL default '0',
930 `quantity_ordered` double NOT NULL default '0',
931 `quantity_received` double NOT NULL default '0',
932 PRIMARY KEY (`po_detail_item`)
933 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
936 ### Data of table `0_purch_order_details` ###
940 ### Structure of table `0_purch_orders` ###
942 DROP TABLE IF EXISTS `0_purch_orders`;
944 CREATE TABLE `0_purch_orders` (
945 `order_no` int(11) NOT NULL auto_increment,
946 `supplier_id` int(11) NOT NULL default '0',
948 `ord_date` date NOT NULL default '0000-00-00',
949 `reference` tinytext NOT NULL,
950 `requisition_no` tinytext,
951 `into_stock_location` varchar(5) NOT NULL default '',
952 `delivery_address` tinytext NOT NULL,
953 PRIMARY KEY (`order_no`)
954 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
957 ### Data of table `0_purch_orders` ###
961 ### Structure of table `0_quick_entries` ###
963 DROP TABLE IF EXISTS `0_quick_entries`;
965 CREATE TABLE `0_quick_entries` (
966 `id` smallint(6) unsigned NOT NULL auto_increment,
967 `type` tinyint(1) NOT NULL default '0',
968 `description` varchar(60) NOT NULL,
969 `base_amount` double NOT NULL default '0',
970 `base_desc` varchar(60) default NULL,
972 KEY `description` (`description`)
973 ) TYPE=MyISAM AUTO_INCREMENT=4 AUTO_INCREMENT=4 ;
976 ### Data of table `0_quick_entries` ###
978 INSERT INTO `0_quick_entries` VALUES ('1', '1', 'Maintenance', '0', 'Amount');
979 INSERT INTO `0_quick_entries` VALUES ('2', '1', 'Phone', '0', 'Amount');
980 INSERT INTO `0_quick_entries` VALUES ('3', '2', 'Cash Sales', '0', 'Amount');
983 ### Structure of table `0_quick_entry_lines` ###
985 DROP TABLE IF EXISTS `0_quick_entry_lines`;
987 CREATE TABLE `0_quick_entry_lines` (
988 `id` smallint(6) unsigned NOT NULL auto_increment,
989 `qid` smallint(6) unsigned NOT NULL,
990 `amount` double default '0',
991 `action` varchar(2) NOT NULL,
992 `dest_id` varchar(11) NOT NULL,
993 `dimension_id` smallint(6) unsigned default NULL,
994 `dimension2_id` smallint(6) unsigned default NULL,
997 ) TYPE=MyISAM AUTO_INCREMENT=4 AUTO_INCREMENT=4 ;
1000 ### Data of table `0_quick_entry_lines` ###
1002 INSERT INTO `0_quick_entry_lines` VALUES ('1', '1', '0', '=', '6600', '0', '0');
1003 INSERT INTO `0_quick_entry_lines` VALUES ('2', '2', '0', '=', '6730', '0', '0');
1004 INSERT INTO `0_quick_entry_lines` VALUES ('3', '3', '0', '=', '3000', '0', '0');
1007 ### Structure of table `0_recurrent_invoices` ###
1009 DROP TABLE IF EXISTS `0_recurrent_invoices`;
1011 CREATE TABLE `0_recurrent_invoices` (
1012 `id` smallint(6) unsigned NOT NULL auto_increment,
1013 `description` varchar(60) NOT NULL default '',
1014 `order_no` int(11) unsigned NOT NULL,
1015 `debtor_no` int(11) unsigned default NULL,
1016 `group_no` smallint(6) unsigned default NULL,
1017 `days` int(11) NOT NULL default '0',
1018 `monthly` int(11) NOT NULL default '0',
1019 `begin` date NOT NULL default '0000-00-00',
1020 `end` date NOT NULL default '0000-00-00',
1021 `last_sent` date NOT NULL default '0000-00-00',
1023 UNIQUE KEY `description` (`description`)
1024 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1027 ### Data of table `0_recurrent_invoices` ###
1031 ### Structure of table `0_refs` ###
1033 DROP TABLE IF EXISTS `0_refs`;
1035 CREATE TABLE `0_refs` (
1036 `id` int(11) NOT NULL default '0',
1037 `type` int(11) NOT NULL default '0',
1038 `reference` varchar(100) NOT NULL default '',
1039 PRIMARY KEY (`id`,`type`)
1043 ### Data of table `0_refs` ###
1047 ### Structure of table `0_sales_order_details` ###
1049 DROP TABLE IF EXISTS `0_sales_order_details`;
1051 CREATE TABLE `0_sales_order_details` (
1052 `id` int(11) NOT NULL auto_increment,
1053 `order_no` int(11) NOT NULL default '0',
1054 `stk_code` varchar(20) NOT NULL default '',
1055 `description` tinytext,
1056 `qty_sent` double NOT NULL default '0',
1057 `unit_price` double NOT NULL default '0',
1058 `quantity` double NOT NULL default '0',
1059 `discount_percent` double NOT NULL default '0',
1061 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1064 ### Data of table `0_sales_order_details` ###
1068 ### Structure of table `0_sales_orders` ###
1070 DROP TABLE IF EXISTS `0_sales_orders`;
1072 CREATE TABLE `0_sales_orders` (
1073 `order_no` int(11) NOT NULL auto_increment,
1074 `version` tinyint(1) unsigned NOT NULL default '0',
1075 `type` tinyint(1) NOT NULL default '0',
1076 `debtor_no` int(11) NOT NULL default '0',
1077 `branch_code` int(11) NOT NULL default '0',
1078 `customer_ref` tinytext NOT NULL,
1079 `comments` tinytext,
1080 `ord_date` date NOT NULL default '0000-00-00',
1081 `order_type` int(11) NOT NULL default '0',
1082 `ship_via` int(11) NOT NULL default '0',
1083 `delivery_address` tinytext NOT NULL,
1084 `contact_phone` varchar(30) default NULL,
1085 `contact_email` varchar(100) default NULL,
1086 `deliver_to` tinytext NOT NULL,
1087 `freight_cost` double NOT NULL default '0',
1088 `from_stk_loc` varchar(5) NOT NULL default '',
1089 `delivery_date` date NOT NULL default '0000-00-00',
1090 PRIMARY KEY (`order_no`)
1091 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1094 ### Data of table `0_sales_orders` ###
1098 ### Structure of table `0_sales_pos` ###
1100 DROP TABLE IF EXISTS `0_sales_pos`;
1102 CREATE TABLE `0_sales_pos` (
1103 `id` smallint(6) unsigned NOT NULL auto_increment,
1104 `pos_name` varchar(30) NOT NULL,
1105 `cash_sale` tinyint(1) NOT NULL,
1106 `credit_sale` tinyint(1) NOT NULL,
1107 `pos_location` varchar(5) NOT NULL,
1108 `pos_account` smallint(6) unsigned NOT NULL,
1109 `inactive` tinyint(1) NOT NULL default '0',
1111 UNIQUE KEY `pos_name` (`pos_name`)
1112 ) TYPE=MyISAM AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
1115 ### Data of table `0_sales_pos` ###
1117 INSERT INTO `0_sales_pos` VALUES ('1', 'Default', '1', '1', 'DEF', '1', '0');
1120 ### Structure of table `0_sales_types` ###
1122 DROP TABLE IF EXISTS `0_sales_types`;
1124 CREATE TABLE `0_sales_types` (
1125 `id` int(11) NOT NULL auto_increment,
1126 `sales_type` char(50) NOT NULL default '',
1127 `tax_included` int(1) NOT NULL default '0',
1128 `factor` double NOT NULL default '1',
1129 `inactive` tinyint(1) NOT NULL default '0',
1131 UNIQUE KEY `sales_type` (`sales_type`)
1132 ) TYPE=MyISAM AUTO_INCREMENT=3 AUTO_INCREMENT=3 ;
1135 ### Data of table `0_sales_types` ###
1137 INSERT INTO `0_sales_types` VALUES ('1', 'Retail', '0', '1', '0');
1138 INSERT INTO `0_sales_types` VALUES ('2', 'Wholesale', '0', '1', '0');
1141 ### Structure of table `0_salesman` ###
1143 DROP TABLE IF EXISTS `0_salesman`;
1145 CREATE TABLE `0_salesman` (
1146 `salesman_code` int(11) NOT NULL auto_increment,
1147 `salesman_name` char(60) NOT NULL default '',
1148 `salesman_phone` char(30) NOT NULL default '',
1149 `salesman_fax` char(30) NOT NULL default '',
1150 `salesman_email` varchar(100) NOT NULL default '',
1151 `provision` double NOT NULL default '0',
1152 `break_pt` double NOT NULL default '0',
1153 `provision2` double NOT NULL default '0',
1154 `inactive` tinyint(1) NOT NULL default '0',
1155 PRIMARY KEY (`salesman_code`),
1156 UNIQUE KEY `salesman_name` (`salesman_name`)
1157 ) TYPE=MyISAM AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
1160 ### Data of table `0_salesman` ###
1162 INSERT INTO `0_salesman` VALUES ('1', 'Sales Person', '', '', '', '5', '1000', '4', '0');
1165 ### Structure of table `0_shippers` ###
1167 DROP TABLE IF EXISTS `0_shippers`;
1169 CREATE TABLE `0_shippers` (
1170 `shipper_id` int(11) NOT NULL auto_increment,
1171 `shipper_name` varchar(60) NOT NULL default '',
1172 `phone` varchar(30) NOT NULL default '',
1173 `contact` tinytext NOT NULL,
1174 `address` tinytext NOT NULL,
1175 `inactive` tinyint(1) NOT NULL default '0',
1176 PRIMARY KEY (`shipper_id`),
1177 UNIQUE KEY `name` (`shipper_name`)
1178 ) TYPE=MyISAM AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
1181 ### Data of table `0_shippers` ###
1183 INSERT INTO `0_shippers` VALUES ('1', 'Default', '', '', '', '0');
1186 ### Structure of table `0_sql_trail` ###
1188 DROP TABLE IF EXISTS `0_sql_trail`;
1190 CREATE TABLE `0_sql_trail` (
1191 `id` int(11) unsigned NOT NULL auto_increment,
1192 `sql` text NOT NULL,
1193 `result` tinyint(1) NOT NULL,
1194 `msg` varchar(255) NOT NULL,
1196 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
1199 ### Data of table `0_sql_trail` ###
1203 ### Structure of table `0_stock_category` ###
1205 DROP TABLE IF EXISTS `0_stock_category`;
1207 CREATE TABLE `0_stock_category` (
1208 `category_id` int(11) NOT NULL auto_increment,
1209 `description` varchar(60) NOT NULL default '',
1210 `stock_act` varchar(11) default NULL,
1211 `cogs_act` varchar(11) default NULL,
1212 `adj_gl_act` varchar(11) default NULL,
1213 `purch_price_var_act` varchar(11) default NULL,
1214 `inactive` tinyint(1) NOT NULL default '0',
1215 PRIMARY KEY (`category_id`),
1216 UNIQUE KEY `description` (`description`)
1217 ) TYPE=MyISAM AUTO_INCREMENT=5 AUTO_INCREMENT=5 ;
1220 ### Data of table `0_stock_category` ###
1222 INSERT INTO `0_stock_category` VALUES ('1', 'Components', '', '', '', '', '0');
1223 INSERT INTO `0_stock_category` VALUES ('2', 'Charges', '', '', '', '', '0');
1224 INSERT INTO `0_stock_category` VALUES ('3', 'Systems', '', '', '', '', '0');
1225 INSERT INTO `0_stock_category` VALUES ('4', 'Services', '', '', '', '', '0');
1228 ### Structure of table `0_stock_master` ###
1230 DROP TABLE IF EXISTS `0_stock_master`;
1232 CREATE TABLE `0_stock_master` (
1233 `stock_id` varchar(20) NOT NULL default '',
1234 `category_id` int(11) NOT NULL default '0',
1235 `tax_type_id` int(11) NOT NULL default '0',
1236 `description` varchar(200) NOT NULL default '',
1237 `long_description` tinytext NOT NULL,
1238 `units` varchar(20) NOT NULL default 'each',
1239 `mb_flag` char(1) NOT NULL default 'B',
1240 `sales_account` varchar(11) NOT NULL default '',
1241 `cogs_account` varchar(11) NOT NULL default '',
1242 `inventory_account` varchar(11) NOT NULL default '',
1243 `adjustment_account` varchar(11) NOT NULL default '',
1244 `assembly_account` varchar(11) NOT NULL default '',
1245 `dimension_id` int(11) default NULL,
1246 `dimension2_id` int(11) default NULL,
1247 `actual_cost` double NOT NULL default '0',
1248 `last_cost` double NOT NULL default '0',
1249 `material_cost` double NOT NULL default '0',
1250 `labour_cost` double NOT NULL default '0',
1251 `overhead_cost` double NOT NULL default '0',
1252 `inactive` tinyint(1) NOT NULL default '0',
1253 PRIMARY KEY (`stock_id`)
1257 ### Data of table `0_stock_master` ###
1261 ### Structure of table `0_stock_moves` ###
1263 DROP TABLE IF EXISTS `0_stock_moves`;
1265 CREATE TABLE `0_stock_moves` (
1266 `trans_id` int(11) NOT NULL auto_increment,
1267 `trans_no` int(11) NOT NULL default '0',
1268 `stock_id` char(20) NOT NULL default '',
1269 `type` smallint(6) NOT NULL default '0',
1270 `loc_code` char(5) NOT NULL default '',
1271 `tran_date` date NOT NULL default '0000-00-00',
1272 `person_id` int(11) default NULL,
1273 `price` double NOT NULL default '0',
1274 `reference` char(40) NOT NULL default '',
1275 `qty` double NOT NULL default '1',
1276 `discount_percent` double NOT NULL default '0',
1277 `standard_cost` double NOT NULL default '0',
1278 `visible` tinyint(1) NOT NULL default '1',
1279 PRIMARY KEY (`trans_id`),
1280 KEY `type` (`type`,`trans_no`)
1281 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1284 ### Data of table `0_stock_moves` ###
1288 ### Structure of table `0_supp_allocations` ###
1290 DROP TABLE IF EXISTS `0_supp_allocations`;
1292 CREATE TABLE `0_supp_allocations` (
1293 `id` int(11) NOT NULL auto_increment,
1294 `amt` double unsigned default NULL,
1295 `date_alloc` date NOT NULL default '0000-00-00',
1296 `trans_no_from` int(11) default NULL,
1297 `trans_type_from` int(11) default NULL,
1298 `trans_no_to` int(11) default NULL,
1299 `trans_type_to` int(11) default NULL,
1301 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1304 ### Data of table `0_supp_allocations` ###
1308 ### Structure of table `0_supp_invoice_items` ###
1310 DROP TABLE IF EXISTS `0_supp_invoice_items`;
1312 CREATE TABLE `0_supp_invoice_items` (
1313 `id` int(11) NOT NULL auto_increment,
1314 `supp_trans_no` int(11) default NULL,
1315 `supp_trans_type` int(11) default NULL,
1316 `gl_code` varchar(11) NOT NULL default '0',
1317 `grn_item_id` int(11) default NULL,
1318 `po_detail_item_id` int(11) default NULL,
1319 `stock_id` varchar(20) NOT NULL default '',
1320 `description` tinytext,
1321 `quantity` double NOT NULL default '0',
1322 `unit_price` double NOT NULL default '0',
1323 `unit_tax` double NOT NULL default '0',
1326 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1329 ### Data of table `0_supp_invoice_items` ###
1333 ### Structure of table `0_supp_trans` ###
1335 DROP TABLE IF EXISTS `0_supp_trans`;
1337 CREATE TABLE `0_supp_trans` (
1338 `trans_no` int(11) unsigned NOT NULL default '0',
1339 `type` smallint(6) unsigned NOT NULL default '0',
1340 `supplier_id` int(11) unsigned default NULL,
1341 `reference` tinytext NOT NULL,
1342 `supp_reference` varchar(60) NOT NULL default '',
1343 `tran_date` date NOT NULL default '0000-00-00',
1344 `due_date` date NOT NULL default '0000-00-00',
1345 `ov_amount` double NOT NULL default '0',
1346 `ov_discount` double NOT NULL default '0',
1347 `ov_gst` double NOT NULL default '0',
1348 `rate` double NOT NULL default '1',
1349 `alloc` double NOT NULL default '0',
1350 PRIMARY KEY (`trans_no`,`type`),
1351 KEY `supplier_id` (`supplier_id`),
1352 KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
1357 ### Data of table `0_supp_trans` ###
1361 ### Structure of table `0_suppliers` ###
1363 DROP TABLE IF EXISTS `0_suppliers`;
1365 CREATE TABLE `0_suppliers` (
1366 `supplier_id` int(11) NOT NULL auto_increment,
1367 `supp_name` varchar(60) NOT NULL default '',
1368 `address` tinytext NOT NULL,
1369 `supp_address` tinytext NOT NULL,
1370 `phone` varchar(30) NOT NULL default '',
1371 `fax` varchar(30) NOT NULL default '',
1372 `gst_no` varchar(25) NOT NULL default '',
1373 `contact` varchar(60) NOT NULL default '',
1374 `supp_account_no` varchar(40) NOT NULL default '',
1375 `email` varchar(100) NOT NULL default '',
1376 `website` varchar(100) NOT NULL default '',
1377 `bank_account` varchar(60) NOT NULL default '',
1378 `curr_code` char(3) default NULL,
1379 `payment_terms` int(11) default NULL,
1380 `dimension_id` int(11) default '0',
1381 `dimension2_id` int(11) default '0',
1382 `tax_group_id` int(11) default NULL,
1383 `credit_limit` double NOT NULL default '0',
1384 `purchase_account` varchar(11) default NULL,
1385 `payable_account` varchar(11) default NULL,
1386 `payment_discount_account` varchar(11) default NULL,
1387 `notes` tinytext NOT NULL,
1388 `inactive` tinyint(1) NOT NULL default '0',
1389 PRIMARY KEY (`supplier_id`)
1390 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
1393 ### Data of table `0_suppliers` ###
1397 ### Structure of table `0_sys_types` ###
1399 DROP TABLE IF EXISTS `0_sys_types`;
1401 CREATE TABLE `0_sys_types` (
1402 `type_id` smallint(6) NOT NULL default '0',
1403 `type_name` varchar(60) NOT NULL default '',
1404 `type_no` int(11) NOT NULL default '1',
1405 `next_reference` varchar(100) NOT NULL default '',
1406 PRIMARY KEY (`type_id`)
1410 ### Data of table `0_sys_types` ###
1412 INSERT INTO `0_sys_types` VALUES ('0', 'Journal - GL', '17', '1');
1413 INSERT INTO `0_sys_types` VALUES ('1', 'Payment - GL', '7', '1');
1414 INSERT INTO `0_sys_types` VALUES ('2', 'Receipt - GL', '4', '1');
1415 INSERT INTO `0_sys_types` VALUES ('4', 'Funds Transfer', '3', '1');
1416 INSERT INTO `0_sys_types` VALUES ('10', 'Sales Invoice', '16', '1');
1417 INSERT INTO `0_sys_types` VALUES ('11', 'Credit Note', '2', '1');
1418 INSERT INTO `0_sys_types` VALUES ('12', 'Receipt', '6', '1');
1419 INSERT INTO `0_sys_types` VALUES ('13', 'Delivery', '1', '1');
1420 INSERT INTO `0_sys_types` VALUES ('16', 'Location Transfer', '2', '1');
1421 INSERT INTO `0_sys_types` VALUES ('17', 'Inventory Adjustment', '2', '1');
1422 INSERT INTO `0_sys_types` VALUES ('18', 'Purchase Order', '1', '1');
1423 INSERT INTO `0_sys_types` VALUES ('20', 'Supplier Invoice', '6', '1');
1424 INSERT INTO `0_sys_types` VALUES ('21', 'Supplier Credit Note', '1', '1');
1425 INSERT INTO `0_sys_types` VALUES ('22', 'Supplier Payment', '3', '1');
1426 INSERT INTO `0_sys_types` VALUES ('25', 'Purchase Order Delivery', '1', '1');
1427 INSERT INTO `0_sys_types` VALUES ('26', 'Work Order', '1', '1');
1428 INSERT INTO `0_sys_types` VALUES ('28', 'Work Order Issue', '1', '1');
1429 INSERT INTO `0_sys_types` VALUES ('29', 'Work Order Production', '1', '1');
1430 INSERT INTO `0_sys_types` VALUES ('30', 'Sales Order', '1', '1');
1431 INSERT INTO `0_sys_types` VALUES ('35', 'Cost Update', '1', '1');
1432 INSERT INTO `0_sys_types` VALUES ('40', 'Dimension', '1', '1');
1435 ### Structure of table `0_tax_group_items` ###
1437 DROP TABLE IF EXISTS `0_tax_group_items`;
1439 CREATE TABLE `0_tax_group_items` (
1440 `tax_group_id` int(11) NOT NULL default '0',
1441 `tax_type_id` int(11) NOT NULL default '0',
1442 `rate` double NOT NULL default '0',
1443 PRIMARY KEY (`tax_group_id`,`tax_type_id`)
1447 ### Data of table `0_tax_group_items` ###
1451 ### Structure of table `0_tax_groups` ###
1453 DROP TABLE IF EXISTS `0_tax_groups`;
1455 CREATE TABLE `0_tax_groups` (
1456 `id` int(11) NOT NULL auto_increment,
1457 `name` varchar(60) NOT NULL default '',
1458 `tax_shipping` tinyint(1) NOT NULL default '0',
1460 UNIQUE KEY `name` (`name`)
1461 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1464 ### Data of table `0_tax_groups` ###
1468 ### Structure of table `0_tax_types` ###
1470 DROP TABLE IF EXISTS `0_tax_types`;
1472 CREATE TABLE `0_tax_types` (
1473 `id` int(11) NOT NULL auto_increment,
1474 `rate` double NOT NULL default '0',
1475 `sales_gl_code` varchar(11) NOT NULL default '',
1476 `purchasing_gl_code` varchar(11) NOT NULL default '',
1477 `name` varchar(60) NOT NULL default '',
1479 UNIQUE KEY `name` (`name`,`rate`)
1480 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1483 ### Data of table `0_tax_types` ###
1487 ### Structure of table `0_trans_tax_details` ###
1489 DROP TABLE IF EXISTS `0_trans_tax_details`;
1491 CREATE TABLE `0_trans_tax_details` (
1492 `id` int(11) NOT NULL auto_increment,
1493 `trans_type` smallint(6) default NULL,
1494 `trans_no` int(11) default NULL,
1495 `tran_date` date NOT NULL,
1496 `tax_type_id` int(11) NOT NULL default '0',
1497 `rate` double NOT NULL default '0',
1498 `ex_rate` double NOT NULL default '1',
1499 `included_in_price` tinyint(1) NOT NULL default '0',
1500 `net_amount` double NOT NULL default '0',
1501 `amount` double NOT NULL default '0',
1504 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1507 ### Data of table `0_trans_tax_details` ###
1511 ### Structure of table `0_users` ###
1513 DROP TABLE IF EXISTS `0_users`;
1515 CREATE TABLE `0_users` (
1516 `user_id` varchar(60) NOT NULL default '',
1517 `password` varchar(100) NOT NULL default '',
1518 `real_name` varchar(100) NOT NULL default '',
1519 `full_access` int(11) NOT NULL default '1',
1520 `phone` varchar(30) NOT NULL default '',
1521 `email` varchar(100) default NULL,
1522 `language` varchar(20) default NULL,
1523 `date_format` tinyint(1) NOT NULL default '0',
1524 `date_sep` tinyint(1) NOT NULL default '0',
1525 `tho_sep` tinyint(1) NOT NULL default '0',
1526 `dec_sep` tinyint(1) NOT NULL default '0',
1527 `theme` varchar(20) NOT NULL default 'default',
1528 `page_size` varchar(20) NOT NULL default 'A4',
1529 `prices_dec` smallint(6) NOT NULL default '2',
1530 `qty_dec` smallint(6) NOT NULL default '2',
1531 `rates_dec` smallint(6) NOT NULL default '4',
1532 `percent_dec` smallint(6) NOT NULL default '1',
1533 `show_gl` tinyint(1) NOT NULL default '1',
1534 `show_codes` tinyint(1) NOT NULL default '0',
1535 `show_hints` tinyint(1) NOT NULL default '0',
1536 `last_visit_date` datetime default NULL,
1537 `query_size` tinyint(1) default '10',
1538 `graphic_links` tinyint(1) default '1',
1539 `pos` smallint(6) default '1',
1540 `print_profile` varchar(30) NOT NULL default '1',
1541 `rep_popup` tinyint(1) default '1',
1542 PRIMARY KEY (`user_id`)
1546 ### Data of table `0_users` ###
1548 INSERT INTO `0_users` VALUES ('admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', '2', '', 'adm@adm.com', 'en_US', '0', '0', '0', '0', 'default', 'Letter', '2', '2', '4', '1', '1', '0', '0', '2008-04-04 12:34:29', '10', '1', '1', '1', '1');
1551 ### Structure of table `0_voided` ###
1553 DROP TABLE IF EXISTS `0_voided`;
1555 CREATE TABLE `0_voided` (
1556 `type` int(11) NOT NULL default '0',
1557 `id` int(11) NOT NULL default '0',
1558 `date_` date NOT NULL default '0000-00-00',
1559 `memo_` tinytext NOT NULL,
1560 UNIQUE KEY `id` (`type`,`id`)
1564 ### Data of table `0_voided` ###
1568 ### Structure of table `0_wo_issue_items` ###
1570 DROP TABLE IF EXISTS `0_wo_issue_items`;
1572 CREATE TABLE `0_wo_issue_items` (
1573 `id` int(11) NOT NULL auto_increment,
1574 `stock_id` varchar(40) default NULL,
1575 `issue_id` int(11) default NULL,
1576 `qty_issued` double default NULL,
1578 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1581 ### Data of table `0_wo_issue_items` ###
1585 ### Structure of table `0_wo_issues` ###
1587 DROP TABLE IF EXISTS `0_wo_issues`;
1589 CREATE TABLE `0_wo_issues` (
1590 `issue_no` int(11) NOT NULL auto_increment,
1591 `workorder_id` int(11) NOT NULL default '0',
1592 `reference` varchar(100) default NULL,
1593 `issue_date` date default NULL,
1594 `loc_code` varchar(5) default NULL,
1595 `workcentre_id` int(11) default NULL,
1596 PRIMARY KEY (`issue_no`)
1597 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1600 ### Data of table `0_wo_issues` ###
1604 ### Structure of table `0_wo_manufacture` ###
1606 DROP TABLE IF EXISTS `0_wo_manufacture`;
1608 CREATE TABLE `0_wo_manufacture` (
1609 `id` int(11) NOT NULL auto_increment,
1610 `reference` varchar(100) default NULL,
1611 `workorder_id` int(11) NOT NULL default '0',
1612 `quantity` double NOT NULL default '0',
1613 `date_` date NOT NULL default '0000-00-00',
1615 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1618 ### Data of table `0_wo_manufacture` ###
1622 ### Structure of table `0_wo_requirements` ###
1624 DROP TABLE IF EXISTS `0_wo_requirements`;
1626 CREATE TABLE `0_wo_requirements` (
1627 `id` int(11) NOT NULL auto_increment,
1628 `workorder_id` int(11) NOT NULL default '0',
1629 `stock_id` char(20) NOT NULL default '',
1630 `workcentre` int(11) NOT NULL default '0',
1631 `units_req` double NOT NULL default '1',
1632 `std_cost` double NOT NULL default '0',
1633 `loc_code` char(5) NOT NULL default '',
1634 `units_issued` double NOT NULL default '0',
1636 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1639 ### Data of table `0_wo_requirements` ###
1643 ### Structure of table `0_workcentres` ###
1645 DROP TABLE IF EXISTS `0_workcentres`;
1647 CREATE TABLE `0_workcentres` (
1648 `id` int(11) NOT NULL auto_increment,
1649 `name` char(40) NOT NULL default '',
1650 `description` char(50) NOT NULL default '',
1651 `inactive` tinyint(1) NOT NULL default '0',
1653 UNIQUE KEY `name` (`name`)
1654 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
1657 ### Data of table `0_workcentres` ###
1661 ### Structure of table `0_workorders` ###
1663 DROP TABLE IF EXISTS `0_workorders`;
1665 CREATE TABLE `0_workorders` (
1666 `id` int(11) NOT NULL auto_increment,
1667 `wo_ref` varchar(60) NOT NULL default '',
1668 `loc_code` varchar(5) NOT NULL default '',
1669 `units_reqd` double NOT NULL default '1',
1670 `stock_id` varchar(20) NOT NULL default '',
1671 `date_` date NOT NULL default '0000-00-00',
1672 `type` tinyint(4) NOT NULL default '0',
1673 `required_by` date NOT NULL default '0000-00-00',
1674 `released_date` date NOT NULL default '0000-00-00',
1675 `units_issued` double NOT NULL default '0',
1676 `closed` tinyint(1) NOT NULL default '0',
1677 `released` tinyint(1) NOT NULL default '0',
1678 `additional_costs` double NOT NULL default '0',
1680 UNIQUE KEY `wo_ref` (`wo_ref`)
1681 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1684 ### Data of table `0_workorders` ###