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