Release 1.1. Enabled module addons and all the below bugfixes. No changes in database...
[fa-stable.git] / sql / en_US-new.sql
1 -- phpMyAdmin SQL Dump
2 -- version 2.7.0-pl2
3 -- http://www.phpmyadmin.net
4 -- 
5 -- Host: localhost
6 -- Created: 09 februar 2007 at 11:03
7 -- Server Version: 4.1.11
8 -- PHP-version: 4.4.1
9 -- 
10 -- Database: `en_US-new`
11 -- 
12
13 -- --------------------------------------------------------
14
15 -- 
16 -- Structure for table `areas`
17 -- 
18
19 DROP TABLE IF EXISTS `0_areas`;
20 CREATE TABLE IF NOT EXISTS `0_areas` (
21   `area_code` int(11) NOT NULL auto_increment,
22   `description` varchar(60) NOT NULL default '',
23   PRIMARY KEY  (`area_code`),
24   UNIQUE KEY `description` (`description`)
25 ) TYPE=MyISAM;
26
27 -- --------------------------------------------------------
28
29 -- 
30 -- Structure for table `bank_accounts`
31 -- 
32
33 DROP TABLE IF EXISTS `0_bank_accounts`;
34 CREATE TABLE IF NOT EXISTS `0_bank_accounts` (
35   `account_code` varchar(11) NOT NULL default '',
36   `account_type` smallint(6) NOT NULL default '0',
37   `bank_account_name` varchar(60) NOT NULL default '',
38   `bank_account_number` varchar(100) NOT NULL default '',
39   `bank_name` varchar(60) NOT NULL default '',
40   `bank_address` tinytext,
41   `bank_curr_code` char(3) NOT NULL default '',
42   PRIMARY KEY  (`account_code`),
43   KEY `bank_account_name` (`bank_account_name`),
44   KEY `bank_account_number` (`bank_account_number`)
45 ) TYPE=MyISAM;
46
47 -- --------------------------------------------------------
48
49 -- 
50 -- Structure for table `bank_trans`
51 -- 
52
53 DROP TABLE IF EXISTS `0_bank_trans`;
54 CREATE TABLE IF NOT EXISTS `0_bank_trans` (
55   `id` int(11) NOT NULL auto_increment,
56   `type` smallint(6) default NULL,
57   `trans_no` int(11) default NULL,
58   `bank_act` varchar(11) default NULL,
59   `ref` varchar(40) default NULL,
60   `trans_date` date NOT NULL default '0000-00-00',
61   `bank_trans_type_id` int(10) unsigned default NULL,
62   `amount` double default NULL,
63   `dimension_id` int(11) NOT NULL default '0',
64   `dimension2_id` int(11) NOT NULL default '0',
65   `person_type_id` int(11) NOT NULL default '0',
66   `person_id` tinyblob,
67   PRIMARY KEY  (`id`),
68   KEY `bank_act` (`bank_act`,`ref`),
69   KEY `type` (`type`,`trans_no`)
70 ) TYPE=InnoDB;
71
72 -- --------------------------------------------------------
73
74 -- 
75 -- Structure for table `bank_trans_types`
76 -- 
77
78 DROP TABLE IF EXISTS `0_bank_trans_types`;
79 CREATE TABLE IF NOT EXISTS `0_bank_trans_types` (
80   `id` int(11) NOT NULL auto_increment,
81   `name` varchar(60) NOT NULL default '',
82   PRIMARY KEY  (`id`),
83   UNIQUE KEY `name` (`name`)
84 ) TYPE=MyISAM;
85
86 -- --------------------------------------------------------
87
88 -- 
89 -- Structure for table `bom`
90 -- 
91
92 DROP TABLE IF EXISTS `0_bom`;
93 CREATE TABLE IF NOT EXISTS `0_bom` (
94   `id` int(11) NOT NULL auto_increment,
95   `parent` char(20) NOT NULL default '',
96   `component` char(20) NOT NULL default '',
97   `workcentre_added` char(5) NOT NULL default '',
98   `loc_code` char(5) NOT NULL default '',
99   `quantity` double NOT NULL default '1',
100   PRIMARY KEY  (`parent`,`component`,`workcentre_added`,`loc_code`),
101   KEY `component` (`component`),
102   KEY `id` (`id`),
103   KEY `loc_code` (`loc_code`),
104   KEY `parent` (`parent`,`loc_code`),
105   KEY `Parent_2` (`parent`),
106   KEY `workcentre_added` (`workcentre_added`)
107 ) TYPE=MyISAM;
108
109 -- --------------------------------------------------------
110
111 -- 
112 -- Structure for table `budget_trans`
113 -- 
114
115 DROP TABLE IF EXISTS `0_budget_trans`;
116 CREATE TABLE IF NOT EXISTS `0_budget_trans` (
117   `counter` int(11) NOT NULL auto_increment,
118   `type` smallint(6) NOT NULL default '0',
119   `type_no` bigint(16) NOT NULL default '1',
120   `tran_date` date NOT NULL default '0000-00-00',
121   `account` varchar(11) NOT NULL default '',
122   `memo_` tinytext NOT NULL,
123   `amount` double NOT NULL default '0',
124   `dimension_id` int(11) default '0',
125   `dimension2_id` int(11) default '0',
126   `person_type_id` int(11) default NULL,
127   `person_id` tinyblob,
128   PRIMARY KEY  (`counter`),
129   KEY `Type_and_Number` (`type`,`type_no`)
130 ) TYPE=InnoDB;
131
132 -- --------------------------------------------------------
133
134 -- 
135 -- Structure for table `chart_class`
136 -- 
137
138 DROP TABLE IF EXISTS `0_chart_class`;
139 CREATE TABLE IF NOT EXISTS `0_chart_class` (
140   `cid` int(11) NOT NULL default '0',
141   `class_name` varchar(60) NOT NULL default '',
142   `balance_sheet` tinyint(1) NOT NULL default '0',
143   PRIMARY KEY  (`cid`)
144 ) TYPE=MyISAM;
145
146 -- --------------------------------------------------------
147
148 -- 
149 -- Structure for table `chart_master`
150 -- 
151
152 DROP TABLE IF EXISTS `0_chart_master`;
153 CREATE TABLE IF NOT EXISTS `0_chart_master` (
154   `account_code` varchar(11) NOT NULL default '',
155   `account_code2` varchar(11) default '',
156   `account_name` varchar(60) NOT NULL default '',
157   `account_type` int(11) NOT NULL default '0',
158   `tax_code` int(11) NOT NULL default '0',
159   PRIMARY KEY  (`account_code`),
160   KEY `account_code` (`account_code`),
161   KEY `account_name` (`account_name`)
162 ) TYPE=MyISAM;
163
164 -- --------------------------------------------------------
165
166 -- 
167 -- Structure for table `chart_types`
168 -- 
169
170 DROP TABLE IF EXISTS `0_chart_types`;
171 CREATE TABLE IF NOT EXISTS `0_chart_types` (
172   `id` int(11) NOT NULL auto_increment,
173   `name` varchar(60) NOT NULL default '',
174   `class_id` tinyint(1) NOT NULL default '0',
175   `parent` int(11) NOT NULL default '-1',
176   PRIMARY KEY  (`id`),
177   UNIQUE KEY `name` (`name`)
178 ) TYPE=MyISAM;
179
180 -- --------------------------------------------------------
181
182 -- 
183 -- Structure for table `comments`
184 -- 
185
186 DROP TABLE IF EXISTS `0_comments`;
187 CREATE TABLE IF NOT EXISTS `0_comments` (
188   `type` int(11) NOT NULL default '0',
189   `id` int(11) NOT NULL default '0',
190   `date_` date default '0000-00-00',
191   `memo_` tinytext
192 ) TYPE=InnoDB;
193
194 -- --------------------------------------------------------
195
196 -- 
197 -- Structure for table `company`
198 -- 
199
200 DROP TABLE IF EXISTS `0_company`;
201 CREATE TABLE IF NOT EXISTS `0_company` (
202   `coy_code` int(11) NOT NULL default '1',
203   `coy_name` varchar(60) NOT NULL default '',
204   `gst_no` varchar(25) NOT NULL default '',
205   `coy_no` varchar(25) NOT NULL default '0',
206   `tax_prd` int(11) NOT NULL default '1',
207   `tax_last` int(11) NOT NULL default '1',
208   `postal_address` tinytext NOT NULL,
209   `phone` varchar(30) NOT NULL default '',
210   `fax` varchar(30) NOT NULL default '',
211   `email` varchar(100) NOT NULL default '',
212   `coy_logo` varchar(100) NOT NULL default '',
213   `domicile` varchar(55) NOT NULL default '',
214   `curr_default` char(3) NOT NULL default '',
215   `debtors_act` varchar(11) NOT NULL default '',
216   `pyt_discount_act` varchar(11) NOT NULL default '',
217   `creditors_act` varchar(11) NOT NULL default '',
218   `grn_act` varchar(11) NOT NULL default '',
219   `exchange_diff_act` varchar(11) NOT NULL default '',
220   `purch_exchange_diff_act` varchar(11) NOT NULL default '',
221   `retained_earnings_act` varchar(11) NOT NULL default '',
222   `freight_act` varchar(11) NOT NULL default '',
223   `default_sales_act` varchar(11) NOT NULL default '',
224   `default_sales_discount_act` varchar(11) NOT NULL default '',
225   `default_prompt_payment_act` varchar(11) NOT NULL default '',
226   `default_inventory_act` varchar(11) NOT NULL default '',
227   `default_cogs_act` varchar(11) NOT NULL default '',
228   `default_adj_act` varchar(11) NOT NULL default '',
229   `default_inv_sales_act` varchar(11) NOT NULL default '',
230   `default_assembly_act` varchar(11) NOT NULL default '',
231   `payroll_act` varchar(11) NOT NULL default '',
232   `custom1_name` varchar(60) NOT NULL default '',
233   `custom2_name` varchar(60) NOT NULL default '',
234   `custom3_name` varchar(60) NOT NULL default '',
235   `custom1_value` varchar(100) NOT NULL default '',
236   `custom2_value` varchar(100) NOT NULL default '',
237   `custom3_value` varchar(100) NOT NULL default '',
238   `allow_negative_stock` tinyint(1) NOT NULL default '0',
239   `po_over_receive` int(11) NOT NULL default '10',
240   `po_over_charge` int(11) NOT NULL default '10',
241   `default_credit_limit` int(11) NOT NULL default '1000',
242   `default_workorder_required` int(11) NOT NULL default '20',
243   `default_dim_required` int(11) NOT NULL default '20',
244   `past_due_days` int(11) NOT NULL default '30',
245   `use_dimension` tinyint(1) default '0',
246   `f_year` int(11) NOT NULL default '1',
247   PRIMARY KEY  (`coy_code`)
248 ) TYPE=MyISAM;
249
250 -- --------------------------------------------------------
251
252 -- 
253 -- Structure for table `credit_status`
254 -- 
255
256 DROP TABLE IF EXISTS `0_credit_status`;
257 CREATE TABLE IF NOT EXISTS `0_credit_status` (
258   `id` int(11) NOT NULL auto_increment,
259   `reason_description` char(100) NOT NULL default '',
260   `dissallow_invoices` tinyint(1) NOT NULL default '0',
261   PRIMARY KEY  (`id`),
262   UNIQUE KEY `reason_description` (`reason_description`)
263 ) TYPE=MyISAM;
264
265 -- --------------------------------------------------------
266
267 -- 
268 -- Structure for table `currencies`
269 -- 
270
271 DROP TABLE IF EXISTS `0_currencies`;
272 CREATE TABLE IF NOT EXISTS `0_currencies` (
273   `currency` varchar(60) NOT NULL default '',
274   `curr_abrev` char(3) NOT NULL default '',
275   `curr_symbol` varchar(10) NOT NULL default '',
276   `country` varchar(100) NOT NULL default '',
277   `hundreds_name` varchar(15) NOT NULL default '',
278   PRIMARY KEY  (`curr_abrev`)
279 ) TYPE=MyISAM;
280
281 -- --------------------------------------------------------
282
283 -- 
284 -- Structure for table `cust_allocations`
285 -- 
286
287 DROP TABLE IF EXISTS `0_cust_allocations`;
288 CREATE TABLE IF NOT EXISTS `0_cust_allocations` (
289   `id` int(11) NOT NULL auto_increment,
290   `amt` double unsigned default NULL,
291   `date_alloc` date NOT NULL default '0000-00-00',
292   `trans_no_from` int(11) default NULL,
293   `trans_type_from` int(11) default NULL,
294   `trans_no_to` int(11) default NULL,
295   `trans_type_to` int(11) default NULL,
296   PRIMARY KEY  (`id`)
297 ) TYPE=InnoDB;
298
299 -- --------------------------------------------------------
300
301 -- 
302 -- Structure for table `cust_branch`
303 -- 
304
305 DROP TABLE IF EXISTS `0_cust_branch`;
306 CREATE TABLE IF NOT EXISTS `0_cust_branch` (
307   `branch_code` int(11) NOT NULL auto_increment,
308   `debtor_no` int(11) NOT NULL default '0',
309   `br_name` varchar(60) NOT NULL default '',
310   `br_address` tinytext NOT NULL,
311   `area` int(11) default NULL,
312   `salesman` int(11) NOT NULL default '0',
313   `phone` varchar(30) NOT NULL default '',
314   `fax` varchar(30) NOT NULL default '',
315   `contact_name` varchar(60) NOT NULL default '',
316   `email` varchar(100) NOT NULL default '',
317   `default_location` varchar(5) NOT NULL default '',
318   `tax_group_id` int(11) default NULL,
319   `sales_account` varchar(11) default NULL,
320   `sales_discount_account` varchar(11) default NULL,
321   `receivables_account` varchar(11) default NULL,
322   `payment_discount_account` varchar(11) default NULL,
323   `default_ship_via` int(11) NOT NULL default '1',
324   `disable_trans` tinyint(4) NOT NULL default '0',
325   `br_post_address` tinytext NOT NULL,
326   PRIMARY KEY  (`branch_code`,`debtor_no`),
327   KEY `branch_code` (`branch_code`),
328   KEY `br_name` (`br_name`)
329 ) TYPE=MyISAM;
330
331 -- --------------------------------------------------------
332
333 -- 
334 -- Structure for table `debtor_trans`
335 -- 
336
337 DROP TABLE IF EXISTS `0_debtor_trans`;
338 CREATE TABLE IF NOT EXISTS `0_debtor_trans` (
339   `trans_no` int(11) unsigned NOT NULL default '0',
340   `type` smallint(6) unsigned NOT NULL default '0',
341   `debtor_no` int(11) unsigned default NULL,
342   `branch_code` int(11) NOT NULL default '-1',
343   `tran_date` date NOT NULL default '0000-00-00',
344   `due_date` date NOT NULL default '0000-00-00',
345   `reference` varchar(60) NOT NULL default '',
346   `tpe` int(11) NOT NULL default '0',
347   `order_` int(11) NOT NULL default '0',
348   `ov_amount` double NOT NULL default '0',
349   `ov_gst` double NOT NULL default '0',
350   `ov_freight` double NOT NULL default '0',
351   `ov_discount` double NOT NULL default '0',
352   `alloc` double NOT NULL default '0',
353   `rate` double NOT NULL default '1',
354   `ship_via` int(11) default NULL,
355   PRIMARY KEY  (`trans_no`,`type`),
356   KEY `debtor_no` (`debtor_no`,`branch_code`)
357 ) TYPE=InnoDB;
358
359 -- --------------------------------------------------------
360
361 -- 
362 -- Structure for table `debtor_trans_details`
363 -- 
364
365 DROP TABLE IF EXISTS `0_debtor_trans_details`;
366 CREATE TABLE IF NOT EXISTS `0_debtor_trans_details` (
367   `id` int(11) NOT NULL auto_increment,
368   `debtor_trans_no` int(11) default NULL,
369   `debtor_trans_type` int(11) default NULL,
370   `stock_id` varchar(20) NOT NULL default '',
371   `description` tinytext,
372   `unit_price` double NOT NULL default '0',
373   `unit_tax` double NOT NULL default '0',
374   `quantity` double NOT NULL default '0',
375   `discount_percent` double NOT NULL default '0',
376   `standard_cost` double NOT NULL default '0',
377   PRIMARY KEY  (`id`)
378 ) TYPE=InnoDB;
379
380 -- --------------------------------------------------------
381
382 -- 
383 -- Structure for table `debtor_trans_tax_details`
384 -- 
385
386 DROP TABLE IF EXISTS `0_debtor_trans_tax_details`;
387 CREATE TABLE IF NOT EXISTS `0_debtor_trans_tax_details` (
388   `id` int(11) NOT NULL auto_increment,
389   `debtor_trans_no` int(11) default NULL,
390   `debtor_trans_type` int(11) default NULL,
391   `tax_type_id` int(11) NOT NULL default '0',
392   `tax_type_name` varchar(60) default NULL,
393   `rate` double NOT NULL default '0',
394   `included_in_price` tinyint(1) NOT NULL default '0',
395   `amount` double NOT NULL default '0',
396   PRIMARY KEY  (`id`)
397 ) TYPE=InnoDB;
398
399 -- --------------------------------------------------------
400
401 -- 
402 -- Structure for table `debtors_master`
403 -- 
404
405 DROP TABLE IF EXISTS `0_debtors_master`;
406 CREATE TABLE IF NOT EXISTS `0_debtors_master` (
407   `debtor_no` int(11) NOT NULL auto_increment,
408   `name` varchar(60) NOT NULL default '',
409   `address` tinytext,
410   `email` varchar(100) NOT NULL default '',
411   `tax_id` varchar(55) NOT NULL default '',
412   `curr_code` char(3) NOT NULL default '',
413   `sales_type` int(11) NOT NULL default '1',
414   `dimension_id` int(11) NOT NULL default '0',
415   `dimension2_id` int(11) NOT NULL default '0',
416   `credit_status` int(11) NOT NULL default '0',
417   `payment_terms` int(11) default NULL,
418   `discount` double NOT NULL default '0',
419   `pymt_discount` double NOT NULL default '0',
420   `credit_limit` float NOT NULL default '1000',
421   PRIMARY KEY  (`debtor_no`),
422   UNIQUE KEY `name` (`name`)
423 ) TYPE=MyISAM;
424
425 -- --------------------------------------------------------
426
427 -- 
428 -- Structure for table `dimensions`
429 -- 
430
431 DROP TABLE IF EXISTS `0_dimensions`;
432 CREATE TABLE IF NOT EXISTS `0_dimensions` (
433   `id` int(11) NOT NULL auto_increment,
434   `reference` varchar(60) NOT NULL default '',
435   `name` varchar(60) NOT NULL default '',
436   `type_` tinyint(1) NOT NULL default '1',
437   `closed` tinyint(1) NOT NULL default '0',
438   `date_` date NOT NULL default '0000-00-00',
439   `due_date` date NOT NULL default '0000-00-00',
440   PRIMARY KEY  (`id`),
441   UNIQUE KEY `reference` (`reference`)
442 ) TYPE=InnoDB;
443
444 -- --------------------------------------------------------
445
446 -- 
447 -- Structure for table `exchange_rates`
448 -- 
449
450 DROP TABLE IF EXISTS `0_exchange_rates`;
451 CREATE TABLE IF NOT EXISTS `0_exchange_rates` (
452   `id` int(11) NOT NULL auto_increment,
453   `curr_code` char(3) NOT NULL default '',
454   `rate_buy` double NOT NULL default '0',
455   `rate_sell` double NOT NULL default '0',
456   `date_` date NOT NULL default '0000-00-00',
457   PRIMARY KEY  (`id`),
458   UNIQUE KEY `curr_code` (`curr_code`,`date_`)
459 ) TYPE=MyISAM;
460
461 -- --------------------------------------------------------
462
463 -- 
464 -- Structure for table `fiscal_year`
465 -- 
466
467 DROP TABLE IF EXISTS `0_fiscal_year`;
468 CREATE TABLE IF NOT EXISTS `0_fiscal_year` (
469   `id` int(11) NOT NULL auto_increment,
470   `begin` date default '0000-00-00',
471   `end` date default '0000-00-00',
472   `closed` tinyint(1) NOT NULL default '0',
473   PRIMARY KEY  (`id`)
474 ) TYPE=InnoDB;
475
476 -- --------------------------------------------------------
477
478 -- 
479 -- Structure for table `form_items`
480 -- 
481
482 DROP TABLE IF EXISTS `0_form_items`;
483 CREATE TABLE IF NOT EXISTS `0_form_items` (
484   `form_id` int(11) NOT NULL default '0',
485   `form_type` int(11) NOT NULL default '0',
486   `trans_type` int(11) NOT NULL default '0',
487   `trans_id` int(11) NOT NULL default '0',
488   `param1` varchar(100) NOT NULL default '',
489   `param2` varchar(100) default NULL,
490   PRIMARY KEY  (`form_id`,`form_type`)
491 ) TYPE=InnoDB;
492
493 -- --------------------------------------------------------
494
495 -- 
496 -- Structure for table `gl_trans`
497 -- 
498
499 DROP TABLE IF EXISTS `0_gl_trans`;
500 CREATE TABLE IF NOT EXISTS `0_gl_trans` (
501   `counter` int(11) NOT NULL auto_increment,
502   `type` smallint(6) NOT NULL default '0',
503   `type_no` bigint(16) NOT NULL default '1',
504   `tran_date` date NOT NULL default '0000-00-00',
505   `account` varchar(11) NOT NULL default '',
506   `memo_` tinytext NOT NULL,
507   `amount` double NOT NULL default '0',
508   `dimension_id` int(11) NOT NULL default '0',
509   `dimension2_id` int(11) NOT NULL default '0',
510   `person_type_id` int(11) default NULL,
511   `person_id` tinyblob,
512   PRIMARY KEY  (`counter`),
513   KEY `Type_and_Number` (`type`,`type_no`)
514 ) TYPE=InnoDB;
515
516 -- --------------------------------------------------------
517
518 -- 
519 -- Structure for table `grn_batch`
520 -- 
521
522 DROP TABLE IF EXISTS `0_grn_batch`;
523 CREATE TABLE IF NOT EXISTS `0_grn_batch` (
524   `id` int(11) NOT NULL auto_increment,
525   `supplier_id` int(11) NOT NULL default '0',
526   `purch_order_no` int(11) default NULL,
527   `reference` varchar(60) NOT NULL default '',
528   `delivery_date` date NOT NULL default '0000-00-00',
529   `loc_code` varchar(5) default NULL,
530   PRIMARY KEY  (`id`)
531 ) TYPE=InnoDB;
532
533 -- --------------------------------------------------------
534
535 -- 
536 -- Structure for table `grn_items`
537 -- 
538
539 DROP TABLE IF EXISTS `0_grn_items`;
540 CREATE TABLE IF NOT EXISTS `0_grn_items` (
541   `id` int(11) NOT NULL auto_increment,
542   `grn_batch_id` int(11) default NULL,
543   `po_detail_item` int(11) NOT NULL default '0',
544   `item_code` varchar(20) NOT NULL default '',
545   `description` tinytext,
546   `qty_recd` double NOT NULL default '0',
547   `quantity_inv` double NOT NULL default '0',
548   PRIMARY KEY  (`id`)
549 ) TYPE=InnoDB;
550
551 -- --------------------------------------------------------
552
553 -- 
554 -- Structure for table `item_tax_type_exemptions`
555 -- 
556
557 DROP TABLE IF EXISTS `0_item_tax_type_exemptions`;
558 CREATE TABLE IF NOT EXISTS `0_item_tax_type_exemptions` (
559   `item_tax_type_id` int(11) NOT NULL default '0',
560   `tax_type_id` int(11) NOT NULL default '0',
561   PRIMARY KEY  (`item_tax_type_id`,`tax_type_id`)
562 ) TYPE=InnoDB;
563
564 -- --------------------------------------------------------
565
566 -- 
567 -- Structure for table `item_tax_types`
568 -- 
569
570 DROP TABLE IF EXISTS `0_item_tax_types`;
571 CREATE TABLE IF NOT EXISTS `0_item_tax_types` (
572   `id` int(11) NOT NULL auto_increment,
573   `name` varchar(60) NOT NULL default '',
574   `exempt` tinyint(1) NOT NULL default '0',
575   PRIMARY KEY  (`id`),
576   UNIQUE KEY `name` (`name`)
577 ) TYPE=InnoDB;
578
579 -- --------------------------------------------------------
580
581 -- 
582 -- Structure for table `loc_stock`
583 -- 
584
585 DROP TABLE IF EXISTS `0_loc_stock`;
586 CREATE TABLE IF NOT EXISTS `0_loc_stock` (
587   `loc_code` char(5) NOT NULL default '',
588   `stock_id` char(20) NOT NULL default '',
589   `reorder_level` bigint(20) NOT NULL default '0',
590   PRIMARY KEY  (`loc_code`,`stock_id`),
591   KEY `stock_id` (`stock_id`)
592 ) TYPE=InnoDB;
593
594 -- --------------------------------------------------------
595
596 -- 
597 -- Structure for table `locations`
598 -- 
599
600 DROP TABLE IF EXISTS `0_locations`;
601 CREATE TABLE IF NOT EXISTS `0_locations` (
602   `loc_code` varchar(5) NOT NULL default '',
603   `location_name` varchar(60) NOT NULL default '',
604   `delivery_address` tinytext NOT NULL,
605   `phone` varchar(30) NOT NULL default '',
606   `fax` varchar(30) NOT NULL default '',
607   `email` varchar(100) NOT NULL default '',
608   `contact` varchar(30) NOT NULL default '',
609   PRIMARY KEY  (`loc_code`)
610 ) TYPE=MyISAM;
611
612 -- --------------------------------------------------------
613
614 -- 
615 -- Structure for table `movement_types`
616 -- 
617
618 DROP TABLE IF EXISTS `0_movement_types`;
619 CREATE TABLE IF NOT EXISTS `0_movement_types` (
620   `id` int(11) NOT NULL auto_increment,
621   `name` varchar(60) NOT NULL default '',
622   PRIMARY KEY  (`id`),
623   UNIQUE KEY `name` (`name`)
624 ) TYPE=MyISAM;
625
626 -- --------------------------------------------------------
627
628 -- 
629 -- Structure for table `payment_terms`
630 -- 
631
632 DROP TABLE IF EXISTS `0_payment_terms`;
633 CREATE TABLE IF NOT EXISTS `0_payment_terms` (
634   `terms_indicator` int(11) NOT NULL auto_increment,
635   `terms` char(80) NOT NULL default '',
636   `days_before_due` smallint(6) NOT NULL default '0',
637   `day_in_following_month` smallint(6) NOT NULL default '0',
638   PRIMARY KEY  (`terms_indicator`),
639   UNIQUE KEY `terms` (`terms`)
640 ) TYPE=MyISAM;
641
642 -- --------------------------------------------------------
643
644 -- 
645 -- Structure for table `prices`
646 -- 
647
648 DROP TABLE IF EXISTS `0_prices`;
649 CREATE TABLE IF NOT EXISTS `0_prices` (
650   `id` int(11) NOT NULL auto_increment,
651   `stock_id` varchar(20) NOT NULL default '',
652   `sales_type_id` int(11) NOT NULL default '0',
653   `curr_abrev` char(3) NOT NULL default '',
654   `price` double NOT NULL default '0',
655   PRIMARY KEY  (`id`),
656   UNIQUE KEY `price` (`stock_id`,`sales_type_id`,`curr_abrev`)
657 ) TYPE=MyISAM;
658
659 -- --------------------------------------------------------
660
661 -- 
662 -- Structure for table `purch_data`
663 -- 
664
665 DROP TABLE IF EXISTS `0_purch_data`;
666 CREATE TABLE IF NOT EXISTS `0_purch_data` (
667   `supplier_id` int(11) NOT NULL default '0',
668   `stock_id` char(20) NOT NULL default '',
669   `price` double NOT NULL default '0',
670   `suppliers_uom` char(50) NOT NULL default '',
671   `conversion_factor` double NOT NULL default '1',
672   `supplier_description` char(50) NOT NULL default '',
673   PRIMARY KEY  (`supplier_id`,`stock_id`)
674 ) TYPE=MyISAM;
675
676 -- --------------------------------------------------------
677
678 -- 
679 -- Structure for table `purch_order_details`
680 -- 
681
682 DROP TABLE IF EXISTS `0_purch_order_details`;
683 CREATE TABLE IF NOT EXISTS `0_purch_order_details` (
684   `po_detail_item` int(11) NOT NULL auto_increment,
685   `order_no` int(11) NOT NULL default '0',
686   `item_code` varchar(20) NOT NULL default '',
687   `description` tinytext,
688   `delivery_date` date NOT NULL default '0000-00-00',
689   `qty_invoiced` double NOT NULL default '0',
690   `unit_price` double NOT NULL default '0',
691   `act_price` double NOT NULL default '0',
692   `std_cost_unit` double NOT NULL default '0',
693   `quantity_ordered` double NOT NULL default '0',
694   `quantity_received` double NOT NULL default '0',
695   PRIMARY KEY  (`po_detail_item`)
696 ) TYPE=InnoDB;
697
698 -- --------------------------------------------------------
699
700 -- 
701 -- Structure for table `purch_orders`
702 -- 
703
704 DROP TABLE IF EXISTS `0_purch_orders`;
705 CREATE TABLE IF NOT EXISTS `0_purch_orders` (
706   `order_no` int(11) NOT NULL auto_increment,
707   `supplier_id` int(11) NOT NULL default '0',
708   `comments` tinytext,
709   `ord_date` date NOT NULL default '0000-00-00',
710   `reference` tinytext NOT NULL,
711   `requisition_no` tinytext,
712   `into_stock_location` varchar(5) NOT NULL default '',
713   `delivery_address` tinytext NOT NULL,
714   PRIMARY KEY  (`order_no`)
715 ) TYPE=InnoDB;
716
717 -- --------------------------------------------------------
718
719 -- 
720 -- Structure for table `refs`
721 -- 
722
723 DROP TABLE IF EXISTS `0_refs`;
724 CREATE TABLE IF NOT EXISTS `0_refs` (
725   `id` int(11) NOT NULL default '0',
726   `type` int(11) NOT NULL default '0',
727   `reference` varchar(100) NOT NULL default '',
728   PRIMARY KEY  (`id`,`type`)
729 ) TYPE=InnoDB;
730
731 -- --------------------------------------------------------
732
733 -- 
734 -- Structure for table `sales_order_details`
735 -- 
736
737 DROP TABLE IF EXISTS `0_sales_order_details`;
738 CREATE TABLE IF NOT EXISTS `0_sales_order_details` (
739   `order_no` int(11) NOT NULL default '0',
740   `stk_code` varchar(20) NOT NULL default '',
741   `description` tinytext,
742   `qty_invoiced` double NOT NULL default '0',
743   `unit_price` double NOT NULL default '0',
744   `quantity` double NOT NULL default '0',
745   `discount_percent` double NOT NULL default '0',
746   PRIMARY KEY  (`order_no`,`stk_code`)
747 ) TYPE=InnoDB;
748
749 -- --------------------------------------------------------
750
751 -- 
752 -- Structure for table `sales_orders`
753 -- 
754
755 DROP TABLE IF EXISTS `0_sales_orders`;
756 CREATE TABLE IF NOT EXISTS `0_sales_orders` (
757   `order_no` int(11) NOT NULL auto_increment,
758   `debtor_no` int(11) NOT NULL default '0',
759   `branch_code` int(11) NOT NULL default '0',
760   `customer_ref` tinytext NOT NULL,
761   `comments` tinytext,
762   `ord_date` date NOT NULL default '0000-00-00',
763   `order_type` int(11) NOT NULL default '0',
764   `ship_via` int(11) NOT NULL default '0',
765   `delivery_address` tinytext NOT NULL,
766   `contact_phone` varchar(30) default NULL,
767   `contact_email` varchar(100) default NULL,
768   `deliver_to` tinytext NOT NULL,
769   `freight_cost` double NOT NULL default '0',
770   `from_stk_loc` varchar(5) NOT NULL default '',
771   `delivery_date` date NOT NULL default '0000-00-00',
772   PRIMARY KEY  (`order_no`)
773 ) TYPE=InnoDB;
774
775 -- --------------------------------------------------------
776
777 -- 
778 -- Structure for table `sales_types`
779 -- 
780
781 DROP TABLE IF EXISTS `0_sales_types`;
782 CREATE TABLE IF NOT EXISTS `0_sales_types` (
783   `id` int(11) NOT NULL auto_increment,
784   `sales_type` char(50) NOT NULL default '',
785   PRIMARY KEY  (`id`),
786   UNIQUE KEY `sales_type` (`sales_type`)
787 ) TYPE=MyISAM;
788
789 -- --------------------------------------------------------
790
791 -- 
792 -- Structure for table `salesman`
793 -- 
794
795 DROP TABLE IF EXISTS `0_salesman`;
796 CREATE TABLE IF NOT EXISTS `0_salesman` (
797   `salesman_code` int(11) NOT NULL auto_increment,
798   `salesman_name` char(60) NOT NULL default '',
799   `salesman_phone` char(30) NOT NULL default '',
800   `salesman_fax` char(30) NOT NULL default '',
801   `salesman_email` varchar(100) NOT NULL default '',
802   PRIMARY KEY  (`salesman_code`),
803   UNIQUE KEY `salesman_name` (`salesman_name`)
804 ) TYPE=MyISAM;
805
806 -- --------------------------------------------------------
807
808 -- 
809 -- Structure for table `shippers`
810 -- 
811
812 DROP TABLE IF EXISTS `0_shippers`;
813 CREATE TABLE IF NOT EXISTS `0_shippers` (
814   `shipper_id` int(11) NOT NULL auto_increment,
815   `shipper_name` varchar(60) NOT NULL default '',
816   `phone` varchar(30) NOT NULL default '',
817   `contact` tinytext NOT NULL,
818   `address` tinytext NOT NULL,
819   PRIMARY KEY  (`shipper_id`),
820   UNIQUE KEY `name` (`shipper_name`)
821 ) TYPE=MyISAM;
822
823 -- --------------------------------------------------------
824
825 -- 
826 -- Structure for table `stock_category`
827 -- 
828
829 DROP TABLE IF EXISTS `0_stock_category`;
830 CREATE TABLE IF NOT EXISTS `0_stock_category` (
831   `category_id` int(11) NOT NULL auto_increment,
832   `description` varchar(60) NOT NULL default '',
833   `stock_act` varchar(11) default NULL,
834   `cogs_act` varchar(11) default NULL,
835   `adj_gl_act` varchar(11) default NULL,
836   `purch_price_var_act` varchar(11) default NULL,
837   PRIMARY KEY  (`category_id`),
838   UNIQUE KEY `description` (`description`)
839 ) TYPE=MyISAM;
840
841 -- --------------------------------------------------------
842
843 -- 
844 -- Structure for table `stock_master`
845 -- 
846
847 DROP TABLE IF EXISTS `0_stock_master`;
848 CREATE TABLE IF NOT EXISTS `0_stock_master` (
849   `stock_id` varchar(20) NOT NULL default '',
850   `category_id` int(11) NOT NULL default '0',
851   `tax_type_id` int(11) NOT NULL default '0',
852   `description` varchar(200) NOT NULL default '',
853   `long_description` tinytext NOT NULL,
854   `units` varchar(20) NOT NULL default 'each',
855   `mb_flag` char(1) NOT NULL default 'B',
856   `sales_account` varchar(11) NOT NULL default '',
857   `cogs_account` varchar(11) NOT NULL default '',
858   `inventory_account` varchar(11) NOT NULL default '',
859   `adjustment_account` varchar(11) NOT NULL default '',
860   `assembly_account` varchar(11) NOT NULL default '',
861   `dimension_id` int(11) default NULL,
862   `dimension2_id` int(11) default NULL,
863   `actual_cost` double NOT NULL default '0',
864   `last_cost` double NOT NULL default '0',
865   `material_cost` double NOT NULL default '0',
866   `labour_cost` double NOT NULL default '0',
867   `overhead_cost` double NOT NULL default '0',
868   PRIMARY KEY  (`stock_id`)
869 ) TYPE=InnoDB;
870
871 -- --------------------------------------------------------
872
873 -- 
874 -- Structure for table `stock_moves`
875 -- 
876
877 DROP TABLE IF EXISTS `0_stock_moves`;
878 CREATE TABLE IF NOT EXISTS `0_stock_moves` (
879   `trans_id` int(11) NOT NULL auto_increment,
880   `trans_no` int(11) NOT NULL default '0',
881   `stock_id` char(20) NOT NULL default '',
882   `type` smallint(6) NOT NULL default '0',
883   `loc_code` char(5) NOT NULL default '',
884   `tran_date` date NOT NULL default '0000-00-00',
885   `person_id` int(11) default NULL,
886   `price` double NOT NULL default '0',
887   `reference` char(40) NOT NULL default '',
888   `qty` double NOT NULL default '1',
889   `discount_percent` double NOT NULL default '0',
890   `standard_cost` double NOT NULL default '0',
891   `visible` tinyint(1) NOT NULL default '1',
892   PRIMARY KEY  (`trans_id`),
893   KEY `type` (`type`,`trans_no`)
894 ) TYPE=InnoDB;
895
896 -- --------------------------------------------------------
897
898 -- 
899 -- Structure for table `supp_allocations`
900 -- 
901
902 DROP TABLE IF EXISTS `0_supp_allocations`;
903 CREATE TABLE IF NOT EXISTS `0_supp_allocations` (
904   `id` int(11) NOT NULL auto_increment,
905   `amt` double unsigned default NULL,
906   `date_alloc` date NOT NULL default '0000-00-00',
907   `trans_no_from` int(11) default NULL,
908   `trans_type_from` int(11) default NULL,
909   `trans_no_to` int(11) default NULL,
910   `trans_type_to` int(11) default NULL,
911   PRIMARY KEY  (`id`)
912 ) TYPE=InnoDB;
913
914 -- --------------------------------------------------------
915
916 -- 
917 -- Structure for table `supp_invoice_items`
918 -- 
919
920 DROP TABLE IF EXISTS `0_supp_invoice_items`;
921 CREATE TABLE IF NOT EXISTS `0_supp_invoice_items` (
922   `id` int(11) NOT NULL auto_increment,
923   `supp_trans_no` int(11) default NULL,
924   `supp_trans_type` int(11) default NULL,
925   `gl_code` int(11) NOT NULL default '0',
926   `grn_item_id` int(11) default NULL,
927   `po_detail_item_id` int(11) default NULL,
928   `stock_id` varchar(20) NOT NULL default '',
929   `description` tinytext,
930   `quantity` double NOT NULL default '0',
931   `unit_price` double NOT NULL default '0',
932   `unit_tax` double NOT NULL default '0',
933   `memo_` tinytext,
934   PRIMARY KEY  (`id`)
935 ) TYPE=InnoDB;
936
937 -- --------------------------------------------------------
938
939 -- 
940 -- Structure for table `supp_invoice_tax_items`
941 -- 
942
943 DROP TABLE IF EXISTS `0_supp_invoice_tax_items`;
944 CREATE TABLE IF NOT EXISTS `0_supp_invoice_tax_items` (
945   `id` int(11) NOT NULL auto_increment,
946   `supp_trans_no` int(11) default NULL,
947   `supp_trans_type` int(11) default NULL,
948   `tax_type_id` int(11) NOT NULL default '0',
949   `tax_type_name` varchar(60) default NULL,
950   `rate` double NOT NULL default '0',
951   `included_in_price` tinyint(1) NOT NULL default '0',
952   `amount` double NOT NULL default '0',
953   PRIMARY KEY  (`id`)
954 ) TYPE=InnoDB;
955
956 -- --------------------------------------------------------
957
958 -- 
959 -- Structure for table `supp_trans`
960 -- 
961
962 DROP TABLE IF EXISTS `0_supp_trans`;
963 CREATE TABLE IF NOT EXISTS `0_supp_trans` (
964   `trans_no` int(11) unsigned NOT NULL default '0',
965   `type` smallint(6) unsigned NOT NULL default '0',
966   `supplier_id` int(11) unsigned default NULL,
967   `reference` tinytext NOT NULL,
968   `supp_reference` varchar(60) NOT NULL default '',
969   `tran_date` date NOT NULL default '0000-00-00',
970   `due_date` date NOT NULL default '0000-00-00',
971   `ov_amount` double NOT NULL default '0',
972   `ov_discount` double NOT NULL default '0',
973   `ov_gst` double NOT NULL default '0',
974   `rate` double NOT NULL default '1',
975   `alloc` double NOT NULL default '0',
976   PRIMARY KEY  (`trans_no`,`type`),
977   KEY `supplier_id` (`supplier_id`),
978   KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
979   KEY `type` (`type`)
980 ) TYPE=InnoDB;
981
982 -- --------------------------------------------------------
983
984 -- 
985 -- Structure for table `suppliers`
986 -- 
987
988 DROP TABLE IF EXISTS `0_suppliers`;
989 CREATE TABLE IF NOT EXISTS `0_suppliers` (
990   `supplier_id` int(11) NOT NULL auto_increment,
991   `supp_name` varchar(60) NOT NULL default '',
992   `address` tinytext NOT NULL,
993   `email` varchar(100) NOT NULL default '',
994   `bank_account` varchar(60) NOT NULL default '',
995   `curr_code` char(3) default NULL,
996   `payment_terms` int(11) default NULL,
997   `dimension_id` int(11) default '0',
998   `dimension2_id` int(11) default '0',
999   `tax_group_id` int(11) default NULL,
1000   `purchase_account` varchar(11) default NULL,
1001   `payable_account` varchar(11) default NULL,
1002   `payment_discount_account` varchar(11) default NULL,
1003   PRIMARY KEY  (`supplier_id`)
1004 ) TYPE=MyISAM;
1005
1006 -- --------------------------------------------------------
1007
1008 -- 
1009 -- Structure for table `sys_types`
1010 -- 
1011
1012 DROP TABLE IF EXISTS `0_sys_types`;
1013 CREATE TABLE IF NOT EXISTS `0_sys_types` (
1014   `type_id` smallint(6) NOT NULL default '0',
1015   `type_name` varchar(60) NOT NULL default '',
1016   `type_no` int(11) NOT NULL default '1',
1017   `next_reference` varchar(100) NOT NULL default '',
1018   PRIMARY KEY  (`type_id`)
1019 ) TYPE=InnoDB;
1020
1021 -- --------------------------------------------------------
1022
1023 -- 
1024 -- Structure for table `tax_group_items`
1025 -- 
1026
1027 DROP TABLE IF EXISTS `0_tax_group_items`;
1028 CREATE TABLE IF NOT EXISTS `0_tax_group_items` (
1029   `tax_group_id` int(11) NOT NULL default '0',
1030   `tax_type_id` int(11) NOT NULL default '0',
1031   `rate` double NOT NULL default '0',
1032   `included_in_price` tinyint(1) NOT NULL default '0',
1033   PRIMARY KEY  (`tax_group_id`,`tax_type_id`)
1034 ) TYPE=InnoDB;
1035
1036 -- --------------------------------------------------------
1037
1038 -- 
1039 -- Structure for table `tax_groups`
1040 -- 
1041
1042 DROP TABLE IF EXISTS `0_tax_groups`;
1043 CREATE TABLE IF NOT EXISTS `0_tax_groups` (
1044   `id` int(11) NOT NULL auto_increment,
1045   `name` varchar(60) NOT NULL default '',
1046   `tax_shipping` tinyint(1) NOT NULL default '0',
1047   PRIMARY KEY  (`id`),
1048   UNIQUE KEY `name` (`name`)
1049 ) TYPE=InnoDB;
1050
1051 -- --------------------------------------------------------
1052
1053 -- 
1054 -- Structure for table `tax_types`
1055 -- 
1056
1057 DROP TABLE IF EXISTS `0_tax_types`;
1058 CREATE TABLE IF NOT EXISTS `0_tax_types` (
1059   `id` int(11) NOT NULL auto_increment,
1060   `rate` double NOT NULL default '0',
1061   `sales_gl_code` varchar(11) NOT NULL default '',
1062   `purchasing_gl_code` varchar(11) NOT NULL default '',
1063   `name` varchar(60) NOT NULL default '',
1064   `out` tinyint(1) NOT NULL default '1',
1065   PRIMARY KEY  (`id`),
1066   UNIQUE KEY `name` (`name`)
1067 ) TYPE=InnoDB;
1068
1069 -- --------------------------------------------------------
1070
1071 -- 
1072 -- Structure for table `users`
1073 -- 
1074
1075 DROP TABLE IF EXISTS `0_users`;
1076 CREATE TABLE IF NOT EXISTS `0_users` (
1077   `user_id` varchar(60) NOT NULL default '',
1078   `password` varchar(100) NOT NULL default '',
1079   `real_name` varchar(100) NOT NULL default '',
1080   `full_access` int(11) NOT NULL default '1',
1081   `phone` varchar(30) NOT NULL default '',
1082   `email` varchar(100) default NULL,
1083   `language` varchar(20) default NULL,
1084   `date_format` tinyint(1) NOT NULL default '0',
1085   `date_sep` tinyint(1) NOT NULL default '0',
1086   `tho_sep` tinyint(1) NOT NULL default '0',
1087   `dec_sep` tinyint(1) NOT NULL default '0',
1088   `theme` varchar(20) NOT NULL default 'default',
1089   `page_size` varchar(20) NOT NULL default 'A4',
1090   `prices_dec` smallint(6) NOT NULL default '2',
1091   `qty_dec` smallint(6) NOT NULL default '2',
1092   `rates_dec` smallint(6) NOT NULL default '4',
1093   `percent_dec` smallint(6) NOT NULL default '1',
1094   `show_gl` tinyint(1) NOT NULL default '1',
1095   `show_codes` tinyint(1) NOT NULL default '0',
1096   `last_visit_date` datetime default NULL,
1097   PRIMARY KEY  (`user_id`)
1098 ) TYPE=MyISAM;
1099
1100 -- --------------------------------------------------------
1101
1102 -- 
1103 -- Structure for table `voided`
1104 -- 
1105
1106 DROP TABLE IF EXISTS `0_voided`;
1107 CREATE TABLE IF NOT EXISTS `0_voided` (
1108   `type` int(11) NOT NULL default '0',
1109   `id` int(11) NOT NULL default '0',
1110   `date_` date NOT NULL default '0000-00-00',
1111   `memo_` tinytext NOT NULL,
1112   UNIQUE KEY `id` (`type`,`id`)
1113 ) TYPE=InnoDB;
1114
1115 -- --------------------------------------------------------
1116
1117 -- 
1118 -- Structure for table `wo_issue_items`
1119 -- 
1120
1121 DROP TABLE IF EXISTS `0_wo_issue_items`;
1122 CREATE TABLE IF NOT EXISTS `0_wo_issue_items` (
1123   `id` int(11) NOT NULL auto_increment,
1124   `stock_id` varchar(40) default NULL,
1125   `issue_id` int(11) default NULL,
1126   `qty_issued` double default NULL,
1127   PRIMARY KEY  (`id`)
1128 ) TYPE=InnoDB;
1129
1130 -- --------------------------------------------------------
1131
1132 -- 
1133 -- Structure for table `wo_issues`
1134 -- 
1135
1136 DROP TABLE IF EXISTS `0_wo_issues`;
1137 CREATE TABLE IF NOT EXISTS `0_wo_issues` (
1138   `issue_no` int(11) NOT NULL auto_increment,
1139   `workorder_id` int(11) NOT NULL default '0',
1140   `reference` varchar(100) default NULL,
1141   `issue_date` date default NULL,
1142   `loc_code` varchar(5) default NULL,
1143   `workcentre_id` int(11) default NULL,
1144   PRIMARY KEY  (`issue_no`)
1145 ) TYPE=InnoDB;
1146
1147 -- --------------------------------------------------------
1148
1149 -- 
1150 -- Structure for table `wo_manufacture`
1151 -- 
1152
1153 DROP TABLE IF EXISTS `0_wo_manufacture`;
1154 CREATE TABLE IF NOT EXISTS `0_wo_manufacture` (
1155   `id` int(11) NOT NULL auto_increment,
1156   `reference` varchar(100) default NULL,
1157   `workorder_id` int(11) NOT NULL default '0',
1158   `quantity` double NOT NULL default '0',
1159   `date_` date NOT NULL default '0000-00-00',
1160   PRIMARY KEY  (`id`)
1161 ) TYPE=InnoDB;
1162
1163 -- --------------------------------------------------------
1164
1165 -- 
1166 -- Structure for table `wo_requirements`
1167 -- 
1168
1169 DROP TABLE IF EXISTS `0_wo_requirements`;
1170 CREATE TABLE IF NOT EXISTS `0_wo_requirements` (
1171   `id` int(11) NOT NULL auto_increment,
1172   `workorder_id` int(11) NOT NULL default '0',
1173   `stock_id` char(20) NOT NULL default '',
1174   `workcentre` char(5) NOT NULL default '',
1175   `units_req` double NOT NULL default '1',
1176   `std_cost` double NOT NULL default '0',
1177   `loc_code` char(5) NOT NULL default '',
1178   `units_issued` double NOT NULL default '0',
1179   PRIMARY KEY  (`id`)
1180 ) TYPE=InnoDB;
1181
1182 -- --------------------------------------------------------
1183
1184 -- 
1185 -- Structure for table `workcentres`
1186 -- 
1187
1188 DROP TABLE IF EXISTS `0_workcentres`;
1189 CREATE TABLE IF NOT EXISTS `0_workcentres` (
1190   `id` int(11) NOT NULL auto_increment,
1191   `name` char(40) NOT NULL default '',
1192   `description` char(50) NOT NULL default '',
1193   PRIMARY KEY  (`id`),
1194   UNIQUE KEY `name` (`name`)
1195 ) TYPE=MyISAM;
1196
1197 -- --------------------------------------------------------
1198
1199 -- 
1200 -- Structure for table `workorders`
1201 -- 
1202
1203 DROP TABLE IF EXISTS `0_workorders`;
1204 CREATE TABLE IF NOT EXISTS `0_workorders` (
1205   `id` int(11) NOT NULL auto_increment,
1206   `wo_ref` varchar(60) NOT NULL default '',
1207   `loc_code` varchar(5) NOT NULL default '',
1208   `units_reqd` double NOT NULL default '1',
1209   `stock_id` varchar(20) NOT NULL default '',
1210   `date_` date NOT NULL default '0000-00-00',
1211   `type` tinyint(4) NOT NULL default '0',
1212   `required_by` date NOT NULL default '0000-00-00',
1213   `released_date` date NOT NULL default '0000-00-00',
1214   `units_issued` double NOT NULL default '0',
1215   `closed` tinyint(1) NOT NULL default '0',
1216   `released` tinyint(1) NOT NULL default '0',
1217   `additional_costs` double NOT NULL default '0',
1218   PRIMARY KEY  (`id`),
1219   UNIQUE KEY `wo_ref` (`wo_ref`)
1220 ) TYPE=InnoDB;
1221
1222 -- --------------------------------------------------------
1223
1224 -- 
1225 -- Data in table `bank_accounts`
1226 -- 
1227
1228 INSERT INTO `0_bank_accounts` VALUES ('1700', 0, 'Current account', 'N/A', 'N/A', NULL, 'USD');
1229 INSERT INTO `0_bank_accounts` VALUES ('1705', 0, 'Petty Cash account', 'N/A', 'N/A', NULL, 'USD');
1230
1231 -- 
1232 -- Data in table `bank_trans_types`
1233 -- 
1234
1235 INSERT INTO `0_bank_trans_types` VALUES (1, 'Cash');
1236 INSERT INTO `0_bank_trans_types` VALUES (2, 'Transfer');
1237
1238 -- 
1239 -- Data in table `chart_class`
1240 -- 
1241
1242 INSERT INTO `0_chart_class` VALUES (1, 'Assets', 1);
1243 INSERT INTO `0_chart_class` VALUES (2, 'Liabilities', 1);
1244 INSERT INTO `0_chart_class` VALUES (3, 'Income', 0);
1245 INSERT INTO `0_chart_class` VALUES (4, 'Costs', 0);
1246
1247 -- 
1248 -- Data in table `chart_master`
1249 -- 
1250
1251 INSERT INTO `0_chart_master` VALUES ('3000', NULL, 'Sales', 1, 1);
1252 INSERT INTO `0_chart_master` VALUES ('3010', NULL, 'Sales  - Wholesale', 1, 1);
1253 INSERT INTO `0_chart_master` VALUES ('3020', NULL, 'Sales of Other items', 1, 1);
1254 INSERT INTO `0_chart_master` VALUES ('3400', NULL, 'Difference On Exchange', 1, 0);
1255 INSERT INTO `0_chart_master` VALUES ('5000', NULL, 'Direct Labour', 2, 0);
1256 INSERT INTO `0_chart_master` VALUES ('5050', NULL, 'Direct Labour Recovery', 2, 0);
1257 INSERT INTO `0_chart_master` VALUES ('4200', NULL, 'Material Usage Varaiance', 2, 4);
1258 INSERT INTO `0_chart_master` VALUES ('4210', NULL, 'Consumable Materials', 2, 4);
1259 INSERT INTO `0_chart_master` VALUES ('4220', NULL, 'Purchase price Variance', 2, 0);
1260 INSERT INTO `0_chart_master` VALUES ('4000', NULL, 'Purchases of materials', 2, 4);
1261 INSERT INTO `0_chart_master` VALUES ('4250', NULL, 'Discounts Received', 2, 0);
1262 INSERT INTO `0_chart_master` VALUES ('4260', NULL, 'Exchange Variation', 2, 0);
1263 INSERT INTO `0_chart_master` VALUES ('4300', NULL, 'Freight Inwards', 2, 4);
1264 INSERT INTO `0_chart_master` VALUES ('4010', NULL, 'Cost of Goods Sold - Retail', 2, 4);
1265 INSERT INTO `0_chart_master` VALUES ('6790', NULL, 'Bank Charges', 5, 4);
1266 INSERT INTO `0_chart_master` VALUES ('6800', NULL, 'Entertainments', 5, 4);
1267 INSERT INTO `0_chart_master` VALUES ('6810', NULL, 'Legal Expenses', 5, 4);
1268 INSERT INTO `0_chart_master` VALUES ('6600', NULL, 'Repairs and Maintenance Office', 5, 4);
1269 INSERT INTO `0_chart_master` VALUES ('6730', NULL, 'phone', 5, 4);
1270 INSERT INTO `0_chart_master` VALUES ('8200', NULL, 'Bank Interest', 52, 0);
1271 INSERT INTO `0_chart_master` VALUES ('6840', NULL, 'Credit Control', 5, 0);
1272 INSERT INTO `0_chart_master` VALUES ('7040', NULL, 'Depreciation Office Equipment', 51, 0);
1273 INSERT INTO `0_chart_master` VALUES ('3800', NULL, 'Freight Outwards', 5, 4);
1274 INSERT INTO `0_chart_master` VALUES ('4500', NULL, 'Packaging', 5, 4);
1275 INSERT INTO `0_chart_master` VALUES ('6400', NULL, 'Commissions', 5, 0);
1276 INSERT INTO `0_chart_master` VALUES ('3200', NULL, 'Prompt Payment Discounts', 1, 0);
1277 INSERT INTO `0_chart_master` VALUES ('6700', NULL, 'General Expenses', 5, 4);
1278 INSERT INTO `0_chart_master` VALUES ('5200', NULL, 'Indirect Labour', 2, 0);
1279 INSERT INTO `0_chart_master` VALUES ('5210', NULL, 'Overhead Recovery', 5, 0);
1280 INSERT INTO `0_chart_master` VALUES ('1700', NULL, 'Bank account', 10, 0);
1281 INSERT INTO `0_chart_master` VALUES ('1705', NULL, 'Petty Cash', 10, 0);
1282 INSERT INTO `0_chart_master` VALUES ('1710', NULL, 'Foreign currency account', 10, 0);
1283 INSERT INTO `0_chart_master` VALUES ('1500', NULL, 'Accounts Receivable', 20, 0);
1284 INSERT INTO `0_chart_master` VALUES ('1400', NULL, 'Stocks of Raw Materials', 45, 0);
1285 INSERT INTO `0_chart_master` VALUES ('1410', NULL, 'Stocks of Work In Progress', 45, 0);
1286 INSERT INTO `0_chart_master` VALUES ('1420', NULL, 'Stocks of Finsihed Goods', 45, 0);
1287 INSERT INTO `0_chart_master` VALUES ('1430', NULL, 'Goods Received Clearing account', 30, 0);
1288 INSERT INTO `0_chart_master` VALUES ('2630', NULL, 'Accounts Payable', 30, 0);
1289 INSERT INTO `0_chart_master` VALUES ('2660', NULL, 'VAT out 5', 30, 0);
1290 INSERT INTO `0_chart_master` VALUES ('2662', NULL, 'VAT out 1', 30, 0);
1291 INSERT INTO `0_chart_master` VALUES ('2664', NULL, 'VAT out 25', 30, 0);
1292 INSERT INTO `0_chart_master` VALUES ('2680', NULL, 'VAT In 5', 30, 0);
1293 INSERT INTO `0_chart_master` VALUES ('2682', NULL, 'VAT In 25', 30, 0);
1294 INSERT INTO `0_chart_master` VALUES ('2050', NULL, 'Retained Earnings', 50, 0);
1295 INSERT INTO `0_chart_master` VALUES ('2000', NULL, 'Share Capital', 50, 0);
1296
1297 -- 
1298 -- Data in table `chart_types`
1299 -- 
1300
1301 INSERT INTO `0_chart_types` VALUES (1, 'Sales', 3, -1);
1302 INSERT INTO `0_chart_types` VALUES (2, 'Cost of Sales', 4, -1);
1303 INSERT INTO `0_chart_types` VALUES (5, 'Expenses', 4, -1);
1304 INSERT INTO `0_chart_types` VALUES (10, 'Cash/Bank', 1, -1);
1305 INSERT INTO `0_chart_types` VALUES (20, 'Accounts Receivable', 1, -1);
1306 INSERT INTO `0_chart_types` VALUES (30, 'Accounts Payable', 2, -1);
1307 INSERT INTO `0_chart_types` VALUES (40, 'Fixed Assets', 1, -1);
1308 INSERT INTO `0_chart_types` VALUES (45, 'Inventory', 1, -1);
1309 INSERT INTO `0_chart_types` VALUES (50, 'Equity', 2, -1);
1310 INSERT INTO `0_chart_types` VALUES (51, 'Depreciations', 4, -1);
1311 INSERT INTO `0_chart_types` VALUES (52, 'Financials', 4, -1);
1312
1313 -- 
1314 -- Data in table `company`
1315 -- 
1316
1317 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, 0);
1318
1319 -- 
1320 -- Data in table `credit_status`
1321 -- 
1322
1323 INSERT INTO `0_credit_status` VALUES (1, 'Good History', 0);
1324 INSERT INTO `0_credit_status` VALUES (3, 'No more work until payment received', 1);
1325 INSERT INTO `0_credit_status` VALUES (4, 'In liquidation', 1);
1326
1327 -- 
1328 -- Data in table `currencies`
1329 -- 
1330
1331 INSERT INTO `0_currencies` VALUES ('Kronor', 'SEK', 'kr', 'Sweden', '?ren');
1332 INSERT INTO `0_currencies` VALUES ('Kroner', 'DKK', 'kr.', 'Denmark', '?re');
1333 INSERT INTO `0_currencies` VALUES ('Euro', 'EUR', '?', 'Europe', 'Cents');
1334 INSERT INTO `0_currencies` VALUES ('Pounds', 'GBP', '?', 'England', 'Pence');
1335 INSERT INTO `0_currencies` VALUES ('US Dollars', 'USD', '$', 'United States', 'Cents');
1336
1337 -- 
1338 -- Data in table `locations`
1339 -- 
1340
1341 INSERT INTO `0_locations` VALUES ('DEF', 'Default', 'N/A', '', '', '', '');
1342
1343 -- 
1344 -- Data in table `movement_types`
1345 -- 
1346
1347 INSERT INTO `0_movement_types` VALUES (1, 'Adjustment');
1348
1349 -- 
1350 -- Data in table `payment_terms`
1351 -- 
1352
1353 INSERT INTO `0_payment_terms` VALUES (1, 'Due 15th Of the Following Month', 0, 17);
1354 INSERT INTO `0_payment_terms` VALUES (2, 'Due By End Of The Following Month', 0, 30);
1355 INSERT INTO `0_payment_terms` VALUES (3, 'Payment due within 10 days', 10, 0);
1356 INSERT INTO `0_payment_terms` VALUES (4, 'Cash Only', 1, 0);
1357
1358 -- 
1359 -- Data in table `sales_types`
1360 -- 
1361
1362 INSERT INTO `0_sales_types` VALUES (1, 'Retail');
1363 INSERT INTO `0_sales_types` VALUES (2, 'Wholesale');
1364
1365 -- 
1366 -- Data in table `salesman`
1367 -- 
1368
1369 INSERT INTO `0_salesman` VALUES (1, 'Sales Person', '', '', '');
1370
1371 -- 
1372 -- Data in table `shippers`
1373 -- 
1374
1375 INSERT INTO `0_shippers` VALUES (1, 'Default', '', '', '');
1376
1377 -- 
1378 -- Data in table `stock_category`
1379 -- 
1380
1381 INSERT INTO `0_stock_category` VALUES (1, 'Components', NULL, NULL, NULL, NULL);
1382 INSERT INTO `0_stock_category` VALUES (2, 'Charges', NULL, NULL, NULL, NULL);
1383 INSERT INTO `0_stock_category` VALUES (3, 'Systems', NULL, NULL, NULL, NULL);
1384 INSERT INTO `0_stock_category` VALUES (4, 'Services', NULL, NULL, NULL, NULL);
1385
1386 -- 
1387 -- Data in table `sys_types`
1388 -- 
1389
1390 INSERT INTO `0_sys_types` VALUES (0, 'Journal - GL', 17, '0');
1391 INSERT INTO `0_sys_types` VALUES (1, 'Payment - GL', 7, '0');
1392 INSERT INTO `0_sys_types` VALUES (2, 'Receipt - GL', 4, '0');
1393 INSERT INTO `0_sys_types` VALUES (4, 'Funds Transfer', 3, '0');
1394 INSERT INTO `0_sys_types` VALUES (10, 'Sales Invoice', 16, '0');
1395 INSERT INTO `0_sys_types` VALUES (11, 'Credit Note', 2, '0');
1396 INSERT INTO `0_sys_types` VALUES (12, 'Receipt', 6, '0');
1397 INSERT INTO `0_sys_types` VALUES (16, 'Location Transfer', 2, '0');
1398 INSERT INTO `0_sys_types` VALUES (17, 'Inventory Adjustment', 2, '0');
1399 INSERT INTO `0_sys_types` VALUES (18, 'Purchase Order', 1, '0');
1400 INSERT INTO `0_sys_types` VALUES (20, 'Supplier Invoice', 6, '0');
1401 INSERT INTO `0_sys_types` VALUES (21, 'Supplier Credit Note', 1, '0');
1402 INSERT INTO `0_sys_types` VALUES (22, 'Supplier Payment', 3, '0');
1403 INSERT INTO `0_sys_types` VALUES (25, 'Purchase Order Delivery', 1, '0');
1404 INSERT INTO `0_sys_types` VALUES (26, 'Work Order', 1, '0');
1405 INSERT INTO `0_sys_types` VALUES (28, 'Work Order Issue', 1, '0');
1406 INSERT INTO `0_sys_types` VALUES (29, 'Work Order Production', 1, '0');
1407 INSERT INTO `0_sys_types` VALUES (30, 'Sales Order', 1, '');
1408 INSERT INTO `0_sys_types` VALUES (35, 'Cost Update', 1, '');
1409 INSERT INTO `0_sys_types` VALUES (40, 'Dimension', 1, '3');
1410
1411 -- 
1412 -- Data in table `users`
1413 -- 
1414
1415 INSERT INTO `0_users` VALUES ('demouser', '5f4dcc3b5aa765d61d8327deb882cf99', 'Demo User', 1, '999-999-999', 'demo@demo.nu', 'en_US', 0, 0, 0, 0, 'default', 'Letter', 2, 2, 3, 1, 1, 0, '2007-02-06 19:02:35');
1416 INSERT INTO `0_users` VALUES ('admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', 2, '', 'info@frontaccounting.com', 'en_US', 0, 0, 0, 0, 'default', 'Letter', 2, 2, 4, 1, 1, 0, '2007-03-20 10:52:46');
1417