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