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