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');
27 ### Structure of table `0_attachments` ###
29 DROP TABLE IF EXISTS `0_attachments`;
31 CREATE TABLE `0_attachments` (
32 `id` int(11) unsigned NOT NULL auto_increment,
33 `description` varchar(60) NOT NULL default '',
34 `type_no` int(11) NOT NULL default '0',
35 `trans_no` int(11) NOT NULL default '0',
36 `unique_name` varchar(60) NOT NULL default '',
37 `tran_date` date NOT NULL default '0000-00-00',
38 `filename` varchar(60) NOT NULL default '',
39 `filesize` int(11) NOT NULL default '0',
40 `filetype` varchar(60) NOT NULL default '',
42 KEY `type_no` (`type_no`,`trans_no`)
43 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
46 ### Data of table `0_attachments` ###
48 ### Structure of table `0_audit_trail` ###
50 DROP TABLE IF EXISTS `0_audit_trail`;
52 CREATE TABLE `0_audit_trail` (
53 `id` int(11) NOT NULL AUTO_INCREMENT,
54 `type` smallint(6) unsigned NOT NULL default '0',
55 `trans_no` int(11) unsigned NOT NULL default '0',
56 `user` smallint(6) unsigned NOT NULL default '0',
57 `stamp` timestamp NOT NULL,
58 `description` varchar(60) default NULL,
59 `fiscal_year` int(11) NOT NULL,
60 `gl_date` date NOT NULL default '0000-00-00',
61 `gl_seq` int(11) unsigned default NULL,
63 KEY (`fiscal_year`, `gl_seq`)
66 ### Data of table `0_audit_trail` ###
70 ### Structure of table `0_bank_accounts` ###
72 DROP TABLE IF EXISTS `0_bank_accounts`;
74 CREATE TABLE `0_bank_accounts` (
75 `account_code` varchar(11) NOT NULL default '',
76 `account_type` smallint(6) NOT NULL default '0',
77 `bank_account_name` varchar(60) NOT NULL default '',
78 `bank_account_number` varchar(100) NOT NULL default '',
79 `bank_name` varchar(60) NOT NULL default '',
80 `bank_address` tinytext,
81 `bank_curr_code` char(3) NOT NULL default '',
82 `id` smallint(6) NOT NULL auto_increment,
83 `last_reconciled_date` timestamp NOT NULL default '0000-00-00 00:00:00',
84 `ending_reconcile_balance` double NOT NULL default '0',
85 `inactive` tinyint(1) NOT NULL default '0',
87 KEY `bank_account_name` (`bank_account_name`),
88 KEY `bank_account_number` (`bank_account_number`)
89 ) TYPE=MyISAM AUTO_INCREMENT=3 AUTO_INCREMENT=3 ;
92 ### Data of table `0_bank_accounts` ###
94 INSERT INTO `0_bank_accounts` VALUES ('1700', '0', 'Current account', 'N/A', 'N/A', '', 'USD', '1', '0000-00-00 00:00:00', '0', '0');
95 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');
98 ### Structure of table `0_bank_trans` ###
100 DROP TABLE IF EXISTS `0_bank_trans`;
102 CREATE TABLE `0_bank_trans` (
103 `id` int(11) NOT NULL auto_increment,
104 `type` smallint(6) default NULL,
105 `trans_no` int(11) default NULL,
106 `bank_act` varchar(11) default NULL,
107 `ref` varchar(40) default NULL,
108 `trans_date` date NOT NULL default '0000-00-00',
109 `amount` double default NULL,
110 `dimension_id` int(11) NOT NULL default '0',
111 `dimension2_id` int(11) NOT NULL default '0',
112 `person_type_id` int(11) NOT NULL default '0',
113 `person_id` tinyblob,
114 `reconciled` date default NULL,
116 KEY `bank_act` (`bank_act`,`ref`),
117 KEY `type` (`type`,`trans_no`)
118 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
121 ### Data of table `0_bank_trans` ###
125 ### Structure of table `0_bom` ###
127 DROP TABLE IF EXISTS `0_bom`;
129 CREATE TABLE `0_bom` (
130 `id` int(11) NOT NULL auto_increment,
131 `parent` char(20) NOT NULL default '',
132 `component` char(20) NOT NULL default '',
133 `workcentre_added` int(11) NOT NULL default '0',
134 `loc_code` char(5) NOT NULL default '',
135 `quantity` double NOT NULL default '1',
136 PRIMARY KEY (`parent`,`component`,`workcentre_added`,`loc_code`),
137 KEY `component` (`component`),
139 KEY `loc_code` (`loc_code`),
140 KEY `parent` (`parent`,`loc_code`),
141 KEY `Parent_2` (`parent`),
142 KEY `workcentre_added` (`workcentre_added`)
143 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
146 ### Data of table `0_bom` ###
150 ### Structure of table `0_budget_trans` ###
152 DROP TABLE IF EXISTS `0_budget_trans`;
154 CREATE TABLE `0_budget_trans` (
155 `counter` int(11) NOT NULL auto_increment,
156 `type` smallint(6) NOT NULL default '0',
157 `type_no` bigint(16) NOT NULL default '1',
158 `tran_date` date NOT NULL default '0000-00-00',
159 `account` varchar(11) NOT NULL default '',
160 `memo_` tinytext NOT NULL,
161 `amount` double NOT NULL default '0',
162 `dimension_id` int(11) default '0',
163 `dimension2_id` int(11) default '0',
164 `person_type_id` int(11) default NULL,
165 `person_id` tinyblob,
166 PRIMARY KEY (`counter`),
167 KEY `Type_and_Number` (`type`,`type_no`)
168 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
171 ### Data of table `0_budget_trans` ###
175 ### Structure of table `0_chart_class` ###
177 DROP TABLE IF EXISTS `0_chart_class`;
179 CREATE TABLE `0_chart_class` (
180 `cid` int(11) NOT NULL default '0',
181 `class_name` varchar(60) NOT NULL default '',
182 `balance_sheet` tinyint(1) NOT NULL default '0',
183 `sign_convert` tinyint(1) NOT NULL default '0',
184 `inactive` tinyint(1) NOT NULL default '0',
189 ### Data of table `0_chart_class` ###
191 INSERT INTO `0_chart_class` VALUES ('1', 'Assets', '1', '0', '0');
192 INSERT INTO `0_chart_class` VALUES ('2', 'Liabilities', '1', '1', '0');
193 INSERT INTO `0_chart_class` VALUES ('3', 'Income', '0', '1', '0');
194 INSERT INTO `0_chart_class` VALUES ('4', 'Costs', '0', '1', '0');
197 ### Structure of table `0_chart_master` ###
199 DROP TABLE IF EXISTS `0_chart_master`;
201 CREATE TABLE `0_chart_master` (
202 `account_code` varchar(11) NOT NULL default '',
203 `account_code2` varchar(11) default '',
204 `account_name` varchar(60) NOT NULL default '',
205 `account_type` int(11) NOT NULL default '0',
206 `inactive` tinyint(1) NOT NULL default '0',
207 PRIMARY KEY (`account_code`),
208 KEY `account_code` (`account_code`),
209 KEY `account_name` (`account_name`)
213 ### Data of table `0_chart_master` ###
215 INSERT INTO `0_chart_master` VALUES ('3000', '', 'Sales', '1', '0');
216 INSERT INTO `0_chart_master` VALUES ('3010', '', 'Sales - Wholesale', '1', '0');
217 INSERT INTO `0_chart_master` VALUES ('3020', '', 'Sales of Other items', '1', '0');
218 INSERT INTO `0_chart_master` VALUES ('3400', '', 'Difference On Exchange', '1', '0');
219 INSERT INTO `0_chart_master` VALUES ('5000', '', 'Direct Labour', '2', '0');
220 INSERT INTO `0_chart_master` VALUES ('5050', '', 'Direct Labour Recovery', '2', '0');
221 INSERT INTO `0_chart_master` VALUES ('4200', '', 'Material Usage Varaiance', '2', '0');
222 INSERT INTO `0_chart_master` VALUES ('4210', '', 'Consumable Materials', '2', '0');
223 INSERT INTO `0_chart_master` VALUES ('4220', '', 'Purchase price Variance', '2', '0');
224 INSERT INTO `0_chart_master` VALUES ('4000', '', 'Purchases of materials', '2', '0');
225 INSERT INTO `0_chart_master` VALUES ('4250', '', 'Discounts Received', '2', '0');
226 INSERT INTO `0_chart_master` VALUES ('4260', '', 'Exchange Variation', '2', '0');
227 INSERT INTO `0_chart_master` VALUES ('4300', '', 'Freight Inwards', '2', '0');
228 INSERT INTO `0_chart_master` VALUES ('4010', '', 'Cost of Goods Sold - Retail', '2', '0');
229 INSERT INTO `0_chart_master` VALUES ('6790', '', 'Bank Charges', '5', '0');
230 INSERT INTO `0_chart_master` VALUES ('6800', '', 'Entertainments', '5', '0');
231 INSERT INTO `0_chart_master` VALUES ('6810', '', 'Legal Expenses', '5', '0');
232 INSERT INTO `0_chart_master` VALUES ('6600', '', 'Repairs and Maintenance Office', '5', '0');
233 INSERT INTO `0_chart_master` VALUES ('6730', '', 'phone', '5', '0');
234 INSERT INTO `0_chart_master` VALUES ('8200', '', 'Bank Interest', '52', '0');
235 INSERT INTO `0_chart_master` VALUES ('8900', '', 'Profit and Loss this year', '52', '0');
236 INSERT INTO `0_chart_master` VALUES ('6840', '', 'Credit Control', '5', '0');
237 INSERT INTO `0_chart_master` VALUES ('7040', '', 'Depreciation Office Equipment', '51', '0');
238 INSERT INTO `0_chart_master` VALUES ('3800', '', 'Freight Outwards', '5', '0');
239 INSERT INTO `0_chart_master` VALUES ('4500', '', 'Packaging', '5', '0');
240 INSERT INTO `0_chart_master` VALUES ('6400', '', 'Commissions', '5', '0');
241 INSERT INTO `0_chart_master` VALUES ('3200', '', 'Prompt Payment Discounts', '1', '0');
242 INSERT INTO `0_chart_master` VALUES ('6700', '', 'General Expenses', '5', '0');
243 INSERT INTO `0_chart_master` VALUES ('5200', '', 'Indirect Labour', '2', '0');
244 INSERT INTO `0_chart_master` VALUES ('5210', '', 'Overhead Recovery', '5', '0');
245 INSERT INTO `0_chart_master` VALUES ('1700', '', 'Bank account', '10', '0');
246 INSERT INTO `0_chart_master` VALUES ('1705', '', 'Petty Cash', '10', '0');
247 INSERT INTO `0_chart_master` VALUES ('1710', '', 'Foreign currency account', '10', '0');
248 INSERT INTO `0_chart_master` VALUES ('1500', '', 'Accounts Receivable', '20', '0');
249 INSERT INTO `0_chart_master` VALUES ('1400', '', 'Stocks of Raw Materials', '45', '0');
250 INSERT INTO `0_chart_master` VALUES ('1410', '', 'Stocks of Work In Progress', '45', '0');
251 INSERT INTO `0_chart_master` VALUES ('1420', '', 'Stocks of Finsihed Goods', '45', '0');
252 INSERT INTO `0_chart_master` VALUES ('1430', '', 'Goods Received Clearing account', '30', '0');
253 INSERT INTO `0_chart_master` VALUES ('2630', '', 'Accounts Payable', '30', '0');
254 INSERT INTO `0_chart_master` VALUES ('2660', '', 'VAT out 5', '30', '0');
255 INSERT INTO `0_chart_master` VALUES ('2662', '', 'VAT out 1', '30', '0');
256 INSERT INTO `0_chart_master` VALUES ('2664', '', 'VAT out 25', '30', '0');
257 INSERT INTO `0_chart_master` VALUES ('2680', '', 'VAT In 5', '30', '0');
258 INSERT INTO `0_chart_master` VALUES ('2682', '', 'VAT In 25', '30', '0');
259 INSERT INTO `0_chart_master` VALUES ('2050', '', 'Retained Earnings', '50', '0');
260 INSERT INTO `0_chart_master` VALUES ('2000', '', 'Share Capital', '50', '0');
263 ### Structure of table `0_chart_types` ###
265 DROP TABLE IF EXISTS `0_chart_types`;
267 CREATE TABLE `0_chart_types` (
268 `id` int(11) NOT NULL auto_increment,
269 `name` varchar(60) NOT NULL default '',
270 `class_id` tinyint(1) NOT NULL default '0',
271 `parent` int(11) NOT NULL default '-1',
272 `inactive` tinyint(1) NOT NULL default '0',
275 ) TYPE=MyISAM AUTO_INCREMENT=53 AUTO_INCREMENT=53 ;
278 ### Data of table `0_chart_types` ###
280 INSERT INTO `0_chart_types` VALUES ('1', 'Sales', '3', '-1', '0');
281 INSERT INTO `0_chart_types` VALUES ('2', 'Cost of Sales', '4', '-1', '0');
282 INSERT INTO `0_chart_types` VALUES ('5', 'Expenses', '4', '-1', '0');
283 INSERT INTO `0_chart_types` VALUES ('10', 'Cash/Bank', '1', '-1', '0');
284 INSERT INTO `0_chart_types` VALUES ('20', 'Accounts Receivable', '1', '-1', '0');
285 INSERT INTO `0_chart_types` VALUES ('30', 'Accounts Payable', '2', '-1', '0');
286 INSERT INTO `0_chart_types` VALUES ('40', 'Fixed Assets', '1', '-1', '0');
287 INSERT INTO `0_chart_types` VALUES ('45', 'Inventory', '1', '-1', '0');
288 INSERT INTO `0_chart_types` VALUES ('50', 'Equity', '2', '-1', '0');
289 INSERT INTO `0_chart_types` VALUES ('51', 'Depreciations', '4', '-1', '0');
290 INSERT INTO `0_chart_types` VALUES ('52', 'Financials', '4', '-1', '0');
293 ### Structure of table `0_comments` ###
295 DROP TABLE IF EXISTS `0_comments`;
297 CREATE TABLE `0_comments` (
298 `type` int(11) NOT NULL default '0',
299 `id` int(11) NOT NULL default '0',
300 `date_` date default '0000-00-00',
305 ### Data of table `0_comments` ###
309 ### Structure of table `0_company` ###
311 DROP TABLE IF EXISTS `0_company`;
313 CREATE TABLE `0_company` (
314 `coy_code` int(11) NOT NULL default '1',
315 `coy_name` varchar(60) NOT NULL default '',
316 `gst_no` varchar(25) NOT NULL default '',
317 `coy_no` varchar(25) NOT NULL default '0',
318 `tax_prd` int(11) NOT NULL default '1',
319 `tax_last` int(11) NOT NULL default '1',
320 `postal_address` tinytext NOT NULL,
321 `phone` varchar(30) NOT NULL default '',
322 `fax` varchar(30) NOT NULL default '',
323 `email` varchar(100) NOT NULL default '',
324 `coy_logo` varchar(100) NOT NULL default '',
325 `domicile` varchar(55) NOT NULL default '',
326 `curr_default` char(3) NOT NULL default '',
327 `debtors_act` varchar(11) NOT NULL default '',
328 `pyt_discount_act` varchar(11) NOT NULL default '',
329 `creditors_act` varchar(11) NOT NULL default '',
330 `grn_act` varchar(11) NOT NULL default '',
331 `exchange_diff_act` varchar(11) NOT NULL default '',
332 `profit_loss_year_act` varchar(11) NOT NULL default '',
333 `retained_earnings_act` varchar(11) NOT NULL default '',
334 `freight_act` varchar(11) NOT NULL default '',
335 `default_sales_act` varchar(11) NOT NULL default '',
336 `default_sales_discount_act` varchar(11) NOT NULL default '',
337 `default_prompt_payment_act` varchar(11) NOT NULL default '',
338 `default_inventory_act` varchar(11) NOT NULL default '',
339 `default_cogs_act` varchar(11) NOT NULL default '',
340 `default_adj_act` varchar(11) NOT NULL default '',
341 `default_inv_sales_act` varchar(11) NOT NULL default '',
342 `default_assembly_act` varchar(11) NOT NULL default '',
343 `payroll_act` varchar(11) NOT NULL default '',
344 `allow_negative_stock` tinyint(1) NOT NULL default '0',
345 `po_over_receive` int(11) NOT NULL default '10',
346 `po_over_charge` int(11) NOT NULL default '10',
347 `default_credit_limit` int(11) NOT NULL default '1000',
348 `default_workorder_required` int(11) NOT NULL default '20',
349 `default_dim_required` int(11) NOT NULL default '20',
350 `past_due_days` int(11) NOT NULL default '30',
351 `use_dimension` tinyint(1) default '0',
352 `f_year` int(11) NOT NULL default '1',
353 `no_item_list` tinyint(1) NOT NULL default '0',
354 `no_customer_list` tinyint(1) NOT NULL default '0',
355 `no_supplier_list` tinyint(1) NOT NULL default '0',
356 `base_sales` int(11) NOT NULL default '-1',
357 `foreign_codes` tinyint(1) NOT NULL default '0',
358 `accumulate_shipping` tinyint(1) NOT NULL default '0',
359 `legal_text` tinytext NOT NULL,
360 `default_delivery_required` smallint(6) NOT NULL default '1',
361 `version_id` varchar(11) NOT NULL default '',
362 `time_zone` tinyint(1) NOT NULL default '0',
363 PRIMARY KEY (`coy_code`)
367 ### Data of table `0_company` ###
369 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', '2.2', '0');
372 ### Structure of table `0_credit_status` ###
374 DROP TABLE IF EXISTS `0_credit_status`;
376 CREATE TABLE `0_credit_status` (
377 `id` int(11) NOT NULL auto_increment,
378 `reason_description` char(100) NOT NULL default '',
379 `dissallow_invoices` tinyint(1) NOT NULL default '0',
380 `inactive` tinyint(1) NOT NULL default '0',
382 UNIQUE KEY `reason_description` (`reason_description`)
383 ) TYPE=MyISAM AUTO_INCREMENT=5 AUTO_INCREMENT=5 ;
386 ### Data of table `0_credit_status` ###
388 INSERT INTO `0_credit_status` VALUES ('1', 'Good History', '0', '0');
389 INSERT INTO `0_credit_status` VALUES ('3', 'No more work until payment received', '1', '0');
390 INSERT INTO `0_credit_status` VALUES ('4', 'In liquidation', '1', '0');
393 ### Structure of table `0_currencies` ###
395 DROP TABLE IF EXISTS `0_currencies`;
397 CREATE TABLE `0_currencies` (
398 `currency` varchar(60) NOT NULL default '',
399 `curr_abrev` char(3) NOT NULL default '',
400 `curr_symbol` varchar(10) NOT NULL default '',
401 `country` varchar(100) NOT NULL default '',
402 `hundreds_name` varchar(15) NOT NULL default '',
403 `auto_update` tinyint(1) NOT NULL default '1',
404 `inactive` tinyint(1) NOT NULL default '0',
405 PRIMARY KEY (`curr_abrev`)
409 ### Data of table `0_currencies` ###
411 INSERT INTO `0_currencies` VALUES ('Euro', 'EUR', '?', 'Europe', 'Cents', '1', '0');
412 INSERT INTO `0_currencies` VALUES ('Pounds', 'GBP', '?', 'England', 'Pence', '1', '0');
413 INSERT INTO `0_currencies` VALUES ('US Dollars', 'USD', '$', 'United States', 'Cents', '1', '0');
416 ### Structure of table `0_cust_allocations` ###
418 DROP TABLE IF EXISTS `0_cust_allocations`;
420 CREATE TABLE `0_cust_allocations` (
421 `id` int(11) NOT NULL auto_increment,
422 `amt` double unsigned default NULL,
423 `date_alloc` date NOT NULL default '0000-00-00',
424 `trans_no_from` int(11) default NULL,
425 `trans_type_from` int(11) default NULL,
426 `trans_no_to` int(11) default NULL,
427 `trans_type_to` int(11) default NULL,
429 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
432 ### Data of table `0_cust_allocations` ###
436 ### Structure of table `0_cust_branch` ###
438 DROP TABLE IF EXISTS `0_cust_branch`;
440 CREATE TABLE `0_cust_branch` (
441 `branch_code` int(11) NOT NULL auto_increment,
442 `debtor_no` int(11) NOT NULL default '0',
443 `br_name` varchar(60) NOT NULL default '',
444 `br_address` tinytext NOT NULL,
445 `area` int(11) default NULL,
446 `salesman` int(11) NOT NULL default '0',
447 `phone` varchar(30) NOT NULL default '',
448 `fax` varchar(30) NOT NULL default '',
449 `contact_name` varchar(60) NOT NULL default '',
450 `email` varchar(100) NOT NULL default '',
451 `default_location` varchar(5) NOT NULL default '',
452 `tax_group_id` int(11) default NULL,
453 `sales_account` varchar(11) default NULL,
454 `sales_discount_account` varchar(11) default NULL,
455 `receivables_account` varchar(11) default NULL,
456 `payment_discount_account` varchar(11) default NULL,
457 `default_ship_via` int(11) NOT NULL default '1',
458 `disable_trans` tinyint(4) NOT NULL default '0',
459 `br_post_address` tinytext NOT NULL,
460 `group_no` int(11) NOT NULL default '0',
461 `inactive` tinyint(1) NOT NULL default '0',
462 PRIMARY KEY (`branch_code`,`debtor_no`),
463 KEY `branch_code` (`branch_code`),
464 KEY `br_name` (`br_name`)
465 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
468 ### Data of table `0_cust_branch` ###
472 ### Structure of table `0_debtor_trans` ###
474 DROP TABLE IF EXISTS `0_debtor_trans`;
476 CREATE TABLE `0_debtor_trans` (
477 `trans_no` int(11) unsigned NOT NULL default '0',
478 `type` smallint(6) unsigned NOT NULL default '0',
479 `version` tinyint(1) unsigned NOT NULL default '0',
480 `debtor_no` int(11) unsigned default NULL,
481 `branch_code` int(11) NOT NULL default '-1',
482 `tran_date` date NOT NULL default '0000-00-00',
483 `due_date` date NOT NULL default '0000-00-00',
484 `reference` varchar(60) NOT NULL default '',
485 `tpe` int(11) NOT NULL default '0',
486 `order_` int(11) NOT NULL default '0',
487 `ov_amount` double NOT NULL default '0',
488 `ov_gst` double NOT NULL default '0',
489 `ov_freight` double NOT NULL default '0',
490 `ov_freight_tax` double NOT NULL default '0',
491 `ov_discount` double NOT NULL default '0',
492 `alloc` double NOT NULL default '0',
493 `rate` double NOT NULL default '1',
494 `ship_via` int(11) default NULL,
495 `trans_link` int(11) NOT NULL default '0',
496 `dimension_id` int(11) NOT NULL default '0',
497 `dimension2_id` int(11) NOT NULL default '0',
498 PRIMARY KEY (`trans_no`,`type`),
499 KEY `debtor_no` (`debtor_no`,`branch_code`)
503 ### Data of table `0_debtor_trans` ###
507 ### Structure of table `0_debtor_trans_details` ###
509 DROP TABLE IF EXISTS `0_debtor_trans_details`;
511 CREATE TABLE `0_debtor_trans_details` (
512 `id` int(11) NOT NULL auto_increment,
513 `debtor_trans_no` int(11) default NULL,
514 `debtor_trans_type` int(11) default NULL,
515 `stock_id` varchar(20) NOT NULL default '',
516 `description` tinytext,
517 `unit_price` double NOT NULL default '0',
518 `unit_tax` double NOT NULL default '0',
519 `quantity` double NOT NULL default '0',
520 `discount_percent` double NOT NULL default '0',
521 `standard_cost` double NOT NULL default '0',
522 `qty_done` double NOT NULL default '0',
524 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
527 ### Data of table `0_debtor_trans_details` ###
531 ### Structure of table `0_debtors_master` ###
533 DROP TABLE IF EXISTS `0_debtors_master`;
535 CREATE TABLE `0_debtors_master` (
536 `debtor_no` int(11) NOT NULL auto_increment,
537 `name` varchar(80) NOT NULL default '',
539 `email` varchar(100) NOT NULL default '',
540 `tax_id` varchar(55) NOT NULL default '',
541 `curr_code` char(3) NOT NULL default '',
542 `sales_type` int(11) NOT NULL default '1',
543 `dimension_id` int(11) NOT NULL default '0',
544 `dimension2_id` int(11) NOT NULL default '0',
545 `credit_status` int(11) NOT NULL default '0',
546 `payment_terms` int(11) default NULL,
547 `discount` double NOT NULL default '0',
548 `pymt_discount` double NOT NULL default '0',
549 `credit_limit` float NOT NULL default '1000',
550 `inactive` tinyint(1) NOT NULL default '0',
551 PRIMARY KEY (`debtor_no`),
552 UNIQUE KEY `name` (`name`)
553 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
556 ### Data of table `0_debtors_master` ###
560 ### Structure of table `0_dimensions` ###
562 DROP TABLE IF EXISTS `0_dimensions`;
564 CREATE TABLE `0_dimensions` (
565 `id` int(11) NOT NULL auto_increment,
566 `reference` varchar(60) NOT NULL default '',
567 `name` varchar(60) NOT NULL default '',
568 `type_` tinyint(1) NOT NULL default '1',
569 `closed` tinyint(1) NOT NULL default '0',
570 `date_` date NOT NULL default '0000-00-00',
571 `due_date` date NOT NULL default '0000-00-00',
573 UNIQUE KEY `reference` (`reference`)
574 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
577 ### Data of table `0_dimensions` ###
581 ### Structure of table `0_exchange_rates` ###
583 DROP TABLE IF EXISTS `0_exchange_rates`;
585 CREATE TABLE `0_exchange_rates` (
586 `id` int(11) NOT NULL auto_increment,
587 `curr_code` char(3) NOT NULL default '',
588 `rate_buy` double NOT NULL default '0',
589 `rate_sell` double NOT NULL default '0',
590 `date_` date NOT NULL default '0000-00-00',
592 UNIQUE KEY `curr_code` (`curr_code`,`date_`)
593 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
596 ### Data of table `0_exchange_rates` ###
600 ### Structure of table `0_fiscal_year` ###
602 DROP TABLE IF EXISTS `0_fiscal_year`;
604 CREATE TABLE `0_fiscal_year` (
605 `id` int(11) NOT NULL auto_increment,
606 `begin` date default '0000-00-00',
607 `end` date default '0000-00-00',
608 `closed` tinyint(1) NOT NULL default '0',
610 ) TYPE=InnoDB AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
613 ### Data of table `0_fiscal_year` ###
615 INSERT INTO `0_fiscal_year` VALUES ('1', '2008-01-01', '2008-12-31', '0');
618 ### Structure of table `0_gl_trans` ###
620 DROP TABLE IF EXISTS `0_gl_trans`;
622 CREATE TABLE `0_gl_trans` (
623 `counter` int(11) NOT NULL auto_increment,
624 `type` smallint(6) NOT NULL default '0',
625 `type_no` bigint(16) NOT NULL default '1',
626 `tran_date` date NOT NULL default '0000-00-00',
627 `account` varchar(11) NOT NULL default '',
628 `memo_` tinytext NOT NULL,
629 `amount` double NOT NULL default '0',
630 `dimension_id` int(11) NOT NULL default '0',
631 `dimension2_id` int(11) NOT NULL default '0',
632 `person_type_id` int(11) default NULL,
633 `person_id` tinyblob,
634 PRIMARY KEY (`counter`),
635 KEY `Type_and_Number` (`type`,`type_no`)
636 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
639 ### Data of table `0_gl_trans` ###
643 ### Structure of table `0_grn_batch` ###
645 DROP TABLE IF EXISTS `0_grn_batch`;
647 CREATE TABLE `0_grn_batch` (
648 `id` int(11) NOT NULL auto_increment,
649 `supplier_id` int(11) NOT NULL default '0',
650 `purch_order_no` int(11) default NULL,
651 `reference` varchar(60) NOT NULL default '',
652 `delivery_date` date NOT NULL default '0000-00-00',
653 `loc_code` varchar(5) default NULL,
655 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
658 ### Data of table `0_grn_batch` ###
662 ### Structure of table `0_grn_items` ###
664 DROP TABLE IF EXISTS `0_grn_items`;
666 CREATE TABLE `0_grn_items` (
667 `id` int(11) NOT NULL auto_increment,
668 `grn_batch_id` int(11) default NULL,
669 `po_detail_item` int(11) NOT NULL default '0',
670 `item_code` varchar(20) NOT NULL default '',
671 `description` tinytext,
672 `qty_recd` double NOT NULL default '0',
673 `quantity_inv` double NOT NULL default '0',
675 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
678 ### Data of table `0_grn_items` ###
682 ### Structure of table `0_groups` ###
684 DROP TABLE IF EXISTS `0_groups`;
686 CREATE TABLE `0_groups` (
687 `id` smallint(6) unsigned NOT NULL auto_increment,
688 `description` varchar(60) NOT NULL default '',
689 `inactive` tinyint(1) NOT NULL default '0',
691 UNIQUE KEY `description` (`description`)
692 ) TYPE=MyISAM AUTO_INCREMENT=4 AUTO_INCREMENT=4 ;
695 ### Data of table `0_groups` ###
697 INSERT INTO `0_groups` VALUES ('1', 'Small', '0');
698 INSERT INTO `0_groups` VALUES ('2', 'Medium', '0');
699 INSERT INTO `0_groups` VALUES ('3', 'Large', '0');
702 ### Structure of table `0_item_codes` ###
704 DROP TABLE IF EXISTS `0_item_codes`;
706 CREATE TABLE `0_item_codes` (
707 `id` int(11) unsigned NOT NULL auto_increment,
708 `item_code` varchar(20) NOT NULL,
709 `stock_id` varchar(20) NOT NULL,
710 `description` varchar(200) NOT NULL default '',
711 `category_id` smallint(6) unsigned NOT NULL,
712 `quantity` double NOT NULL default '1',
713 `is_foreign` tinyint(1) NOT NULL default '0',
714 `inactive` tinyint(1) NOT NULL default '0',
716 UNIQUE KEY `stock_id` (`stock_id`,`item_code`)
717 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
720 ### Data of table `0_item_codes` ###
724 ### Structure of table `0_item_tax_type_exemptions` ###
726 DROP TABLE IF EXISTS `0_item_tax_type_exemptions`;
728 CREATE TABLE `0_item_tax_type_exemptions` (
729 `item_tax_type_id` int(11) NOT NULL default '0',
730 `tax_type_id` int(11) NOT NULL default '0',
731 PRIMARY KEY (`item_tax_type_id`,`tax_type_id`)
735 ### Data of table `0_item_tax_type_exemptions` ###
739 ### Structure of table `0_item_tax_types` ###
741 DROP TABLE IF EXISTS `0_item_tax_types`;
743 CREATE TABLE `0_item_tax_types` (
744 `id` int(11) NOT NULL auto_increment,
745 `name` varchar(60) NOT NULL default '',
746 `exempt` tinyint(1) NOT NULL default '0',
747 `inactive` tinyint(1) NOT NULL default '0',
749 UNIQUE KEY `name` (`name`)
750 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
753 ### Data of table `0_item_tax_types` ###
757 ### Structure of table `0_item_units` ###
759 DROP TABLE IF EXISTS `0_item_units`;
761 CREATE TABLE `0_item_units` (
762 `abbr` varchar(20) NOT NULL,
763 `name` varchar(40) NOT NULL,
764 `decimals` tinyint(2) NOT NULL,
765 `inactive` tinyint(1) NOT NULL default '0',
766 PRIMARY KEY (`abbr`),
767 UNIQUE KEY `name` (`name`)
771 ### Data of table `0_item_units` ###
773 INSERT INTO `0_item_units` VALUES ('ea.', 'Each', '0', '0');
776 ### Structure of table `0_loc_stock` ###
778 DROP TABLE IF EXISTS `0_loc_stock`;
780 CREATE TABLE `0_loc_stock` (
781 `loc_code` char(5) NOT NULL default '',
782 `stock_id` char(20) NOT NULL default '',
783 `reorder_level` bigint(20) NOT NULL default '0',
784 PRIMARY KEY (`loc_code`,`stock_id`),
785 KEY `stock_id` (`stock_id`)
789 ### Data of table `0_loc_stock` ###
793 ### Structure of table `0_locations` ###
795 DROP TABLE IF EXISTS `0_locations`;
797 CREATE TABLE `0_locations` (
798 `loc_code` varchar(5) NOT NULL default '',
799 `location_name` varchar(60) NOT NULL default '',
800 `delivery_address` tinytext NOT NULL,
801 `phone` varchar(30) NOT NULL default '',
802 `fax` varchar(30) NOT NULL default '',
803 `email` varchar(100) NOT NULL default '',
804 `contact` varchar(30) NOT NULL default '',
805 `inactive` tinyint(1) NOT NULL default '0',
806 PRIMARY KEY (`loc_code`)
810 ### Data of table `0_locations` ###
812 INSERT INTO `0_locations` VALUES ('DEF', 'Default', 'N/A', '', '', '', '', '0');
815 ### Structure of table `0_movement_types` ###
817 DROP TABLE IF EXISTS `0_movement_types`;
819 CREATE TABLE `0_movement_types` (
820 `id` int(11) NOT NULL auto_increment,
821 `name` varchar(60) NOT NULL default '',
822 `inactive` tinyint(1) NOT NULL default '0',
824 UNIQUE KEY `name` (`name`)
825 ) TYPE=MyISAM AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
828 ### Data of table `0_movement_types` ###
830 INSERT INTO `0_movement_types` VALUES ('1', 'Adjustment', '0');
833 ### Structure of table `0_payment_terms` ###
835 DROP TABLE IF EXISTS `0_payment_terms`;
837 CREATE TABLE `0_payment_terms` (
838 `terms_indicator` int(11) NOT NULL auto_increment,
839 `terms` char(80) NOT NULL default '',
840 `days_before_due` smallint(6) NOT NULL default '0',
841 `day_in_following_month` smallint(6) NOT NULL default '0',
842 `inactive` tinyint(1) NOT NULL default '0',
843 PRIMARY KEY (`terms_indicator`),
844 UNIQUE KEY `terms` (`terms`)
845 ) TYPE=MyISAM AUTO_INCREMENT=5 AUTO_INCREMENT=5 ;
848 ### Data of table `0_payment_terms` ###
850 INSERT INTO `0_payment_terms` VALUES ('1', 'Due 15th Of the Following Month', '0', '17', '0');
851 INSERT INTO `0_payment_terms` VALUES ('2', 'Due By End Of The Following Month', '0', '30', '0');
852 INSERT INTO `0_payment_terms` VALUES ('3', 'Payment due within 10 days', '10', '0', '0');
853 INSERT INTO `0_payment_terms` VALUES ('4', 'Cash Only', '1', '0', '0');
856 ### Structure of table `0_prices` ###
858 DROP TABLE IF EXISTS `0_prices`;
860 CREATE TABLE `0_prices` (
861 `id` int(11) NOT NULL auto_increment,
862 `stock_id` varchar(20) NOT NULL default '',
863 `sales_type_id` int(11) NOT NULL default '0',
864 `curr_abrev` char(3) NOT NULL default '',
865 `price` double NOT NULL default '0',
867 UNIQUE KEY `price` (`stock_id`,`sales_type_id`,`curr_abrev`)
868 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
871 ### Data of table `0_prices` ###
875 ### Structure of table `0_print_profiles` ###
877 DROP TABLE IF EXISTS `0_print_profiles`;
879 CREATE TABLE `0_print_profiles` (
880 `id` smallint(6) unsigned NOT NULL auto_increment,
881 `profile` varchar(30) NOT NULL,
882 `report` varchar(5) default NULL,
883 `printer` tinyint(3) unsigned default NULL,
885 UNIQUE KEY `profile` (`profile`,`report`)
886 ) TYPE=MyISAM AUTO_INCREMENT=10 AUTO_INCREMENT=10 ;
889 ### Data of table `0_print_profiles` ###
891 INSERT INTO `0_print_profiles` VALUES ('1', 'Out of office', '', '0');
892 INSERT INTO `0_print_profiles` VALUES ('2', 'Sales Department', '', '0');
893 INSERT INTO `0_print_profiles` VALUES ('3', 'Central', '', '2');
894 INSERT INTO `0_print_profiles` VALUES ('4', 'Sales Department', '104', '2');
895 INSERT INTO `0_print_profiles` VALUES ('5', 'Sales Department', '105', '2');
896 INSERT INTO `0_print_profiles` VALUES ('6', 'Sales Department', '107', '2');
897 INSERT INTO `0_print_profiles` VALUES ('7', 'Sales Department', '109', '2');
898 INSERT INTO `0_print_profiles` VALUES ('8', 'Sales Department', '110', '2');
899 INSERT INTO `0_print_profiles` VALUES ('9', 'Sales Department', '201', '2');
902 ### Structure of table `0_printers` ###
904 DROP TABLE IF EXISTS `0_printers`;
906 CREATE TABLE `0_printers` (
907 `id` tinyint(3) unsigned NOT NULL auto_increment,
908 `name` varchar(20) NOT NULL,
909 `description` varchar(60) NOT NULL,
910 `queue` varchar(20) NOT NULL,
911 `host` varchar(40) NOT NULL,
912 `port` smallint(11) unsigned NOT NULL,
913 `timeout` tinyint(3) unsigned NOT NULL,
915 UNIQUE KEY `name` (`name`)
916 ) TYPE=MyISAM AUTO_INCREMENT=4 AUTO_INCREMENT=4 ;
919 ### Data of table `0_printers` ###
921 INSERT INTO `0_printers` VALUES ('1', 'QL500', 'Label printer', 'QL500', 'server', '127', '20');
922 INSERT INTO `0_printers` VALUES ('2', 'Samsung', 'Main network printer', 'scx4521F', 'server', '515', '5');
923 INSERT INTO `0_printers` VALUES ('3', 'Local', 'Local print server at user IP', 'lp', '', '515', '10');
926 ### Structure of table `0_purch_data` ###
928 DROP TABLE IF EXISTS `0_purch_data`;
930 CREATE TABLE `0_purch_data` (
931 `supplier_id` int(11) NOT NULL default '0',
932 `stock_id` char(20) NOT NULL default '',
933 `price` double NOT NULL default '0',
934 `suppliers_uom` char(50) NOT NULL default '',
935 `conversion_factor` double NOT NULL default '1',
936 `supplier_description` char(50) NOT NULL default '',
937 PRIMARY KEY (`supplier_id`,`stock_id`)
941 ### Data of table `0_purch_data` ###
945 ### Structure of table `0_purch_order_details` ###
947 DROP TABLE IF EXISTS `0_purch_order_details`;
949 CREATE TABLE `0_purch_order_details` (
950 `po_detail_item` int(11) NOT NULL auto_increment,
951 `order_no` int(11) NOT NULL default '0',
952 `item_code` varchar(20) NOT NULL default '',
953 `description` tinytext,
954 `delivery_date` date NOT NULL default '0000-00-00',
955 `qty_invoiced` double NOT NULL default '0',
956 `unit_price` double NOT NULL default '0',
957 `act_price` double NOT NULL default '0',
958 `std_cost_unit` double NOT NULL default '0',
959 `quantity_ordered` double NOT NULL default '0',
960 `quantity_received` double NOT NULL default '0',
961 PRIMARY KEY (`po_detail_item`)
962 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
965 ### Data of table `0_purch_order_details` ###
969 ### Structure of table `0_purch_orders` ###
971 DROP TABLE IF EXISTS `0_purch_orders`;
973 CREATE TABLE `0_purch_orders` (
974 `order_no` int(11) NOT NULL auto_increment,
975 `supplier_id` int(11) NOT NULL default '0',
977 `ord_date` date NOT NULL default '0000-00-00',
978 `reference` tinytext NOT NULL,
979 `requisition_no` tinytext,
980 `into_stock_location` varchar(5) NOT NULL default '',
981 `delivery_address` tinytext NOT NULL,
982 PRIMARY KEY (`order_no`)
983 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
986 ### Data of table `0_purch_orders` ###
990 ### Structure of table `0_quick_entries` ###
992 DROP TABLE IF EXISTS `0_quick_entries`;
994 CREATE TABLE `0_quick_entries` (
995 `id` smallint(6) unsigned NOT NULL auto_increment,
996 `type` tinyint(1) NOT NULL default '0',
997 `description` varchar(60) NOT NULL,
998 `base_amount` double NOT NULL default '0',
999 `base_desc` varchar(60) default NULL,
1001 KEY `description` (`description`)
1002 ) TYPE=MyISAM AUTO_INCREMENT=4 AUTO_INCREMENT=4 ;
1005 ### Data of table `0_quick_entries` ###
1007 INSERT INTO `0_quick_entries` VALUES ('1', '1', 'Maintenance', '0', 'Amount');
1008 INSERT INTO `0_quick_entries` VALUES ('2', '1', 'Phone', '0', 'Amount');
1009 INSERT INTO `0_quick_entries` VALUES ('3', '2', 'Cash Sales', '0', 'Amount');
1012 ### Structure of table `0_quick_entry_lines` ###
1014 DROP TABLE IF EXISTS `0_quick_entry_lines`;
1016 CREATE TABLE `0_quick_entry_lines` (
1017 `id` smallint(6) unsigned NOT NULL auto_increment,
1018 `qid` smallint(6) unsigned NOT NULL,
1019 `amount` double default '0',
1020 `action` varchar(2) NOT NULL,
1021 `dest_id` varchar(11) NOT NULL,
1022 `dimension_id` smallint(6) unsigned default NULL,
1023 `dimension2_id` smallint(6) unsigned default NULL,
1026 ) TYPE=MyISAM AUTO_INCREMENT=4 AUTO_INCREMENT=4 ;
1029 ### Data of table `0_quick_entry_lines` ###
1031 INSERT INTO `0_quick_entry_lines` VALUES ('1', '1', '0', '=', '6600', '0', '0');
1032 INSERT INTO `0_quick_entry_lines` VALUES ('2', '2', '0', '=', '6730', '0', '0');
1033 INSERT INTO `0_quick_entry_lines` VALUES ('3', '3', '0', '=', '3000', '0', '0');
1036 ### Structure of table `0_recurrent_invoices` ###
1038 DROP TABLE IF EXISTS `0_recurrent_invoices`;
1040 CREATE TABLE `0_recurrent_invoices` (
1041 `id` smallint(6) unsigned NOT NULL auto_increment,
1042 `description` varchar(60) NOT NULL default '',
1043 `order_no` int(11) unsigned NOT NULL,
1044 `debtor_no` int(11) unsigned default NULL,
1045 `group_no` smallint(6) unsigned default NULL,
1046 `days` int(11) NOT NULL default '0',
1047 `monthly` int(11) NOT NULL default '0',
1048 `begin` date NOT NULL default '0000-00-00',
1049 `end` date NOT NULL default '0000-00-00',
1050 `last_sent` date NOT NULL default '0000-00-00',
1052 UNIQUE KEY `description` (`description`)
1053 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1056 ### Data of table `0_recurrent_invoices` ###
1060 ### Structure of table `0_refs` ###
1062 DROP TABLE IF EXISTS `0_refs`;
1064 CREATE TABLE `0_refs` (
1065 `id` int(11) NOT NULL default '0',
1066 `type` int(11) NOT NULL default '0',
1067 `reference` varchar(100) NOT NULL default '',
1068 PRIMARY KEY (`id`,`type`)
1072 ### Data of table `0_refs` ###
1076 ### Structure of table `0_sales_order_details` ###
1078 DROP TABLE IF EXISTS `0_sales_order_details`;
1080 CREATE TABLE `0_sales_order_details` (
1081 `id` int(11) NOT NULL auto_increment,
1082 `order_no` int(11) NOT NULL default '0',
1083 `stk_code` varchar(20) NOT NULL default '',
1084 `description` tinytext,
1085 `qty_sent` double NOT NULL default '0',
1086 `unit_price` double NOT NULL default '0',
1087 `quantity` double NOT NULL default '0',
1088 `discount_percent` double NOT NULL default '0',
1090 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1093 ### Data of table `0_sales_order_details` ###
1097 ### Structure of table `0_sales_orders` ###
1099 DROP TABLE IF EXISTS `0_sales_orders`;
1101 CREATE TABLE `0_sales_orders` (
1102 `order_no` int(11) NOT NULL auto_increment,
1103 `version` tinyint(1) unsigned NOT NULL default '0',
1104 `type` tinyint(1) NOT NULL default '0',
1105 `debtor_no` int(11) NOT NULL default '0',
1106 `branch_code` int(11) NOT NULL default '0',
1107 `customer_ref` tinytext NOT NULL,
1108 `comments` tinytext,
1109 `ord_date` date NOT NULL default '0000-00-00',
1110 `order_type` int(11) NOT NULL default '0',
1111 `ship_via` int(11) NOT NULL default '0',
1112 `delivery_address` tinytext NOT NULL,
1113 `contact_phone` varchar(30) default NULL,
1114 `contact_email` varchar(100) default NULL,
1115 `deliver_to` tinytext NOT NULL,
1116 `freight_cost` double NOT NULL default '0',
1117 `from_stk_loc` varchar(5) NOT NULL default '',
1118 `delivery_date` date NOT NULL default '0000-00-00',
1119 PRIMARY KEY (`order_no`)
1120 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1123 ### Data of table `0_sales_orders` ###
1127 ### Structure of table `0_sales_pos` ###
1129 DROP TABLE IF EXISTS `0_sales_pos`;
1131 CREATE TABLE `0_sales_pos` (
1132 `id` smallint(6) unsigned NOT NULL auto_increment,
1133 `pos_name` varchar(30) NOT NULL,
1134 `cash_sale` tinyint(1) NOT NULL,
1135 `credit_sale` tinyint(1) NOT NULL,
1136 `pos_location` varchar(5) NOT NULL,
1137 `pos_account` smallint(6) unsigned NOT NULL,
1138 `inactive` tinyint(1) NOT NULL default '0',
1140 UNIQUE KEY `pos_name` (`pos_name`)
1141 ) TYPE=MyISAM AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
1144 ### Data of table `0_sales_pos` ###
1146 INSERT INTO `0_sales_pos` VALUES ('1', 'Default', '1', '1', 'DEF', '1', '0');
1149 ### Structure of table `0_sales_types` ###
1151 DROP TABLE IF EXISTS `0_sales_types`;
1153 CREATE TABLE `0_sales_types` (
1154 `id` int(11) NOT NULL auto_increment,
1155 `sales_type` char(50) NOT NULL default '',
1156 `tax_included` int(1) NOT NULL default '0',
1157 `factor` double NOT NULL default '1',
1158 `inactive` tinyint(1) NOT NULL default '0',
1160 UNIQUE KEY `sales_type` (`sales_type`)
1161 ) TYPE=MyISAM AUTO_INCREMENT=3 AUTO_INCREMENT=3 ;
1164 ### Data of table `0_sales_types` ###
1166 INSERT INTO `0_sales_types` VALUES ('1', 'Retail', '0', '1', '0');
1167 INSERT INTO `0_sales_types` VALUES ('2', 'Wholesale', '0', '1', '0');
1170 ### Structure of table `0_salesman` ###
1172 DROP TABLE IF EXISTS `0_salesman`;
1174 CREATE TABLE `0_salesman` (
1175 `salesman_code` int(11) NOT NULL auto_increment,
1176 `salesman_name` char(60) NOT NULL default '',
1177 `salesman_phone` char(30) NOT NULL default '',
1178 `salesman_fax` char(30) NOT NULL default '',
1179 `salesman_email` varchar(100) NOT NULL default '',
1180 `provision` double NOT NULL default '0',
1181 `break_pt` double NOT NULL default '0',
1182 `provision2` double NOT NULL default '0',
1183 `inactive` tinyint(1) NOT NULL default '0',
1184 PRIMARY KEY (`salesman_code`),
1185 UNIQUE KEY `salesman_name` (`salesman_name`)
1186 ) TYPE=MyISAM AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
1189 ### Data of table `0_salesman` ###
1191 INSERT INTO `0_salesman` VALUES ('1', 'Sales Person', '', '', '', '5', '1000', '4', '0');
1194 ### Structure of table `0_shippers` ###
1196 DROP TABLE IF EXISTS `0_shippers`;
1198 CREATE TABLE `0_shippers` (
1199 `shipper_id` int(11) NOT NULL auto_increment,
1200 `shipper_name` varchar(60) NOT NULL default '',
1201 `phone` varchar(30) NOT NULL default '',
1202 `contact` tinytext NOT NULL,
1203 `address` tinytext NOT NULL,
1204 `inactive` tinyint(1) NOT NULL default '0',
1205 PRIMARY KEY (`shipper_id`),
1206 UNIQUE KEY `name` (`shipper_name`)
1207 ) TYPE=MyISAM AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
1210 ### Data of table `0_shippers` ###
1212 INSERT INTO `0_shippers` VALUES ('1', 'Default', '', '', '', '0');
1215 ### Structure of table `0_sql_trail` ###
1217 DROP TABLE IF EXISTS `0_sql_trail`;
1219 CREATE TABLE `0_sql_trail` (
1220 `id` int(11) unsigned NOT NULL auto_increment,
1221 `sql` text NOT NULL,
1222 `result` tinyint(1) NOT NULL,
1223 `msg` varchar(255) NOT NULL,
1225 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
1228 ### Data of table `0_sql_trail` ###
1232 ### Structure of table `0_stock_category` ###
1234 DROP TABLE IF EXISTS `0_stock_category`;
1236 CREATE TABLE `0_stock_category` (
1237 `category_id` int(11) NOT NULL auto_increment,
1238 `description` varchar(60) NOT NULL default '',
1239 `dflt_tax_type` int(11) NOT NULL default '0',
1240 `dflt_units` varchar(20) NOT NULL default 'each',
1241 `dflt_mb_flag` char(1) NOT NULL default 'B',
1242 `dflt_sales_act` varchar(11) NOT NULL default '',
1243 `dflt_cogs_act` varchar(11) NOT NULL default '',
1244 `dflt_inventory_act` varchar(11) NOT NULL default '',
1245 `dflt_adjustment_act` varchar(11) NOT NULL default '',
1246 `dflt_assembly_act` varchar(11) NOT NULL default '',
1247 `dflt_dim1` int(11) default NULL,
1248 `dflt_dim2` int(11) default NULL,
1249 `inactive` tinyint(1) NOT NULL default '0',
1250 PRIMARY KEY (`category_id`),
1251 UNIQUE KEY `description` (`description`)
1252 ) TYPE=MyISAM AUTO_INCREMENT=5 AUTO_INCREMENT=5 ;
1255 ### Data of table `0_stock_category` ###
1257 INSERT INTO `0_stock_category` VALUES ('1', 'Components', '0');
1258 INSERT INTO `0_stock_category` VALUES ('2', 'Charges', '0');
1259 INSERT INTO `0_stock_category` VALUES ('3', 'Systems', '0');
1260 INSERT INTO `0_stock_category` VALUES ('4', 'Services', '0');
1263 ### Structure of table `0_stock_master` ###
1265 DROP TABLE IF EXISTS `0_stock_master`;
1267 CREATE TABLE `0_stock_master` (
1268 `stock_id` varchar(20) NOT NULL default '',
1269 `category_id` int(11) NOT NULL default '0',
1270 `tax_type_id` int(11) NOT NULL default '0',
1271 `description` varchar(200) NOT NULL default '',
1272 `long_description` tinytext NOT NULL,
1273 `units` varchar(20) NOT NULL default 'each',
1274 `mb_flag` char(1) NOT NULL default 'B',
1275 `sales_account` varchar(11) NOT NULL default '',
1276 `cogs_account` varchar(11) NOT NULL default '',
1277 `inventory_account` varchar(11) NOT NULL default '',
1278 `adjustment_account` varchar(11) NOT NULL default '',
1279 `assembly_account` varchar(11) NOT NULL default '',
1280 `dimension_id` int(11) default NULL,
1281 `dimension2_id` int(11) default NULL,
1282 `actual_cost` double NOT NULL default '0',
1283 `last_cost` double NOT NULL default '0',
1284 `material_cost` double NOT NULL default '0',
1285 `labour_cost` double NOT NULL default '0',
1286 `overhead_cost` double NOT NULL default '0',
1287 `inactive` tinyint(1) NOT NULL default '0',
1288 PRIMARY KEY (`stock_id`)
1292 ### Data of table `0_stock_master` ###
1296 ### Structure of table `0_stock_moves` ###
1298 DROP TABLE IF EXISTS `0_stock_moves`;
1300 CREATE TABLE `0_stock_moves` (
1301 `trans_id` int(11) NOT NULL auto_increment,
1302 `trans_no` int(11) NOT NULL default '0',
1303 `stock_id` char(20) NOT NULL default '',
1304 `type` smallint(6) NOT NULL default '0',
1305 `loc_code` char(5) NOT NULL default '',
1306 `tran_date` date NOT NULL default '0000-00-00',
1307 `person_id` int(11) default NULL,
1308 `price` double NOT NULL default '0',
1309 `reference` char(40) NOT NULL default '',
1310 `qty` double NOT NULL default '1',
1311 `discount_percent` double NOT NULL default '0',
1312 `standard_cost` double NOT NULL default '0',
1313 `visible` tinyint(1) NOT NULL default '1',
1314 PRIMARY KEY (`trans_id`),
1315 KEY `type` (`type`,`trans_no`)
1316 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1319 ### Data of table `0_stock_moves` ###
1323 ### Structure of table `0_supp_allocations` ###
1325 DROP TABLE IF EXISTS `0_supp_allocations`;
1327 CREATE TABLE `0_supp_allocations` (
1328 `id` int(11) NOT NULL auto_increment,
1329 `amt` double unsigned default NULL,
1330 `date_alloc` date NOT NULL default '0000-00-00',
1331 `trans_no_from` int(11) default NULL,
1332 `trans_type_from` int(11) default NULL,
1333 `trans_no_to` int(11) default NULL,
1334 `trans_type_to` int(11) default NULL,
1336 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1339 ### Data of table `0_supp_allocations` ###
1343 ### Structure of table `0_supp_invoice_items` ###
1345 DROP TABLE IF EXISTS `0_supp_invoice_items`;
1347 CREATE TABLE `0_supp_invoice_items` (
1348 `id` int(11) NOT NULL auto_increment,
1349 `supp_trans_no` int(11) default NULL,
1350 `supp_trans_type` int(11) default NULL,
1351 `gl_code` varchar(11) NOT NULL default '0',
1352 `grn_item_id` int(11) default NULL,
1353 `po_detail_item_id` int(11) default NULL,
1354 `stock_id` varchar(20) NOT NULL default '',
1355 `description` tinytext,
1356 `quantity` double NOT NULL default '0',
1357 `unit_price` double NOT NULL default '0',
1358 `unit_tax` double NOT NULL default '0',
1361 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1364 ### Data of table `0_supp_invoice_items` ###
1368 ### Structure of table `0_supp_trans` ###
1370 DROP TABLE IF EXISTS `0_supp_trans`;
1372 CREATE TABLE `0_supp_trans` (
1373 `trans_no` int(11) unsigned NOT NULL default '0',
1374 `type` smallint(6) unsigned NOT NULL default '0',
1375 `supplier_id` int(11) unsigned default NULL,
1376 `reference` tinytext NOT NULL,
1377 `supp_reference` varchar(60) NOT NULL default '',
1378 `tran_date` date NOT NULL default '0000-00-00',
1379 `due_date` date NOT NULL default '0000-00-00',
1380 `ov_amount` double NOT NULL default '0',
1381 `ov_discount` double NOT NULL default '0',
1382 `ov_gst` double NOT NULL default '0',
1383 `rate` double NOT NULL default '1',
1384 `alloc` double NOT NULL default '0',
1385 PRIMARY KEY (`trans_no`,`type`),
1386 KEY `supplier_id` (`supplier_id`),
1387 KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
1392 ### Data of table `0_supp_trans` ###
1396 ### Structure of table `0_suppliers` ###
1398 DROP TABLE IF EXISTS `0_suppliers`;
1400 CREATE TABLE `0_suppliers` (
1401 `supplier_id` int(11) NOT NULL auto_increment,
1402 `supp_name` varchar(60) NOT NULL default '',
1403 `address` tinytext NOT NULL,
1404 `supp_address` tinytext NOT NULL,
1405 `phone` varchar(30) NOT NULL default '',
1406 `fax` varchar(30) NOT NULL default '',
1407 `gst_no` varchar(25) NOT NULL default '',
1408 `contact` varchar(60) NOT NULL default '',
1409 `supp_account_no` varchar(40) NOT NULL default '',
1410 `email` varchar(100) NOT NULL default '',
1411 `website` varchar(100) NOT NULL default '',
1412 `bank_account` varchar(60) NOT NULL default '',
1413 `curr_code` char(3) default NULL,
1414 `payment_terms` int(11) default NULL,
1415 `dimension_id` int(11) default '0',
1416 `dimension2_id` int(11) default '0',
1417 `tax_group_id` int(11) default NULL,
1418 `credit_limit` double NOT NULL default '0',
1419 `purchase_account` varchar(11) default NULL,
1420 `payable_account` varchar(11) default NULL,
1421 `payment_discount_account` varchar(11) default NULL,
1422 `notes` tinytext NOT NULL,
1423 `inactive` tinyint(1) NOT NULL default '0',
1424 PRIMARY KEY (`supplier_id`)
1425 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
1428 ### Data of table `0_suppliers` ###
1432 ### Structure of table `0_sys_types` ###
1434 DROP TABLE IF EXISTS `0_sys_types`;
1436 CREATE TABLE `0_sys_types` (
1437 `type_id` smallint(6) NOT NULL default '0',
1438 `type_name` varchar(60) NOT NULL default '',
1439 `type_no` int(11) NOT NULL default '1',
1440 `next_reference` varchar(100) NOT NULL default '',
1441 PRIMARY KEY (`type_id`)
1445 ### Data of table `0_sys_types` ###
1447 INSERT INTO `0_sys_types` VALUES ('0', 'Journal - GL', '17', '1');
1448 INSERT INTO `0_sys_types` VALUES ('1', 'Payment - GL', '7', '1');
1449 INSERT INTO `0_sys_types` VALUES ('2', 'Receipt - GL', '4', '1');
1450 INSERT INTO `0_sys_types` VALUES ('4', 'Funds Transfer', '3', '1');
1451 INSERT INTO `0_sys_types` VALUES ('10', 'Sales Invoice', '16', '1');
1452 INSERT INTO `0_sys_types` VALUES ('11', 'Credit Note', '2', '1');
1453 INSERT INTO `0_sys_types` VALUES ('12', 'Receipt', '6', '1');
1454 INSERT INTO `0_sys_types` VALUES ('13', 'Delivery', '1', '1');
1455 INSERT INTO `0_sys_types` VALUES ('16', 'Location Transfer', '2', '1');
1456 INSERT INTO `0_sys_types` VALUES ('17', 'Inventory Adjustment', '2', '1');
1457 INSERT INTO `0_sys_types` VALUES ('18', 'Purchase Order', '1', '1');
1458 INSERT INTO `0_sys_types` VALUES ('20', 'Supplier Invoice', '6', '1');
1459 INSERT INTO `0_sys_types` VALUES ('21', 'Supplier Credit Note', '1', '1');
1460 INSERT INTO `0_sys_types` VALUES ('22', 'Supplier Payment', '3', '1');
1461 INSERT INTO `0_sys_types` VALUES ('25', 'Purchase Order Delivery', '1', '1');
1462 INSERT INTO `0_sys_types` VALUES ('26', 'Work Order', '1', '1');
1463 INSERT INTO `0_sys_types` VALUES ('28', 'Work Order Issue', '1', '1');
1464 INSERT INTO `0_sys_types` VALUES ('29', 'Work Order Production', '1', '1');
1465 INSERT INTO `0_sys_types` VALUES ('30', 'Sales Order', '1', '1');
1466 INSERT INTO `0_sys_types` VALUES ('35', 'Cost Update', '1', '1');
1467 INSERT INTO `0_sys_types` VALUES ('40', 'Dimension', '1', '1');
1470 ### Structure of table `0_tax_group_items` ###
1472 DROP TABLE IF EXISTS `0_tax_group_items`;
1474 CREATE TABLE `0_tax_group_items` (
1475 `tax_group_id` int(11) NOT NULL default '0',
1476 `tax_type_id` int(11) NOT NULL default '0',
1477 `rate` double NOT NULL default '0',
1478 PRIMARY KEY (`tax_group_id`,`tax_type_id`)
1482 ### Data of table `0_tax_group_items` ###
1486 ### Structure of table `0_tax_groups` ###
1488 DROP TABLE IF EXISTS `0_tax_groups`;
1490 CREATE TABLE `0_tax_groups` (
1491 `id` int(11) NOT NULL auto_increment,
1492 `name` varchar(60) NOT NULL default '',
1493 `tax_shipping` tinyint(1) NOT NULL default '0',
1494 `inactive` tinyint(1) NOT NULL default '0',
1496 UNIQUE KEY `name` (`name`)
1497 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1500 ### Data of table `0_tax_groups` ###
1504 ### Structure of table `0_tax_types` ###
1506 DROP TABLE IF EXISTS `0_tax_types`;
1508 CREATE TABLE `0_tax_types` (
1509 `id` int(11) NOT NULL auto_increment,
1510 `rate` double NOT NULL default '0',
1511 `sales_gl_code` varchar(11) NOT NULL default '',
1512 `purchasing_gl_code` varchar(11) NOT NULL default '',
1513 `name` varchar(60) NOT NULL default '',
1514 `inactive` tinyint(1) NOT NULL default '0',
1516 UNIQUE KEY `name` (`name`,`rate`)
1517 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1520 ### Data of table `0_tax_types` ###
1524 ### Structure of table `0_trans_tax_details` ###
1526 DROP TABLE IF EXISTS `0_trans_tax_details`;
1528 CREATE TABLE `0_trans_tax_details` (
1529 `id` int(11) NOT NULL auto_increment,
1530 `trans_type` smallint(6) default NULL,
1531 `trans_no` int(11) default NULL,
1532 `tran_date` date NOT NULL,
1533 `tax_type_id` int(11) NOT NULL default '0',
1534 `rate` double NOT NULL default '0',
1535 `ex_rate` double NOT NULL default '1',
1536 `included_in_price` tinyint(1) NOT NULL default '0',
1537 `net_amount` double NOT NULL default '0',
1538 `amount` double NOT NULL default '0',
1541 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1544 ### Data of table `0_trans_tax_details` ###
1548 ### Structure of table `0_users` ###
1550 DROP TABLE IF EXISTS `0_users`;
1552 CREATE TABLE `0_users` (
1553 `id` SMALLINT(6) AUTO_INCREMENT,
1554 `user_id` varchar(60) NOT NULL default '',
1555 `password` varchar(100) NOT NULL default '',
1556 `real_name` varchar(100) NOT NULL default '',
1557 `full_access` int(11) NOT NULL default '1',
1558 `phone` varchar(30) NOT NULL default '',
1559 `email` varchar(100) default NULL,
1560 `language` varchar(20) default NULL,
1561 `date_format` tinyint(1) NOT NULL default '0',
1562 `date_sep` tinyint(1) NOT NULL default '0',
1563 `tho_sep` tinyint(1) NOT NULL default '0',
1564 `dec_sep` tinyint(1) NOT NULL default '0',
1565 `theme` varchar(20) NOT NULL default 'default',
1566 `page_size` varchar(20) NOT NULL default 'A4',
1567 `prices_dec` smallint(6) NOT NULL default '2',
1568 `qty_dec` smallint(6) NOT NULL default '2',
1569 `rates_dec` smallint(6) NOT NULL default '4',
1570 `percent_dec` smallint(6) NOT NULL default '1',
1571 `show_gl` tinyint(1) NOT NULL default '1',
1572 `show_codes` tinyint(1) NOT NULL default '0',
1573 `show_hints` tinyint(1) NOT NULL default '0',
1574 `last_visit_date` datetime default NULL,
1575 `query_size` tinyint(1) default '10',
1576 `graphic_links` tinyint(1) default '1',
1577 `pos` smallint(6) default '1',
1578 `print_profile` varchar(30) NOT NULL default '1',
1579 `rep_popup` tinyint(1) default '1',
1580 `sticky_doc_date` tinyint(1) default '0',
1581 `inactive` tinyint(1) NOT NULL default '0',
1583 UNIQUE KEY (`user_id`)
1584 ) TYPE=MyISAM AUTO_INCREMENT=2;
1587 ### Data of table `0_users` ###
1589 INSERT INTO `0_users` VALUES ('1', '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', '0', '0');
1592 ### Structure of table `0_voided` ###
1594 DROP TABLE IF EXISTS `0_voided`;
1596 CREATE TABLE `0_voided` (
1597 `type` int(11) NOT NULL default '0',
1598 `id` int(11) NOT NULL default '0',
1599 `date_` date NOT NULL default '0000-00-00',
1600 `memo_` tinytext NOT NULL,
1601 UNIQUE KEY `id` (`type`,`id`)
1605 ### Data of table `0_voided` ###
1609 ### Structure of table `0_wo_issue_items` ###
1611 DROP TABLE IF EXISTS `0_wo_issue_items`;
1613 CREATE TABLE `0_wo_issue_items` (
1614 `id` int(11) NOT NULL auto_increment,
1615 `stock_id` varchar(40) default NULL,
1616 `issue_id` int(11) default NULL,
1617 `qty_issued` double default NULL,
1619 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1622 ### Data of table `0_wo_issue_items` ###
1626 ### Structure of table `0_wo_issues` ###
1628 DROP TABLE IF EXISTS `0_wo_issues`;
1630 CREATE TABLE `0_wo_issues` (
1631 `issue_no` int(11) NOT NULL auto_increment,
1632 `workorder_id` int(11) NOT NULL default '0',
1633 `reference` varchar(100) default NULL,
1634 `issue_date` date default NULL,
1635 `loc_code` varchar(5) default NULL,
1636 `workcentre_id` int(11) default NULL,
1637 PRIMARY KEY (`issue_no`)
1638 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1641 ### Data of table `0_wo_issues` ###
1645 ### Structure of table `0_wo_manufacture` ###
1647 DROP TABLE IF EXISTS `0_wo_manufacture`;
1649 CREATE TABLE `0_wo_manufacture` (
1650 `id` int(11) NOT NULL auto_increment,
1651 `reference` varchar(100) default NULL,
1652 `workorder_id` int(11) NOT NULL default '0',
1653 `quantity` double NOT NULL default '0',
1654 `date_` date NOT NULL default '0000-00-00',
1656 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1659 ### Data of table `0_wo_manufacture` ###
1663 ### Structure of table `0_wo_requirements` ###
1665 DROP TABLE IF EXISTS `0_wo_requirements`;
1667 CREATE TABLE `0_wo_requirements` (
1668 `id` int(11) NOT NULL auto_increment,
1669 `workorder_id` int(11) NOT NULL default '0',
1670 `stock_id` char(20) NOT NULL default '',
1671 `workcentre` int(11) NOT NULL default '0',
1672 `units_req` double NOT NULL default '1',
1673 `std_cost` double NOT NULL default '0',
1674 `loc_code` char(5) NOT NULL default '',
1675 `units_issued` double NOT NULL default '0',
1677 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1680 ### Data of table `0_wo_requirements` ###
1684 ### Structure of table `0_workcentres` ###
1686 DROP TABLE IF EXISTS `0_workcentres`;
1688 CREATE TABLE `0_workcentres` (
1689 `id` int(11) NOT NULL auto_increment,
1690 `name` char(40) NOT NULL default '',
1691 `description` char(50) NOT NULL default '',
1692 `inactive` tinyint(1) NOT NULL default '0',
1694 UNIQUE KEY `name` (`name`)
1695 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
1698 ### Data of table `0_workcentres` ###
1702 ### Structure of table `0_workorders` ###
1704 DROP TABLE IF EXISTS `0_workorders`;
1706 CREATE TABLE `0_workorders` (
1707 `id` int(11) NOT NULL auto_increment,
1708 `wo_ref` varchar(60) NOT NULL default '',
1709 `loc_code` varchar(5) NOT NULL default '',
1710 `units_reqd` double NOT NULL default '1',
1711 `stock_id` varchar(20) NOT NULL default '',
1712 `date_` date NOT NULL default '0000-00-00',
1713 `type` tinyint(4) NOT NULL default '0',
1714 `required_by` date NOT NULL default '0000-00-00',
1715 `released_date` date NOT NULL default '0000-00-00',
1716 `units_issued` double NOT NULL default '0',
1717 `closed` tinyint(1) NOT NULL default '0',
1718 `released` tinyint(1) NOT NULL default '0',
1719 `additional_costs` double NOT NULL default '0',
1721 UNIQUE KEY `wo_ref` (`wo_ref`)
1722 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1725 ### Data of table `0_workorders` ###