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