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',
164 `sign_convert` tinyint(1) NOT NULL default '0',
165 `inactive` tinyint(1) NOT NULL default '0',
170 ### Data of table `0_chart_class` ###
172 INSERT INTO `0_chart_class` VALUES ('1', 'Assets', '1', '0', '0');
173 INSERT INTO `0_chart_class` VALUES ('2', 'Liabilities', '1', '1', '0');
174 INSERT INTO `0_chart_class` VALUES ('3', 'Income', '0', '1', '0');
175 INSERT INTO `0_chart_class` VALUES ('4', 'Costs', '0', '1', '0');
178 ### Structure of table `0_chart_master` ###
180 DROP TABLE IF EXISTS `0_chart_master`;
182 CREATE TABLE `0_chart_master` (
183 `account_code` varchar(11) NOT NULL default '',
184 `account_code2` varchar(11) default '',
185 `account_name` varchar(60) NOT NULL default '',
186 `account_type` int(11) NOT NULL default '0',
187 `inactive` tinyint(1) NOT NULL default '0',
188 PRIMARY KEY (`account_code`),
189 KEY `account_code` (`account_code`),
190 KEY `account_name` (`account_name`)
194 ### Data of table `0_chart_master` ###
196 INSERT INTO `0_chart_master` VALUES ('3000', '', 'Sales', '1', '0');
197 INSERT INTO `0_chart_master` VALUES ('3010', '', 'Sales - Wholesale', '1', '0');
198 INSERT INTO `0_chart_master` VALUES ('3020', '', 'Sales of Other items', '1', '0');
199 INSERT INTO `0_chart_master` VALUES ('3400', '', 'Difference On Exchange', '1', '0');
200 INSERT INTO `0_chart_master` VALUES ('5000', '', 'Direct Labour', '2', '0');
201 INSERT INTO `0_chart_master` VALUES ('5050', '', 'Direct Labour Recovery', '2', '0');
202 INSERT INTO `0_chart_master` VALUES ('4200', '', 'Material Usage Varaiance', '2', '0');
203 INSERT INTO `0_chart_master` VALUES ('4210', '', 'Consumable Materials', '2', '0');
204 INSERT INTO `0_chart_master` VALUES ('4220', '', 'Purchase price Variance', '2', '0');
205 INSERT INTO `0_chart_master` VALUES ('4000', '', 'Purchases of materials', '2', '0');
206 INSERT INTO `0_chart_master` VALUES ('4250', '', 'Discounts Received', '2', '0');
207 INSERT INTO `0_chart_master` VALUES ('4260', '', 'Exchange Variation', '2', '0');
208 INSERT INTO `0_chart_master` VALUES ('4300', '', 'Freight Inwards', '2', '0');
209 INSERT INTO `0_chart_master` VALUES ('4010', '', 'Cost of Goods Sold - Retail', '2', '0');
210 INSERT INTO `0_chart_master` VALUES ('6790', '', 'Bank Charges', '5', '0');
211 INSERT INTO `0_chart_master` VALUES ('6800', '', 'Entertainments', '5', '0');
212 INSERT INTO `0_chart_master` VALUES ('6810', '', 'Legal Expenses', '5', '0');
213 INSERT INTO `0_chart_master` VALUES ('6600', '', 'Repairs and Maintenance Office', '5', '0');
214 INSERT INTO `0_chart_master` VALUES ('6730', '', 'phone', '5', '0');
215 INSERT INTO `0_chart_master` VALUES ('8200', '', 'Bank Interest', '52', '0');
216 INSERT INTO `0_chart_master` VALUES ('8900', '', 'Profit and Loss this year', '52', '0');
217 INSERT INTO `0_chart_master` VALUES ('6840', '', 'Credit Control', '5', '0');
218 INSERT INTO `0_chart_master` VALUES ('7040', '', 'Depreciation Office Equipment', '51', '0');
219 INSERT INTO `0_chart_master` VALUES ('3800', '', 'Freight Outwards', '5', '0');
220 INSERT INTO `0_chart_master` VALUES ('4500', '', 'Packaging', '5', '0');
221 INSERT INTO `0_chart_master` VALUES ('6400', '', 'Commissions', '5', '0');
222 INSERT INTO `0_chart_master` VALUES ('3200', '', 'Prompt Payment Discounts', '1', '0');
223 INSERT INTO `0_chart_master` VALUES ('6700', '', 'General Expenses', '5', '0');
224 INSERT INTO `0_chart_master` VALUES ('5200', '', 'Indirect Labour', '2', '0');
225 INSERT INTO `0_chart_master` VALUES ('5210', '', 'Overhead Recovery', '5', '0');
226 INSERT INTO `0_chart_master` VALUES ('1700', '', 'Bank account', '10', '0');
227 INSERT INTO `0_chart_master` VALUES ('1705', '', 'Petty Cash', '10', '0');
228 INSERT INTO `0_chart_master` VALUES ('1710', '', 'Foreign currency account', '10', '0');
229 INSERT INTO `0_chart_master` VALUES ('1500', '', 'Accounts Receivable', '20', '0');
230 INSERT INTO `0_chart_master` VALUES ('1400', '', 'Stocks of Raw Materials', '45', '0');
231 INSERT INTO `0_chart_master` VALUES ('1410', '', 'Stocks of Work In Progress', '45', '0');
232 INSERT INTO `0_chart_master` VALUES ('1420', '', 'Stocks of Finsihed Goods', '45', '0');
233 INSERT INTO `0_chart_master` VALUES ('1430', '', 'Goods Received Clearing account', '30', '0');
234 INSERT INTO `0_chart_master` VALUES ('2630', '', 'Accounts Payable', '30', '0');
235 INSERT INTO `0_chart_master` VALUES ('2660', '', 'VAT out 5', '30', '0');
236 INSERT INTO `0_chart_master` VALUES ('2662', '', 'VAT out 1', '30', '0');
237 INSERT INTO `0_chart_master` VALUES ('2664', '', 'VAT out 25', '30', '0');
238 INSERT INTO `0_chart_master` VALUES ('2680', '', 'VAT In 5', '30', '0');
239 INSERT INTO `0_chart_master` VALUES ('2682', '', 'VAT In 25', '30', '0');
240 INSERT INTO `0_chart_master` VALUES ('2050', '', 'Retained Earnings', '50', '0');
241 INSERT INTO `0_chart_master` VALUES ('2000', '', 'Share Capital', '50', '0');
244 ### Structure of table `0_chart_types` ###
246 DROP TABLE IF EXISTS `0_chart_types`;
248 CREATE TABLE `0_chart_types` (
249 `id` int(11) NOT NULL auto_increment,
250 `name` varchar(60) NOT NULL default '',
251 `class_id` tinyint(1) NOT NULL default '0',
252 `parent` int(11) NOT NULL default '-1',
253 `inactive` tinyint(1) NOT NULL default '0',
256 ) TYPE=MyISAM AUTO_INCREMENT=53 AUTO_INCREMENT=53 ;
259 ### Data of table `0_chart_types` ###
261 INSERT INTO `0_chart_types` VALUES ('1', 'Sales', '3', '-1', '0');
262 INSERT INTO `0_chart_types` VALUES ('2', 'Cost of Sales', '4', '-1', '0');
263 INSERT INTO `0_chart_types` VALUES ('5', 'Expenses', '4', '-1', '0');
264 INSERT INTO `0_chart_types` VALUES ('10', 'Cash/Bank', '1', '-1', '0');
265 INSERT INTO `0_chart_types` VALUES ('20', 'Accounts Receivable', '1', '-1', '0');
266 INSERT INTO `0_chart_types` VALUES ('30', 'Accounts Payable', '2', '-1', '0');
267 INSERT INTO `0_chart_types` VALUES ('40', 'Fixed Assets', '1', '-1', '0');
268 INSERT INTO `0_chart_types` VALUES ('45', 'Inventory', '1', '-1', '0');
269 INSERT INTO `0_chart_types` VALUES ('50', 'Equity', '2', '-1', '0');
270 INSERT INTO `0_chart_types` VALUES ('51', 'Depreciations', '4', '-1', '0');
271 INSERT INTO `0_chart_types` VALUES ('52', 'Financials', '4', '-1', '0');
274 ### Structure of table `0_comments` ###
276 DROP TABLE IF EXISTS `0_comments`;
278 CREATE TABLE `0_comments` (
279 `type` int(11) NOT NULL default '0',
280 `id` int(11) NOT NULL default '0',
281 `date_` date default '0000-00-00',
286 ### Data of table `0_comments` ###
290 ### Structure of table `0_company` ###
292 DROP TABLE IF EXISTS `0_company`;
294 CREATE TABLE `0_company` (
295 `coy_code` int(11) NOT NULL default '1',
296 `coy_name` varchar(60) NOT NULL default '',
297 `gst_no` varchar(25) NOT NULL default '',
298 `coy_no` varchar(25) NOT NULL default '0',
299 `tax_prd` int(11) NOT NULL default '1',
300 `tax_last` int(11) NOT NULL default '1',
301 `postal_address` tinytext NOT NULL,
302 `phone` varchar(30) NOT NULL default '',
303 `fax` varchar(30) NOT NULL default '',
304 `email` varchar(100) NOT NULL default '',
305 `coy_logo` varchar(100) NOT NULL default '',
306 `domicile` varchar(55) NOT NULL default '',
307 `curr_default` char(3) NOT NULL default '',
308 `debtors_act` varchar(11) NOT NULL default '',
309 `pyt_discount_act` varchar(11) NOT NULL default '',
310 `creditors_act` varchar(11) NOT NULL default '',
311 `grn_act` varchar(11) NOT NULL default '',
312 `exchange_diff_act` varchar(11) NOT NULL default '',
313 `profit_loss_year_act` varchar(11) NOT NULL default '',
314 `retained_earnings_act` varchar(11) NOT NULL default '',
315 `freight_act` varchar(11) NOT NULL default '',
316 `default_sales_act` varchar(11) NOT NULL default '',
317 `default_sales_discount_act` varchar(11) NOT NULL default '',
318 `default_prompt_payment_act` varchar(11) NOT NULL default '',
319 `default_inventory_act` varchar(11) NOT NULL default '',
320 `default_cogs_act` varchar(11) NOT NULL default '',
321 `default_adj_act` varchar(11) NOT NULL default '',
322 `default_inv_sales_act` varchar(11) NOT NULL default '',
323 `default_assembly_act` varchar(11) NOT NULL default '',
324 `payroll_act` varchar(11) NOT NULL default '',
325 `allow_negative_stock` tinyint(1) NOT NULL default '0',
326 `po_over_receive` int(11) NOT NULL default '10',
327 `po_over_charge` int(11) NOT NULL default '10',
328 `default_credit_limit` int(11) NOT NULL default '1000',
329 `default_workorder_required` int(11) NOT NULL default '20',
330 `default_dim_required` int(11) NOT NULL default '20',
331 `past_due_days` int(11) NOT NULL default '30',
332 `use_dimension` tinyint(1) default '0',
333 `f_year` int(11) NOT NULL default '1',
334 `no_item_list` tinyint(1) NOT NULL default '0',
335 `no_customer_list` tinyint(1) NOT NULL default '0',
336 `no_supplier_list` tinyint(1) NOT NULL default '0',
337 `base_sales` int(11) NOT NULL default '-1',
338 `foreign_codes` tinyint(1) NOT NULL default '0',
339 `accumulate_shipping` tinyint(1) NOT NULL default '0',
340 `legal_text` tinytext NOT NULL,
341 `default_delivery_required` smallint(6) NOT NULL default '1',
342 `version_id` varchar(11) NOT NULL default '',
343 `time_zone` tinyint(1) NOT NULL default '0',
344 PRIMARY KEY (`coy_code`)
348 ### Data of table `0_company` ###
350 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');
353 ### Structure of table `0_credit_status` ###
355 DROP TABLE IF EXISTS `0_credit_status`;
357 CREATE TABLE `0_credit_status` (
358 `id` int(11) NOT NULL auto_increment,
359 `reason_description` char(100) NOT NULL default '',
360 `dissallow_invoices` tinyint(1) NOT NULL default '0',
361 `inactive` tinyint(1) NOT NULL default '0',
363 UNIQUE KEY `reason_description` (`reason_description`)
364 ) TYPE=MyISAM AUTO_INCREMENT=5 AUTO_INCREMENT=5 ;
367 ### Data of table `0_credit_status` ###
369 INSERT INTO `0_credit_status` VALUES ('1', 'Good History', '0', '0');
370 INSERT INTO `0_credit_status` VALUES ('3', 'No more work until payment received', '1', '0');
371 INSERT INTO `0_credit_status` VALUES ('4', 'In liquidation', '1', '0');
374 ### Structure of table `0_currencies` ###
376 DROP TABLE IF EXISTS `0_currencies`;
378 CREATE TABLE `0_currencies` (
379 `currency` varchar(60) NOT NULL default '',
380 `curr_abrev` char(3) NOT NULL default '',
381 `curr_symbol` varchar(10) NOT NULL default '',
382 `country` varchar(100) NOT NULL default '',
383 `hundreds_name` varchar(15) NOT NULL default '',
384 `inactive` tinyint(1) NOT NULL default '0',
385 PRIMARY KEY (`curr_abrev`)
389 ### Data of table `0_currencies` ###
391 INSERT INTO `0_currencies` VALUES ('Euro', 'EUR', '?', 'Europe', 'Cents', '0');
392 INSERT INTO `0_currencies` VALUES ('Pounds', 'GBP', '?', 'England', 'Pence', '0');
393 INSERT INTO `0_currencies` VALUES ('US Dollars', 'USD', '$', 'United States', 'Cents', '0');
396 ### Structure of table `0_cust_allocations` ###
398 DROP TABLE IF EXISTS `0_cust_allocations`;
400 CREATE TABLE `0_cust_allocations` (
401 `id` int(11) NOT NULL auto_increment,
402 `amt` double unsigned default NULL,
403 `date_alloc` date NOT NULL default '0000-00-00',
404 `trans_no_from` int(11) default NULL,
405 `trans_type_from` int(11) default NULL,
406 `trans_no_to` int(11) default NULL,
407 `trans_type_to` int(11) default NULL,
409 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
412 ### Data of table `0_cust_allocations` ###
416 ### Structure of table `0_cust_branch` ###
418 DROP TABLE IF EXISTS `0_cust_branch`;
420 CREATE TABLE `0_cust_branch` (
421 `branch_code` int(11) NOT NULL auto_increment,
422 `debtor_no` int(11) NOT NULL default '0',
423 `br_name` varchar(60) NOT NULL default '',
424 `br_address` tinytext NOT NULL,
425 `area` int(11) default NULL,
426 `salesman` int(11) NOT NULL default '0',
427 `phone` varchar(30) NOT NULL default '',
428 `fax` varchar(30) NOT NULL default '',
429 `contact_name` varchar(60) NOT NULL default '',
430 `email` varchar(100) NOT NULL default '',
431 `default_location` varchar(5) NOT NULL default '',
432 `tax_group_id` int(11) default NULL,
433 `sales_account` varchar(11) default NULL,
434 `sales_discount_account` varchar(11) default NULL,
435 `receivables_account` varchar(11) default NULL,
436 `payment_discount_account` varchar(11) default NULL,
437 `default_ship_via` int(11) NOT NULL default '1',
438 `disable_trans` tinyint(4) NOT NULL default '0',
439 `br_post_address` tinytext NOT NULL,
440 `group_no` int(11) NOT NULL default '0',
441 `inactive` tinyint(1) NOT NULL default '0',
442 PRIMARY KEY (`branch_code`,`debtor_no`),
443 KEY `branch_code` (`branch_code`),
444 KEY `br_name` (`br_name`)
445 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
448 ### Data of table `0_cust_branch` ###
452 ### Structure of table `0_debtor_trans` ###
454 DROP TABLE IF EXISTS `0_debtor_trans`;
456 CREATE TABLE `0_debtor_trans` (
457 `trans_no` int(11) unsigned NOT NULL default '0',
458 `type` smallint(6) unsigned NOT NULL default '0',
459 `version` tinyint(1) unsigned NOT NULL default '0',
460 `debtor_no` int(11) unsigned default NULL,
461 `branch_code` int(11) NOT NULL default '-1',
462 `tran_date` date NOT NULL default '0000-00-00',
463 `due_date` date NOT NULL default '0000-00-00',
464 `reference` varchar(60) NOT NULL default '',
465 `tpe` int(11) NOT NULL default '0',
466 `order_` int(11) NOT NULL default '0',
467 `ov_amount` double NOT NULL default '0',
468 `ov_gst` double NOT NULL default '0',
469 `ov_freight` double NOT NULL default '0',
470 `ov_freight_tax` double NOT NULL default '0',
471 `ov_discount` double NOT NULL default '0',
472 `alloc` double NOT NULL default '0',
473 `rate` double NOT NULL default '1',
474 `ship_via` int(11) default NULL,
475 `trans_link` int(11) NOT NULL default '0',
476 `dimension_id` int(11) NOT NULL default '0',
477 `dimension2_id` int(11) NOT NULL default '0',
478 PRIMARY KEY (`trans_no`,`type`),
479 KEY `debtor_no` (`debtor_no`,`branch_code`)
483 ### Data of table `0_debtor_trans` ###
487 ### Structure of table `0_debtor_trans_details` ###
489 DROP TABLE IF EXISTS `0_debtor_trans_details`;
491 CREATE TABLE `0_debtor_trans_details` (
492 `id` int(11) NOT NULL auto_increment,
493 `debtor_trans_no` int(11) default NULL,
494 `debtor_trans_type` int(11) default NULL,
495 `stock_id` varchar(20) NOT NULL default '',
496 `description` tinytext,
497 `unit_price` double NOT NULL default '0',
498 `unit_tax` double NOT NULL default '0',
499 `quantity` double NOT NULL default '0',
500 `discount_percent` double NOT NULL default '0',
501 `standard_cost` double NOT NULL default '0',
502 `qty_done` double NOT NULL default '0',
504 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
507 ### Data of table `0_debtor_trans_details` ###
511 ### Structure of table `0_debtors_master` ###
513 DROP TABLE IF EXISTS `0_debtors_master`;
515 CREATE TABLE `0_debtors_master` (
516 `debtor_no` int(11) NOT NULL auto_increment,
517 `name` varchar(80) NOT NULL default '',
519 `email` varchar(100) NOT NULL default '',
520 `tax_id` varchar(55) NOT NULL default '',
521 `curr_code` char(3) NOT NULL default '',
522 `sales_type` int(11) NOT NULL default '1',
523 `dimension_id` int(11) NOT NULL default '0',
524 `dimension2_id` int(11) NOT NULL default '0',
525 `credit_status` int(11) NOT NULL default '0',
526 `payment_terms` int(11) default NULL,
527 `discount` double NOT NULL default '0',
528 `pymt_discount` double NOT NULL default '0',
529 `credit_limit` float NOT NULL default '1000',
530 `inactive` tinyint(1) NOT NULL default '0',
531 PRIMARY KEY (`debtor_no`),
532 UNIQUE KEY `name` (`name`)
533 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
536 ### Data of table `0_debtors_master` ###
540 ### Structure of table `0_dimensions` ###
542 DROP TABLE IF EXISTS `0_dimensions`;
544 CREATE TABLE `0_dimensions` (
545 `id` int(11) NOT NULL auto_increment,
546 `reference` varchar(60) NOT NULL default '',
547 `name` varchar(60) NOT NULL default '',
548 `type_` tinyint(1) NOT NULL default '1',
549 `closed` tinyint(1) NOT NULL default '0',
550 `date_` date NOT NULL default '0000-00-00',
551 `due_date` date NOT NULL default '0000-00-00',
553 UNIQUE KEY `reference` (`reference`)
554 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
557 ### Data of table `0_dimensions` ###
561 ### Structure of table `0_exchange_rates` ###
563 DROP TABLE IF EXISTS `0_exchange_rates`;
565 CREATE TABLE `0_exchange_rates` (
566 `id` int(11) NOT NULL auto_increment,
567 `curr_code` char(3) NOT NULL default '',
568 `rate_buy` double NOT NULL default '0',
569 `rate_sell` double NOT NULL default '0',
570 `date_` date NOT NULL default '0000-00-00',
572 UNIQUE KEY `curr_code` (`curr_code`,`date_`)
573 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
576 ### Data of table `0_exchange_rates` ###
580 ### Structure of table `0_fiscal_year` ###
582 DROP TABLE IF EXISTS `0_fiscal_year`;
584 CREATE TABLE `0_fiscal_year` (
585 `id` int(11) NOT NULL auto_increment,
586 `begin` date default '0000-00-00',
587 `end` date default '0000-00-00',
588 `closed` tinyint(1) NOT NULL default '0',
590 ) TYPE=InnoDB AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
593 ### Data of table `0_fiscal_year` ###
595 INSERT INTO `0_fiscal_year` VALUES ('1', '2008-01-01', '2008-12-31', '0');
598 ### Structure of table `0_gl_trans` ###
600 DROP TABLE IF EXISTS `0_gl_trans`;
602 CREATE TABLE `0_gl_trans` (
603 `counter` int(11) NOT NULL auto_increment,
604 `type` smallint(6) NOT NULL default '0',
605 `type_no` bigint(16) NOT NULL default '1',
606 `tran_date` date NOT NULL default '0000-00-00',
607 `account` varchar(11) NOT NULL default '',
608 `memo_` tinytext NOT NULL,
609 `amount` double NOT NULL default '0',
610 `dimension_id` int(11) NOT NULL default '0',
611 `dimension2_id` int(11) NOT NULL default '0',
612 `person_type_id` int(11) default NULL,
613 `person_id` tinyblob,
614 PRIMARY KEY (`counter`),
615 KEY `Type_and_Number` (`type`,`type_no`)
616 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
619 ### Data of table `0_gl_trans` ###
623 ### Structure of table `0_grn_batch` ###
625 DROP TABLE IF EXISTS `0_grn_batch`;
627 CREATE TABLE `0_grn_batch` (
628 `id` int(11) NOT NULL auto_increment,
629 `supplier_id` int(11) NOT NULL default '0',
630 `purch_order_no` int(11) default NULL,
631 `reference` varchar(60) NOT NULL default '',
632 `delivery_date` date NOT NULL default '0000-00-00',
633 `loc_code` varchar(5) default NULL,
635 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
638 ### Data of table `0_grn_batch` ###
642 ### Structure of table `0_grn_items` ###
644 DROP TABLE IF EXISTS `0_grn_items`;
646 CREATE TABLE `0_grn_items` (
647 `id` int(11) NOT NULL auto_increment,
648 `grn_batch_id` int(11) default NULL,
649 `po_detail_item` int(11) NOT NULL default '0',
650 `item_code` varchar(20) NOT NULL default '',
651 `description` tinytext,
652 `qty_recd` double NOT NULL default '0',
653 `quantity_inv` double NOT NULL default '0',
655 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
658 ### Data of table `0_grn_items` ###
662 ### Structure of table `0_groups` ###
664 DROP TABLE IF EXISTS `0_groups`;
666 CREATE TABLE `0_groups` (
667 `id` smallint(6) unsigned NOT NULL auto_increment,
668 `description` varchar(60) NOT NULL default '',
669 `inactive` tinyint(1) NOT NULL default '0',
671 UNIQUE KEY `description` (`description`)
672 ) TYPE=MyISAM AUTO_INCREMENT=4 AUTO_INCREMENT=4 ;
675 ### Data of table `0_groups` ###
677 INSERT INTO `0_groups` VALUES ('1', 'Small', '0');
678 INSERT INTO `0_groups` VALUES ('2', 'Medium', '0');
679 INSERT INTO `0_groups` VALUES ('3', 'Large', '0');
682 ### Structure of table `0_item_codes` ###
684 DROP TABLE IF EXISTS `0_item_codes`;
686 CREATE TABLE `0_item_codes` (
687 `id` int(11) unsigned NOT NULL auto_increment,
688 `item_code` varchar(20) NOT NULL,
689 `stock_id` varchar(20) NOT NULL,
690 `description` varchar(200) NOT NULL default '',
691 `category_id` smallint(6) unsigned NOT NULL,
692 `quantity` double NOT NULL default '1',
693 `is_foreign` tinyint(1) NOT NULL default '0',
694 `inactive` tinyint(1) NOT NULL default '0',
696 UNIQUE KEY `stock_id` (`stock_id`,`item_code`)
697 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
700 ### Data of table `0_item_codes` ###
704 ### Structure of table `0_item_tax_type_exemptions` ###
706 DROP TABLE IF EXISTS `0_item_tax_type_exemptions`;
708 CREATE TABLE `0_item_tax_type_exemptions` (
709 `item_tax_type_id` int(11) NOT NULL default '0',
710 `tax_type_id` int(11) NOT NULL default '0',
711 PRIMARY KEY (`item_tax_type_id`,`tax_type_id`)
715 ### Data of table `0_item_tax_type_exemptions` ###
719 ### Structure of table `0_item_tax_types` ###
721 DROP TABLE IF EXISTS `0_item_tax_types`;
723 CREATE TABLE `0_item_tax_types` (
724 `id` int(11) NOT NULL auto_increment,
725 `name` varchar(60) NOT NULL default '',
726 `exempt` tinyint(1) NOT NULL default '0',
727 `inactive` tinyint(1) NOT NULL default '0',
729 UNIQUE KEY `name` (`name`)
730 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
733 ### Data of table `0_item_tax_types` ###
737 ### Structure of table `0_item_units` ###
739 DROP TABLE IF EXISTS `0_item_units`;
741 CREATE TABLE `0_item_units` (
742 `abbr` varchar(20) NOT NULL,
743 `name` varchar(40) NOT NULL,
744 `decimals` tinyint(2) NOT NULL,
745 `inactive` tinyint(1) NOT NULL default '0',
746 PRIMARY KEY (`abbr`),
747 UNIQUE KEY `name` (`name`)
751 ### Data of table `0_item_units` ###
753 INSERT INTO `0_item_units` VALUES ('ea.', 'Each', '0', '0');
756 ### Structure of table `0_loc_stock` ###
758 DROP TABLE IF EXISTS `0_loc_stock`;
760 CREATE TABLE `0_loc_stock` (
761 `loc_code` char(5) NOT NULL default '',
762 `stock_id` char(20) NOT NULL default '',
763 `reorder_level` bigint(20) NOT NULL default '0',
764 PRIMARY KEY (`loc_code`,`stock_id`),
765 KEY `stock_id` (`stock_id`)
769 ### Data of table `0_loc_stock` ###
773 ### Structure of table `0_locations` ###
775 DROP TABLE IF EXISTS `0_locations`;
777 CREATE TABLE `0_locations` (
778 `loc_code` varchar(5) NOT NULL default '',
779 `location_name` varchar(60) NOT NULL default '',
780 `delivery_address` tinytext NOT NULL,
781 `phone` varchar(30) NOT NULL default '',
782 `fax` varchar(30) NOT NULL default '',
783 `email` varchar(100) NOT NULL default '',
784 `contact` varchar(30) NOT NULL default '',
785 `inactive` tinyint(1) NOT NULL default '0',
786 PRIMARY KEY (`loc_code`)
790 ### Data of table `0_locations` ###
792 INSERT INTO `0_locations` VALUES ('DEF', 'Default', 'N/A', '', '', '', '', '0');
795 ### Structure of table `0_movement_types` ###
797 DROP TABLE IF EXISTS `0_movement_types`;
799 CREATE TABLE `0_movement_types` (
800 `id` int(11) NOT NULL auto_increment,
801 `name` varchar(60) NOT NULL default '',
802 `inactive` tinyint(1) NOT NULL default '0',
804 UNIQUE KEY `name` (`name`)
805 ) TYPE=MyISAM AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
808 ### Data of table `0_movement_types` ###
810 INSERT INTO `0_movement_types` VALUES ('1', 'Adjustment', '0');
813 ### Structure of table `0_payment_terms` ###
815 DROP TABLE IF EXISTS `0_payment_terms`;
817 CREATE TABLE `0_payment_terms` (
818 `terms_indicator` int(11) NOT NULL auto_increment,
819 `terms` char(80) NOT NULL default '',
820 `days_before_due` smallint(6) NOT NULL default '0',
821 `day_in_following_month` smallint(6) NOT NULL default '0',
822 `inactive` tinyint(1) NOT NULL default '0',
823 PRIMARY KEY (`terms_indicator`),
824 UNIQUE KEY `terms` (`terms`)
825 ) TYPE=MyISAM AUTO_INCREMENT=5 AUTO_INCREMENT=5 ;
828 ### Data of table `0_payment_terms` ###
830 INSERT INTO `0_payment_terms` VALUES ('1', 'Due 15th Of the Following Month', '0', '17', '0');
831 INSERT INTO `0_payment_terms` VALUES ('2', 'Due By End Of The Following Month', '0', '30', '0');
832 INSERT INTO `0_payment_terms` VALUES ('3', 'Payment due within 10 days', '10', '0', '0');
833 INSERT INTO `0_payment_terms` VALUES ('4', 'Cash Only', '1', '0', '0');
836 ### Structure of table `0_prices` ###
838 DROP TABLE IF EXISTS `0_prices`;
840 CREATE TABLE `0_prices` (
841 `id` int(11) NOT NULL auto_increment,
842 `stock_id` varchar(20) NOT NULL default '',
843 `sales_type_id` int(11) NOT NULL default '0',
844 `curr_abrev` char(3) NOT NULL default '',
845 `price` double NOT NULL default '0',
847 UNIQUE KEY `price` (`stock_id`,`sales_type_id`,`curr_abrev`)
848 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
851 ### Data of table `0_prices` ###
855 ### Structure of table `0_print_profiles` ###
857 DROP TABLE IF EXISTS `0_print_profiles`;
859 CREATE TABLE `0_print_profiles` (
860 `id` smallint(6) unsigned NOT NULL auto_increment,
861 `profile` varchar(30) NOT NULL,
862 `report` varchar(5) default NULL,
863 `printer` tinyint(3) unsigned default NULL,
865 UNIQUE KEY `profile` (`profile`,`report`)
866 ) TYPE=MyISAM AUTO_INCREMENT=10 AUTO_INCREMENT=10 ;
869 ### Data of table `0_print_profiles` ###
871 INSERT INTO `0_print_profiles` VALUES ('1', 'Out of office', '', '0');
872 INSERT INTO `0_print_profiles` VALUES ('2', 'Sales Department', '', '0');
873 INSERT INTO `0_print_profiles` VALUES ('3', 'Central', '', '2');
874 INSERT INTO `0_print_profiles` VALUES ('4', 'Sales Department', '104', '2');
875 INSERT INTO `0_print_profiles` VALUES ('5', 'Sales Department', '105', '2');
876 INSERT INTO `0_print_profiles` VALUES ('6', 'Sales Department', '107', '2');
877 INSERT INTO `0_print_profiles` VALUES ('7', 'Sales Department', '109', '2');
878 INSERT INTO `0_print_profiles` VALUES ('8', 'Sales Department', '110', '2');
879 INSERT INTO `0_print_profiles` VALUES ('9', 'Sales Department', '201', '2');
882 ### Structure of table `0_printers` ###
884 DROP TABLE IF EXISTS `0_printers`;
886 CREATE TABLE `0_printers` (
887 `id` tinyint(3) unsigned NOT NULL auto_increment,
888 `name` varchar(20) NOT NULL,
889 `description` varchar(60) NOT NULL,
890 `queue` varchar(20) NOT NULL,
891 `host` varchar(40) NOT NULL,
892 `port` smallint(11) unsigned NOT NULL,
893 `timeout` tinyint(3) unsigned NOT NULL,
895 UNIQUE KEY `name` (`name`)
896 ) TYPE=MyISAM AUTO_INCREMENT=4 AUTO_INCREMENT=4 ;
899 ### Data of table `0_printers` ###
901 INSERT INTO `0_printers` VALUES ('1', 'QL500', 'Label printer', 'QL500', 'server', '127', '20');
902 INSERT INTO `0_printers` VALUES ('2', 'Samsung', 'Main network printer', 'scx4521F', 'server', '515', '5');
903 INSERT INTO `0_printers` VALUES ('3', 'Local', 'Local print server at user IP', 'lp', '', '515', '10');
906 ### Structure of table `0_purch_data` ###
908 DROP TABLE IF EXISTS `0_purch_data`;
910 CREATE TABLE `0_purch_data` (
911 `supplier_id` int(11) NOT NULL default '0',
912 `stock_id` char(20) NOT NULL default '',
913 `price` double NOT NULL default '0',
914 `suppliers_uom` char(50) NOT NULL default '',
915 `conversion_factor` double NOT NULL default '1',
916 `supplier_description` char(50) NOT NULL default '',
917 PRIMARY KEY (`supplier_id`,`stock_id`)
921 ### Data of table `0_purch_data` ###
925 ### Structure of table `0_purch_order_details` ###
927 DROP TABLE IF EXISTS `0_purch_order_details`;
929 CREATE TABLE `0_purch_order_details` (
930 `po_detail_item` int(11) NOT NULL auto_increment,
931 `order_no` int(11) NOT NULL default '0',
932 `item_code` varchar(20) NOT NULL default '',
933 `description` tinytext,
934 `delivery_date` date NOT NULL default '0000-00-00',
935 `qty_invoiced` double NOT NULL default '0',
936 `unit_price` double NOT NULL default '0',
937 `act_price` double NOT NULL default '0',
938 `std_cost_unit` double NOT NULL default '0',
939 `quantity_ordered` double NOT NULL default '0',
940 `quantity_received` double NOT NULL default '0',
941 PRIMARY KEY (`po_detail_item`)
942 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
945 ### Data of table `0_purch_order_details` ###
949 ### Structure of table `0_purch_orders` ###
951 DROP TABLE IF EXISTS `0_purch_orders`;
953 CREATE TABLE `0_purch_orders` (
954 `order_no` int(11) NOT NULL auto_increment,
955 `supplier_id` int(11) NOT NULL default '0',
957 `ord_date` date NOT NULL default '0000-00-00',
958 `reference` tinytext NOT NULL,
959 `requisition_no` tinytext,
960 `into_stock_location` varchar(5) NOT NULL default '',
961 `delivery_address` tinytext NOT NULL,
962 PRIMARY KEY (`order_no`)
963 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
966 ### Data of table `0_purch_orders` ###
970 ### Structure of table `0_quick_entries` ###
972 DROP TABLE IF EXISTS `0_quick_entries`;
974 CREATE TABLE `0_quick_entries` (
975 `id` smallint(6) unsigned NOT NULL auto_increment,
976 `type` tinyint(1) NOT NULL default '0',
977 `description` varchar(60) NOT NULL,
978 `base_amount` double NOT NULL default '0',
979 `base_desc` varchar(60) default NULL,
981 KEY `description` (`description`)
982 ) TYPE=MyISAM AUTO_INCREMENT=4 AUTO_INCREMENT=4 ;
985 ### Data of table `0_quick_entries` ###
987 INSERT INTO `0_quick_entries` VALUES ('1', '1', 'Maintenance', '0', 'Amount');
988 INSERT INTO `0_quick_entries` VALUES ('2', '1', 'Phone', '0', 'Amount');
989 INSERT INTO `0_quick_entries` VALUES ('3', '2', 'Cash Sales', '0', 'Amount');
992 ### Structure of table `0_quick_entry_lines` ###
994 DROP TABLE IF EXISTS `0_quick_entry_lines`;
996 CREATE TABLE `0_quick_entry_lines` (
997 `id` smallint(6) unsigned NOT NULL auto_increment,
998 `qid` smallint(6) unsigned NOT NULL,
999 `amount` double default '0',
1000 `action` varchar(2) NOT NULL,
1001 `dest_id` varchar(11) NOT NULL,
1002 `dimension_id` smallint(6) unsigned default NULL,
1003 `dimension2_id` smallint(6) unsigned default NULL,
1006 ) TYPE=MyISAM AUTO_INCREMENT=4 AUTO_INCREMENT=4 ;
1009 ### Data of table `0_quick_entry_lines` ###
1011 INSERT INTO `0_quick_entry_lines` VALUES ('1', '1', '0', '=', '6600', '0', '0');
1012 INSERT INTO `0_quick_entry_lines` VALUES ('2', '2', '0', '=', '6730', '0', '0');
1013 INSERT INTO `0_quick_entry_lines` VALUES ('3', '3', '0', '=', '3000', '0', '0');
1016 ### Structure of table `0_recurrent_invoices` ###
1018 DROP TABLE IF EXISTS `0_recurrent_invoices`;
1020 CREATE TABLE `0_recurrent_invoices` (
1021 `id` smallint(6) unsigned NOT NULL auto_increment,
1022 `description` varchar(60) NOT NULL default '',
1023 `order_no` int(11) unsigned NOT NULL,
1024 `debtor_no` int(11) unsigned default NULL,
1025 `group_no` smallint(6) unsigned default NULL,
1026 `days` int(11) NOT NULL default '0',
1027 `monthly` int(11) NOT NULL default '0',
1028 `begin` date NOT NULL default '0000-00-00',
1029 `end` date NOT NULL default '0000-00-00',
1030 `last_sent` date NOT NULL default '0000-00-00',
1032 UNIQUE KEY `description` (`description`)
1033 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1036 ### Data of table `0_recurrent_invoices` ###
1040 ### Structure of table `0_refs` ###
1042 DROP TABLE IF EXISTS `0_refs`;
1044 CREATE TABLE `0_refs` (
1045 `id` int(11) NOT NULL default '0',
1046 `type` int(11) NOT NULL default '0',
1047 `reference` varchar(100) NOT NULL default '',
1048 PRIMARY KEY (`id`,`type`)
1052 ### Data of table `0_refs` ###
1056 ### Structure of table `0_sales_order_details` ###
1058 DROP TABLE IF EXISTS `0_sales_order_details`;
1060 CREATE TABLE `0_sales_order_details` (
1061 `id` int(11) NOT NULL auto_increment,
1062 `order_no` int(11) NOT NULL default '0',
1063 `stk_code` varchar(20) NOT NULL default '',
1064 `description` tinytext,
1065 `qty_sent` double NOT NULL default '0',
1066 `unit_price` double NOT NULL default '0',
1067 `quantity` double NOT NULL default '0',
1068 `discount_percent` double NOT NULL default '0',
1070 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1073 ### Data of table `0_sales_order_details` ###
1077 ### Structure of table `0_sales_orders` ###
1079 DROP TABLE IF EXISTS `0_sales_orders`;
1081 CREATE TABLE `0_sales_orders` (
1082 `order_no` int(11) NOT NULL auto_increment,
1083 `version` tinyint(1) unsigned NOT NULL default '0',
1084 `type` tinyint(1) NOT NULL default '0',
1085 `debtor_no` int(11) NOT NULL default '0',
1086 `branch_code` int(11) NOT NULL default '0',
1087 `customer_ref` tinytext NOT NULL,
1088 `comments` tinytext,
1089 `ord_date` date NOT NULL default '0000-00-00',
1090 `order_type` int(11) NOT NULL default '0',
1091 `ship_via` int(11) NOT NULL default '0',
1092 `delivery_address` tinytext NOT NULL,
1093 `contact_phone` varchar(30) default NULL,
1094 `contact_email` varchar(100) default NULL,
1095 `deliver_to` tinytext NOT NULL,
1096 `freight_cost` double NOT NULL default '0',
1097 `from_stk_loc` varchar(5) NOT NULL default '',
1098 `delivery_date` date NOT NULL default '0000-00-00',
1099 PRIMARY KEY (`order_no`)
1100 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1103 ### Data of table `0_sales_orders` ###
1107 ### Structure of table `0_sales_pos` ###
1109 DROP TABLE IF EXISTS `0_sales_pos`;
1111 CREATE TABLE `0_sales_pos` (
1112 `id` smallint(6) unsigned NOT NULL auto_increment,
1113 `pos_name` varchar(30) NOT NULL,
1114 `cash_sale` tinyint(1) NOT NULL,
1115 `credit_sale` tinyint(1) NOT NULL,
1116 `pos_location` varchar(5) NOT NULL,
1117 `pos_account` smallint(6) unsigned NOT NULL,
1118 `inactive` tinyint(1) NOT NULL default '0',
1120 UNIQUE KEY `pos_name` (`pos_name`)
1121 ) TYPE=MyISAM AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
1124 ### Data of table `0_sales_pos` ###
1126 INSERT INTO `0_sales_pos` VALUES ('1', 'Default', '1', '1', 'DEF', '1', '0');
1129 ### Structure of table `0_sales_types` ###
1131 DROP TABLE IF EXISTS `0_sales_types`;
1133 CREATE TABLE `0_sales_types` (
1134 `id` int(11) NOT NULL auto_increment,
1135 `sales_type` char(50) NOT NULL default '',
1136 `tax_included` int(1) NOT NULL default '0',
1137 `factor` double NOT NULL default '1',
1138 `inactive` tinyint(1) NOT NULL default '0',
1140 UNIQUE KEY `sales_type` (`sales_type`)
1141 ) TYPE=MyISAM AUTO_INCREMENT=3 AUTO_INCREMENT=3 ;
1144 ### Data of table `0_sales_types` ###
1146 INSERT INTO `0_sales_types` VALUES ('1', 'Retail', '0', '1', '0');
1147 INSERT INTO `0_sales_types` VALUES ('2', 'Wholesale', '0', '1', '0');
1150 ### Structure of table `0_salesman` ###
1152 DROP TABLE IF EXISTS `0_salesman`;
1154 CREATE TABLE `0_salesman` (
1155 `salesman_code` int(11) NOT NULL auto_increment,
1156 `salesman_name` char(60) NOT NULL default '',
1157 `salesman_phone` char(30) NOT NULL default '',
1158 `salesman_fax` char(30) NOT NULL default '',
1159 `salesman_email` varchar(100) NOT NULL default '',
1160 `provision` double NOT NULL default '0',
1161 `break_pt` double NOT NULL default '0',
1162 `provision2` double NOT NULL default '0',
1163 `inactive` tinyint(1) NOT NULL default '0',
1164 PRIMARY KEY (`salesman_code`),
1165 UNIQUE KEY `salesman_name` (`salesman_name`)
1166 ) TYPE=MyISAM AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
1169 ### Data of table `0_salesman` ###
1171 INSERT INTO `0_salesman` VALUES ('1', 'Sales Person', '', '', '', '5', '1000', '4', '0');
1174 ### Structure of table `0_shippers` ###
1176 DROP TABLE IF EXISTS `0_shippers`;
1178 CREATE TABLE `0_shippers` (
1179 `shipper_id` int(11) NOT NULL auto_increment,
1180 `shipper_name` varchar(60) NOT NULL default '',
1181 `phone` varchar(30) NOT NULL default '',
1182 `contact` tinytext NOT NULL,
1183 `address` tinytext NOT NULL,
1184 `inactive` tinyint(1) NOT NULL default '0',
1185 PRIMARY KEY (`shipper_id`),
1186 UNIQUE KEY `name` (`shipper_name`)
1187 ) TYPE=MyISAM AUTO_INCREMENT=2 AUTO_INCREMENT=2 ;
1190 ### Data of table `0_shippers` ###
1192 INSERT INTO `0_shippers` VALUES ('1', 'Default', '', '', '', '0');
1195 ### Structure of table `0_sql_trail` ###
1197 DROP TABLE IF EXISTS `0_sql_trail`;
1199 CREATE TABLE `0_sql_trail` (
1200 `id` int(11) unsigned NOT NULL auto_increment,
1201 `sql` text NOT NULL,
1202 `result` tinyint(1) NOT NULL,
1203 `msg` varchar(255) NOT NULL,
1205 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
1208 ### Data of table `0_sql_trail` ###
1212 ### Structure of table `0_stock_category` ###
1214 DROP TABLE IF EXISTS `0_stock_category`;
1216 CREATE TABLE `0_stock_category` (
1217 `category_id` int(11) NOT NULL auto_increment,
1218 `description` varchar(60) NOT NULL default '',
1219 `dflt_tax_type` int(11) NOT NULL default '0',
1220 `dflt_units` varchar(20) NOT NULL default 'each',
1221 `dflt_mb_flag` char(1) NOT NULL default 'B',
1222 `dflt_sales_act` varchar(11) NOT NULL default '',
1223 `dflt_cogs_act` varchar(11) NOT NULL default '',
1224 `dflt_inventory_act` varchar(11) NOT NULL default '',
1225 `dflt_adjustment_act` varchar(11) NOT NULL default '',
1226 `dflt_assembly_act` varchar(11) NOT NULL default '',
1227 `dflt_dim1` int(11) default NULL,
1228 `dflt_dim2` int(11) default NULL,
1229 `inactive` tinyint(1) NOT NULL default '0',
1230 PRIMARY KEY (`category_id`),
1231 UNIQUE KEY `description` (`description`)
1232 ) TYPE=MyISAM AUTO_INCREMENT=5 AUTO_INCREMENT=5 ;
1235 ### Data of table `0_stock_category` ###
1237 INSERT INTO `0_stock_category` VALUES ('1', 'Components', '0');
1238 INSERT INTO `0_stock_category` VALUES ('2', 'Charges', '0');
1239 INSERT INTO `0_stock_category` VALUES ('3', 'Systems', '0');
1240 INSERT INTO `0_stock_category` VALUES ('4', 'Services', '0');
1243 ### Structure of table `0_stock_master` ###
1245 DROP TABLE IF EXISTS `0_stock_master`;
1247 CREATE TABLE `0_stock_master` (
1248 `stock_id` varchar(20) NOT NULL default '',
1249 `category_id` int(11) NOT NULL default '0',
1250 `tax_type_id` int(11) NOT NULL default '0',
1251 `description` varchar(200) NOT NULL default '',
1252 `long_description` tinytext NOT NULL,
1253 `units` varchar(20) NOT NULL default 'each',
1254 `mb_flag` char(1) NOT NULL default 'B',
1255 `sales_account` varchar(11) NOT NULL default '',
1256 `cogs_account` varchar(11) NOT NULL default '',
1257 `inventory_account` varchar(11) NOT NULL default '',
1258 `adjustment_account` varchar(11) NOT NULL default '',
1259 `assembly_account` varchar(11) NOT NULL default '',
1260 `dimension_id` int(11) default NULL,
1261 `dimension2_id` int(11) default NULL,
1262 `actual_cost` double NOT NULL default '0',
1263 `last_cost` double NOT NULL default '0',
1264 `material_cost` double NOT NULL default '0',
1265 `labour_cost` double NOT NULL default '0',
1266 `overhead_cost` double NOT NULL default '0',
1267 `inactive` tinyint(1) NOT NULL default '0',
1268 PRIMARY KEY (`stock_id`)
1272 ### Data of table `0_stock_master` ###
1276 ### Structure of table `0_stock_moves` ###
1278 DROP TABLE IF EXISTS `0_stock_moves`;
1280 CREATE TABLE `0_stock_moves` (
1281 `trans_id` int(11) NOT NULL auto_increment,
1282 `trans_no` int(11) NOT NULL default '0',
1283 `stock_id` char(20) NOT NULL default '',
1284 `type` smallint(6) NOT NULL default '0',
1285 `loc_code` char(5) NOT NULL default '',
1286 `tran_date` date NOT NULL default '0000-00-00',
1287 `person_id` int(11) default NULL,
1288 `price` double NOT NULL default '0',
1289 `reference` char(40) NOT NULL default '',
1290 `qty` double NOT NULL default '1',
1291 `discount_percent` double NOT NULL default '0',
1292 `standard_cost` double NOT NULL default '0',
1293 `visible` tinyint(1) NOT NULL default '1',
1294 PRIMARY KEY (`trans_id`),
1295 KEY `type` (`type`,`trans_no`)
1296 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1299 ### Data of table `0_stock_moves` ###
1303 ### Structure of table `0_supp_allocations` ###
1305 DROP TABLE IF EXISTS `0_supp_allocations`;
1307 CREATE TABLE `0_supp_allocations` (
1308 `id` int(11) NOT NULL auto_increment,
1309 `amt` double unsigned default NULL,
1310 `date_alloc` date NOT NULL default '0000-00-00',
1311 `trans_no_from` int(11) default NULL,
1312 `trans_type_from` int(11) default NULL,
1313 `trans_no_to` int(11) default NULL,
1314 `trans_type_to` int(11) default NULL,
1316 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1319 ### Data of table `0_supp_allocations` ###
1323 ### Structure of table `0_supp_invoice_items` ###
1325 DROP TABLE IF EXISTS `0_supp_invoice_items`;
1327 CREATE TABLE `0_supp_invoice_items` (
1328 `id` int(11) NOT NULL auto_increment,
1329 `supp_trans_no` int(11) default NULL,
1330 `supp_trans_type` int(11) default NULL,
1331 `gl_code` varchar(11) NOT NULL default '0',
1332 `grn_item_id` int(11) default NULL,
1333 `po_detail_item_id` int(11) default NULL,
1334 `stock_id` varchar(20) NOT NULL default '',
1335 `description` tinytext,
1336 `quantity` double NOT NULL default '0',
1337 `unit_price` double NOT NULL default '0',
1338 `unit_tax` double NOT NULL default '0',
1341 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1344 ### Data of table `0_supp_invoice_items` ###
1348 ### Structure of table `0_supp_trans` ###
1350 DROP TABLE IF EXISTS `0_supp_trans`;
1352 CREATE TABLE `0_supp_trans` (
1353 `trans_no` int(11) unsigned NOT NULL default '0',
1354 `type` smallint(6) unsigned NOT NULL default '0',
1355 `supplier_id` int(11) unsigned default NULL,
1356 `reference` tinytext NOT NULL,
1357 `supp_reference` varchar(60) NOT NULL default '',
1358 `tran_date` date NOT NULL default '0000-00-00',
1359 `due_date` date NOT NULL default '0000-00-00',
1360 `ov_amount` double NOT NULL default '0',
1361 `ov_discount` double NOT NULL default '0',
1362 `ov_gst` double NOT NULL default '0',
1363 `rate` double NOT NULL default '1',
1364 `alloc` double NOT NULL default '0',
1365 PRIMARY KEY (`trans_no`,`type`),
1366 KEY `supplier_id` (`supplier_id`),
1367 KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
1372 ### Data of table `0_supp_trans` ###
1376 ### Structure of table `0_suppliers` ###
1378 DROP TABLE IF EXISTS `0_suppliers`;
1380 CREATE TABLE `0_suppliers` (
1381 `supplier_id` int(11) NOT NULL auto_increment,
1382 `supp_name` varchar(60) NOT NULL default '',
1383 `address` tinytext NOT NULL,
1384 `supp_address` tinytext NOT NULL,
1385 `phone` varchar(30) NOT NULL default '',
1386 `fax` varchar(30) NOT NULL default '',
1387 `gst_no` varchar(25) NOT NULL default '',
1388 `contact` varchar(60) NOT NULL default '',
1389 `supp_account_no` varchar(40) NOT NULL default '',
1390 `email` varchar(100) NOT NULL default '',
1391 `website` varchar(100) NOT NULL default '',
1392 `bank_account` varchar(60) NOT NULL default '',
1393 `curr_code` char(3) default NULL,
1394 `payment_terms` int(11) default NULL,
1395 `dimension_id` int(11) default '0',
1396 `dimension2_id` int(11) default '0',
1397 `tax_group_id` int(11) default NULL,
1398 `credit_limit` double NOT NULL default '0',
1399 `purchase_account` varchar(11) default NULL,
1400 `payable_account` varchar(11) default NULL,
1401 `payment_discount_account` varchar(11) default NULL,
1402 `notes` tinytext NOT NULL,
1403 `inactive` tinyint(1) NOT NULL default '0',
1404 PRIMARY KEY (`supplier_id`)
1405 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
1408 ### Data of table `0_suppliers` ###
1412 ### Structure of table `0_sys_types` ###
1414 DROP TABLE IF EXISTS `0_sys_types`;
1416 CREATE TABLE `0_sys_types` (
1417 `type_id` smallint(6) NOT NULL default '0',
1418 `type_name` varchar(60) NOT NULL default '',
1419 `type_no` int(11) NOT NULL default '1',
1420 `next_reference` varchar(100) NOT NULL default '',
1421 PRIMARY KEY (`type_id`)
1425 ### Data of table `0_sys_types` ###
1427 INSERT INTO `0_sys_types` VALUES ('0', 'Journal - GL', '17', '1');
1428 INSERT INTO `0_sys_types` VALUES ('1', 'Payment - GL', '7', '1');
1429 INSERT INTO `0_sys_types` VALUES ('2', 'Receipt - GL', '4', '1');
1430 INSERT INTO `0_sys_types` VALUES ('4', 'Funds Transfer', '3', '1');
1431 INSERT INTO `0_sys_types` VALUES ('10', 'Sales Invoice', '16', '1');
1432 INSERT INTO `0_sys_types` VALUES ('11', 'Credit Note', '2', '1');
1433 INSERT INTO `0_sys_types` VALUES ('12', 'Receipt', '6', '1');
1434 INSERT INTO `0_sys_types` VALUES ('13', 'Delivery', '1', '1');
1435 INSERT INTO `0_sys_types` VALUES ('16', 'Location Transfer', '2', '1');
1436 INSERT INTO `0_sys_types` VALUES ('17', 'Inventory Adjustment', '2', '1');
1437 INSERT INTO `0_sys_types` VALUES ('18', 'Purchase Order', '1', '1');
1438 INSERT INTO `0_sys_types` VALUES ('20', 'Supplier Invoice', '6', '1');
1439 INSERT INTO `0_sys_types` VALUES ('21', 'Supplier Credit Note', '1', '1');
1440 INSERT INTO `0_sys_types` VALUES ('22', 'Supplier Payment', '3', '1');
1441 INSERT INTO `0_sys_types` VALUES ('25', 'Purchase Order Delivery', '1', '1');
1442 INSERT INTO `0_sys_types` VALUES ('26', 'Work Order', '1', '1');
1443 INSERT INTO `0_sys_types` VALUES ('28', 'Work Order Issue', '1', '1');
1444 INSERT INTO `0_sys_types` VALUES ('29', 'Work Order Production', '1', '1');
1445 INSERT INTO `0_sys_types` VALUES ('30', 'Sales Order', '1', '1');
1446 INSERT INTO `0_sys_types` VALUES ('35', 'Cost Update', '1', '1');
1447 INSERT INTO `0_sys_types` VALUES ('40', 'Dimension', '1', '1');
1450 ### Structure of table `0_tax_group_items` ###
1452 DROP TABLE IF EXISTS `0_tax_group_items`;
1454 CREATE TABLE `0_tax_group_items` (
1455 `tax_group_id` int(11) NOT NULL default '0',
1456 `tax_type_id` int(11) NOT NULL default '0',
1457 `rate` double NOT NULL default '0',
1458 PRIMARY KEY (`tax_group_id`,`tax_type_id`)
1462 ### Data of table `0_tax_group_items` ###
1466 ### Structure of table `0_tax_groups` ###
1468 DROP TABLE IF EXISTS `0_tax_groups`;
1470 CREATE TABLE `0_tax_groups` (
1471 `id` int(11) NOT NULL auto_increment,
1472 `name` varchar(60) NOT NULL default '',
1473 `tax_shipping` tinyint(1) NOT NULL default '0',
1474 `inactive` tinyint(1) NOT NULL default '0',
1476 UNIQUE KEY `name` (`name`)
1477 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1480 ### Data of table `0_tax_groups` ###
1484 ### Structure of table `0_tax_types` ###
1486 DROP TABLE IF EXISTS `0_tax_types`;
1488 CREATE TABLE `0_tax_types` (
1489 `id` int(11) NOT NULL auto_increment,
1490 `rate` double NOT NULL default '0',
1491 `sales_gl_code` varchar(11) NOT NULL default '',
1492 `purchasing_gl_code` varchar(11) NOT NULL default '',
1493 `name` varchar(60) NOT NULL default '',
1494 `inactive` tinyint(1) NOT NULL default '0',
1496 UNIQUE KEY `name` (`name`,`rate`)
1497 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1500 ### Data of table `0_tax_types` ###
1504 ### Structure of table `0_trans_tax_details` ###
1506 DROP TABLE IF EXISTS `0_trans_tax_details`;
1508 CREATE TABLE `0_trans_tax_details` (
1509 `id` int(11) NOT NULL auto_increment,
1510 `trans_type` smallint(6) default NULL,
1511 `trans_no` int(11) default NULL,
1512 `tran_date` date NOT NULL,
1513 `tax_type_id` int(11) NOT NULL default '0',
1514 `rate` double NOT NULL default '0',
1515 `ex_rate` double NOT NULL default '1',
1516 `included_in_price` tinyint(1) NOT NULL default '0',
1517 `net_amount` double NOT NULL default '0',
1518 `amount` double NOT NULL default '0',
1521 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1524 ### Data of table `0_trans_tax_details` ###
1528 ### Structure of table `0_users` ###
1530 DROP TABLE IF EXISTS `0_users`;
1532 CREATE TABLE `0_users` (
1533 `user_id` varchar(60) NOT NULL default '',
1534 `password` varchar(100) NOT NULL default '',
1535 `real_name` varchar(100) NOT NULL default '',
1536 `full_access` int(11) NOT NULL default '1',
1537 `phone` varchar(30) NOT NULL default '',
1538 `email` varchar(100) default NULL,
1539 `language` varchar(20) default NULL,
1540 `date_format` tinyint(1) NOT NULL default '0',
1541 `date_sep` tinyint(1) NOT NULL default '0',
1542 `tho_sep` tinyint(1) NOT NULL default '0',
1543 `dec_sep` tinyint(1) NOT NULL default '0',
1544 `theme` varchar(20) NOT NULL default 'default',
1545 `page_size` varchar(20) NOT NULL default 'A4',
1546 `prices_dec` smallint(6) NOT NULL default '2',
1547 `qty_dec` smallint(6) NOT NULL default '2',
1548 `rates_dec` smallint(6) NOT NULL default '4',
1549 `percent_dec` smallint(6) NOT NULL default '1',
1550 `show_gl` tinyint(1) NOT NULL default '1',
1551 `show_codes` tinyint(1) NOT NULL default '0',
1552 `show_hints` tinyint(1) NOT NULL default '0',
1553 `last_visit_date` datetime default NULL,
1554 `query_size` tinyint(1) default '10',
1555 `graphic_links` tinyint(1) default '1',
1556 `pos` smallint(6) default '1',
1557 `print_profile` varchar(30) NOT NULL default '1',
1558 `rep_popup` tinyint(1) default '1',
1559 `sticky_doc_date` tinyint(1) default '0',
1560 PRIMARY KEY (`user_id`)
1564 ### Data of table `0_users` ###
1566 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', '0');
1569 ### Structure of table `0_voided` ###
1571 DROP TABLE IF EXISTS `0_voided`;
1573 CREATE TABLE `0_voided` (
1574 `type` int(11) NOT NULL default '0',
1575 `id` int(11) NOT NULL default '0',
1576 `date_` date NOT NULL default '0000-00-00',
1577 `memo_` tinytext NOT NULL,
1578 UNIQUE KEY `id` (`type`,`id`)
1582 ### Data of table `0_voided` ###
1586 ### Structure of table `0_wo_issue_items` ###
1588 DROP TABLE IF EXISTS `0_wo_issue_items`;
1590 CREATE TABLE `0_wo_issue_items` (
1591 `id` int(11) NOT NULL auto_increment,
1592 `stock_id` varchar(40) default NULL,
1593 `issue_id` int(11) default NULL,
1594 `qty_issued` double default NULL,
1596 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1599 ### Data of table `0_wo_issue_items` ###
1603 ### Structure of table `0_wo_issues` ###
1605 DROP TABLE IF EXISTS `0_wo_issues`;
1607 CREATE TABLE `0_wo_issues` (
1608 `issue_no` int(11) NOT NULL auto_increment,
1609 `workorder_id` int(11) NOT NULL default '0',
1610 `reference` varchar(100) default NULL,
1611 `issue_date` date default NULL,
1612 `loc_code` varchar(5) default NULL,
1613 `workcentre_id` int(11) default NULL,
1614 PRIMARY KEY (`issue_no`)
1615 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1618 ### Data of table `0_wo_issues` ###
1622 ### Structure of table `0_wo_manufacture` ###
1624 DROP TABLE IF EXISTS `0_wo_manufacture`;
1626 CREATE TABLE `0_wo_manufacture` (
1627 `id` int(11) NOT NULL auto_increment,
1628 `reference` varchar(100) default NULL,
1629 `workorder_id` int(11) NOT NULL default '0',
1630 `quantity` double NOT NULL default '0',
1631 `date_` date NOT NULL default '0000-00-00',
1633 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1636 ### Data of table `0_wo_manufacture` ###
1640 ### Structure of table `0_wo_requirements` ###
1642 DROP TABLE IF EXISTS `0_wo_requirements`;
1644 CREATE TABLE `0_wo_requirements` (
1645 `id` int(11) NOT NULL auto_increment,
1646 `workorder_id` int(11) NOT NULL default '0',
1647 `stock_id` char(20) NOT NULL default '',
1648 `workcentre` int(11) NOT NULL default '0',
1649 `units_req` double NOT NULL default '1',
1650 `std_cost` double NOT NULL default '0',
1651 `loc_code` char(5) NOT NULL default '',
1652 `units_issued` double NOT NULL default '0',
1654 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1657 ### Data of table `0_wo_requirements` ###
1661 ### Structure of table `0_workcentres` ###
1663 DROP TABLE IF EXISTS `0_workcentres`;
1665 CREATE TABLE `0_workcentres` (
1666 `id` int(11) NOT NULL auto_increment,
1667 `name` char(40) NOT NULL default '',
1668 `description` char(50) NOT NULL default '',
1669 `inactive` tinyint(1) NOT NULL default '0',
1671 UNIQUE KEY `name` (`name`)
1672 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
1675 ### Data of table `0_workcentres` ###
1679 ### Structure of table `0_workorders` ###
1681 DROP TABLE IF EXISTS `0_workorders`;
1683 CREATE TABLE `0_workorders` (
1684 `id` int(11) NOT NULL auto_increment,
1685 `wo_ref` varchar(60) NOT NULL default '',
1686 `loc_code` varchar(5) NOT NULL default '',
1687 `units_reqd` double NOT NULL default '1',
1688 `stock_id` varchar(20) NOT NULL default '',
1689 `date_` date NOT NULL default '0000-00-00',
1690 `type` tinyint(4) NOT NULL default '0',
1691 `required_by` date NOT NULL default '0000-00-00',
1692 `released_date` date NOT NULL default '0000-00-00',
1693 `units_issued` double NOT NULL default '0',
1694 `closed` tinyint(1) NOT NULL default '0',
1695 `released` tinyint(1) NOT NULL default '0',
1696 `additional_costs` double NOT NULL default '0',
1698 UNIQUE KEY `wo_ref` (`wo_ref`)
1699 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1702 ### Data of table `0_workorders` ###