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