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