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