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