Added graphics for cancel. (door-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-26 10:11
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   `bank_trans_type_id` int(10) unsigned default NULL,
91   `amount` double default NULL,
92   `dimension_id` int(11) NOT NULL default '0',
93   `dimension2_id` int(11) NOT NULL default '0',
94   `person_type_id` int(11) NOT NULL default '0',
95   `person_id` tinyblob,
96   `reconciled` date default NULL,
97   PRIMARY KEY  (`id`),
98   KEY `bank_act` (`bank_act`,`ref`),
99   KEY `type` (`type`,`trans_no`)
100 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
101
102
103 ### Data of table `0_bank_trans` ###
104
105
106
107 ### Structure of table `0_bom` ###
108
109 DROP TABLE IF EXISTS `0_bom`;
110
111 CREATE TABLE `0_bom` (
112   `id` int(11) NOT NULL auto_increment,
113   `parent` char(20) NOT NULL default '',
114   `component` char(20) NOT NULL default '',
115   `workcentre_added` int(11) NOT NULL default '0',
116   `loc_code` char(5) NOT NULL default '',
117   `quantity` double NOT NULL default '1',
118   PRIMARY KEY  (`parent`,`component`,`workcentre_added`,`loc_code`),
119   KEY `component` (`component`),
120   KEY `id` (`id`),
121   KEY `loc_code` (`loc_code`),
122   KEY `parent` (`parent`,`loc_code`),
123   KEY `Parent_2` (`parent`),
124   KEY `workcentre_added` (`workcentre_added`)
125 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
126
127
128 ### Data of table `0_bom` ###
129
130
131
132 ### Structure of table `0_budget_trans` ###
133
134 DROP TABLE IF EXISTS `0_budget_trans`;
135
136 CREATE TABLE `0_budget_trans` (
137   `counter` int(11) NOT NULL auto_increment,
138   `type` smallint(6) NOT NULL default '0',
139   `type_no` bigint(16) NOT NULL default '1',
140   `tran_date` date NOT NULL default '0000-00-00',
141   `account` varchar(11) NOT NULL default '',
142   `memo_` tinytext NOT NULL,
143   `amount` double NOT NULL default '0',
144   `dimension_id` int(11) default '0',
145   `dimension2_id` int(11) default '0',
146   `person_type_id` int(11) default NULL,
147   `person_id` tinyblob,
148   PRIMARY KEY  (`counter`),
149   KEY `Type_and_Number` (`type`,`type_no`)
150 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
151
152
153 ### Data of table `0_budget_trans` ###
154
155
156
157 ### Structure of table `0_chart_class` ###
158
159 DROP TABLE IF EXISTS `0_chart_class`;
160
161 CREATE TABLE `0_chart_class` (
162   `cid` int(11) NOT NULL default '0',
163   `class_name` varchar(60) NOT NULL default '',
164   `balance_sheet` tinyint(1) NOT NULL default '0',
165   PRIMARY KEY  (`cid`)
166 ) TYPE=MyISAM  ;
167
168
169 ### Data of table `0_chart_class` ###
170
171 INSERT INTO `0_chart_class` VALUES ('1', 'Assets', '1');
172 INSERT INTO `0_chart_class` VALUES ('2', 'Liabilities', '1');
173 INSERT INTO `0_chart_class` VALUES ('3', 'Income', '0');
174 INSERT INTO `0_chart_class` VALUES ('4', 'Costs', '0');
175
176
177 ### Structure of table `0_chart_master` ###
178
179 DROP TABLE IF EXISTS `0_chart_master`;
180
181 CREATE TABLE `0_chart_master` (
182   `account_code` varchar(11) NOT NULL default '',
183   `account_code2` varchar(11) default '',
184   `account_name` varchar(60) NOT NULL default '',
185   `account_type` int(11) NOT NULL default '0',
186   `tax_code` 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', '1', '0');
197 INSERT INTO `0_chart_master` VALUES ('3010', '', 'Sales  - Wholesale', '1', '1', '0');
198 INSERT INTO `0_chart_master` VALUES ('3020', '', 'Sales of Other items', '1', '1', '0');
199 INSERT INTO `0_chart_master` VALUES ('3400', '', 'Difference On Exchange', '1', '0', '0');
200 INSERT INTO `0_chart_master` VALUES ('5000', '', 'Direct Labour', '2', '0', '0');
201 INSERT INTO `0_chart_master` VALUES ('5050', '', 'Direct Labour Recovery', '2', '0', '0');
202 INSERT INTO `0_chart_master` VALUES ('4200', '', 'Material Usage Varaiance', '2', '4', '0');
203 INSERT INTO `0_chart_master` VALUES ('4210', '', 'Consumable Materials', '2', '4', '0');
204 INSERT INTO `0_chart_master` VALUES ('4220', '', 'Purchase price Variance', '2', '0', '0');
205 INSERT INTO `0_chart_master` VALUES ('4000', '', 'Purchases of materials', '2', '4', '0');
206 INSERT INTO `0_chart_master` VALUES ('4250', '', 'Discounts Received', '2', '0', '0');
207 INSERT INTO `0_chart_master` VALUES ('4260', '', 'Exchange Variation', '2', '0', '0');
208 INSERT INTO `0_chart_master` VALUES ('4300', '', 'Freight Inwards', '2', '4', '0');
209 INSERT INTO `0_chart_master` VALUES ('4010', '', 'Cost of Goods Sold - Retail', '2', '4', '0');
210 INSERT INTO `0_chart_master` VALUES ('6790', '', 'Bank Charges', '5', '4', '0');
211 INSERT INTO `0_chart_master` VALUES ('6800', '', 'Entertainments', '5', '4', '0');
212 INSERT INTO `0_chart_master` VALUES ('6810', '', 'Legal Expenses', '5', '4', '0');
213 INSERT INTO `0_chart_master` VALUES ('6600', '', 'Repairs and Maintenance Office', '5', '4', '0');
214 INSERT INTO `0_chart_master` VALUES ('6730', '', 'phone', '5', '4', '0');
215 INSERT INTO `0_chart_master` VALUES ('8200', '', 'Bank Interest', '52', '0', '0');
216 INSERT INTO `0_chart_master` VALUES ('6840', '', 'Credit Control', '5', '0', '0');
217 INSERT INTO `0_chart_master` VALUES ('7040', '', 'Depreciation Office Equipment', '51', '0', '0');
218 INSERT INTO `0_chart_master` VALUES ('3800', '', 'Freight Outwards', '5', '4', '0');
219 INSERT INTO `0_chart_master` VALUES ('4500', '', 'Packaging', '5', '4', '0');
220 INSERT INTO `0_chart_master` VALUES ('6400', '', 'Commissions', '5', '0', '0');
221 INSERT INTO `0_chart_master` VALUES ('3200', '', 'Prompt Payment Discounts', '1', '0', '0');
222 INSERT INTO `0_chart_master` VALUES ('6700', '', 'General Expenses', '5', '4', '0');
223 INSERT INTO `0_chart_master` VALUES ('5200', '', 'Indirect Labour', '2', '0', '0');
224 INSERT INTO `0_chart_master` VALUES ('5210', '', 'Overhead Recovery', '5', '0', '0');
225 INSERT INTO `0_chart_master` VALUES ('1700', '', 'Bank account', '10', '0', '0');
226 INSERT INTO `0_chart_master` VALUES ('1705', '', 'Petty Cash', '10', '0', '0');
227 INSERT INTO `0_chart_master` VALUES ('1710', '', 'Foreign currency account', '10', '0', '0');
228 INSERT INTO `0_chart_master` VALUES ('1500', '', 'Accounts Receivable', '20', '0', '0');
229 INSERT INTO `0_chart_master` VALUES ('1400', '', 'Stocks of Raw Materials', '45', '0', '0');
230 INSERT INTO `0_chart_master` VALUES ('1410', '', 'Stocks of Work In Progress', '45', '0', '0');
231 INSERT INTO `0_chart_master` VALUES ('1420', '', 'Stocks of Finsihed Goods', '45', '0', '0');
232 INSERT INTO `0_chart_master` VALUES ('1430', '', 'Goods Received Clearing account', '30', '0', '0');
233 INSERT INTO `0_chart_master` VALUES ('2630', '', 'Accounts Payable', '30', '0', '0');
234 INSERT INTO `0_chart_master` VALUES ('2660', '', 'VAT out 5', '30', '0', '0');
235 INSERT INTO `0_chart_master` VALUES ('2662', '', 'VAT out 1', '30', '0', '0');
236 INSERT INTO `0_chart_master` VALUES ('2664', '', 'VAT out 25', '30', '0', '0');
237 INSERT INTO `0_chart_master` VALUES ('2680', '', 'VAT In 5', '30', '0', '0');
238 INSERT INTO `0_chart_master` VALUES ('2682', '', 'VAT In 25', '30', '0', '0');
239 INSERT INTO `0_chart_master` VALUES ('2050', '', 'Retained Earnings', '50', '0', '0');
240 INSERT INTO `0_chart_master` VALUES ('2000', '', 'Share Capital', '50', '0', '0');
241
242
243 ### Structure of table `0_chart_types` ###
244
245 DROP TABLE IF EXISTS `0_chart_types`;
246
247 CREATE TABLE `0_chart_types` (
248   `id` int(11) NOT NULL auto_increment,
249   `name` varchar(60) NOT NULL default '',
250   `class_id` tinyint(1) NOT NULL default '0',
251   `parent` int(11) NOT NULL default '-1',
252   PRIMARY KEY  (`id`),
253   KEY `name` (`name`)
254 ) TYPE=MyISAM AUTO_INCREMENT=53  AUTO_INCREMENT=53 ;
255
256
257 ### Data of table `0_chart_types` ###
258
259 INSERT INTO `0_chart_types` VALUES ('1', 'Sales', '3', '-1');
260 INSERT INTO `0_chart_types` VALUES ('2', 'Cost of Sales', '4', '-1');
261 INSERT INTO `0_chart_types` VALUES ('5', 'Expenses', '4', '-1');
262 INSERT INTO `0_chart_types` VALUES ('10', 'Cash/Bank', '1', '-1');
263 INSERT INTO `0_chart_types` VALUES ('20', 'Accounts Receivable', '1', '-1');
264 INSERT INTO `0_chart_types` VALUES ('30', 'Accounts Payable', '2', '-1');
265 INSERT INTO `0_chart_types` VALUES ('40', 'Fixed Assets', '1', '-1');
266 INSERT INTO `0_chart_types` VALUES ('45', 'Inventory', '1', '-1');
267 INSERT INTO `0_chart_types` VALUES ('50', 'Equity', '2', '-1');
268 INSERT INTO `0_chart_types` VALUES ('51', 'Depreciations', '4', '-1');
269 INSERT INTO `0_chart_types` VALUES ('52', 'Financials', '4', '-1');
270
271
272 ### Structure of table `0_comments` ###
273
274 DROP TABLE IF EXISTS `0_comments`;
275
276 CREATE TABLE `0_comments` (
277   `type` int(11) NOT NULL default '0',
278   `id` int(11) NOT NULL default '0',
279   `date_` date default '0000-00-00',
280   `memo_` tinytext
281 ) TYPE=InnoDB  ;
282
283
284 ### Data of table `0_comments` ###
285
286
287
288 ### Structure of table `0_company` ###
289
290 DROP TABLE IF EXISTS `0_company`;
291
292 CREATE TABLE `0_company` (
293   `coy_code` int(11) NOT NULL default '1',
294   `coy_name` varchar(60) NOT NULL default '',
295   `gst_no` varchar(25) NOT NULL default '',
296   `coy_no` varchar(25) NOT NULL default '0',
297   `tax_prd` int(11) NOT NULL default '1',
298   `tax_last` int(11) NOT NULL default '1',
299   `postal_address` tinytext NOT NULL,
300   `phone` varchar(30) NOT NULL default '',
301   `fax` varchar(30) NOT NULL default '',
302   `email` varchar(100) NOT NULL default '',
303   `coy_logo` varchar(100) NOT NULL default '',
304   `domicile` varchar(55) NOT NULL default '',
305   `curr_default` char(3) NOT NULL default '',
306   `debtors_act` varchar(11) NOT NULL default '',
307   `pyt_discount_act` varchar(11) NOT NULL default '',
308   `creditors_act` varchar(11) NOT NULL default '',
309   `grn_act` varchar(11) NOT NULL default '',
310   `exchange_diff_act` varchar(11) NOT NULL default '',
311   `purch_exchange_diff_act` varchar(11) NOT NULL default '',
312   `retained_earnings_act` varchar(11) NOT NULL default '',
313   `freight_act` varchar(11) NOT NULL default '',
314   `default_sales_act` varchar(11) NOT NULL default '',
315   `default_sales_discount_act` varchar(11) NOT NULL default '',
316   `default_prompt_payment_act` varchar(11) NOT NULL default '',
317   `default_inventory_act` varchar(11) NOT NULL default '',
318   `default_cogs_act` varchar(11) NOT NULL default '',
319   `default_adj_act` varchar(11) NOT NULL default '',
320   `default_inv_sales_act` varchar(11) NOT NULL default '',
321   `default_assembly_act` varchar(11) NOT NULL default '',
322   `payroll_act` varchar(11) NOT NULL default '',
323   `custom1_name` varchar(60) NOT NULL default '',
324   `custom2_name` varchar(60) NOT NULL default '',
325   `custom3_name` varchar(60) NOT NULL default '',
326   `custom1_value` varchar(100) NOT NULL default '',
327   `custom2_value` varchar(100) NOT NULL default '',
328   `custom3_value` varchar(100) NOT NULL default '',
329   `allow_negative_stock` tinyint(1) NOT NULL default '0',
330   `po_over_receive` int(11) NOT NULL default '10',
331   `po_over_charge` int(11) NOT NULL default '10',
332   `default_credit_limit` int(11) NOT NULL default '1000',
333   `default_workorder_required` int(11) NOT NULL default '20',
334   `default_dim_required` int(11) NOT NULL default '20',
335   `past_due_days` int(11) NOT NULL default '30',
336   `use_dimension` tinyint(1) default '0',
337   `f_year` int(11) NOT NULL default '1',
338   `no_item_list` tinyint(1) NOT NULL default '0',
339   `no_customer_list` tinyint(1) NOT NULL default '0',
340   `no_supplier_list` tinyint(1) NOT NULL default '0',
341   `base_sales` int(11) NOT NULL default '-1',
342   `foreign_codes` tinyint(1) NOT NULL default '0',
343   `accumulate_shipping` tinyint(1) NOT NULL default '0',
344   `legal_text` tinytext NOT NULL,
345   PRIMARY KEY  (`coy_code`)
346 ) TYPE=MyISAM  ;
347
348
349 ### Data of table `0_company` ###
350
351 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', '2', '0', '0', '0', '0', '0', '0', '');
352
353
354 ### Structure of table `0_credit_status` ###
355
356 DROP TABLE IF EXISTS `0_credit_status`;
357
358 CREATE TABLE `0_credit_status` (
359   `id` int(11) NOT NULL auto_increment,
360   `reason_description` char(100) NOT NULL default '',
361   `dissallow_invoices` tinyint(1) NOT NULL default '0',
362   `inactive` tinyint(1) NOT NULL default '0',
363   PRIMARY KEY  (`id`),
364   UNIQUE KEY `reason_description` (`reason_description`)
365 ) TYPE=MyISAM AUTO_INCREMENT=5  AUTO_INCREMENT=5 ;
366
367
368 ### Data of table `0_credit_status` ###
369
370 INSERT INTO `0_credit_status` VALUES ('1', 'Good History', '0', '0');
371 INSERT INTO `0_credit_status` VALUES ('3', 'No more work until payment received', '1', '0');
372 INSERT INTO `0_credit_status` VALUES ('4', 'In liquidation', '1', '0');
373
374
375 ### Structure of table `0_currencies` ###
376
377 DROP TABLE IF EXISTS `0_currencies`;
378
379 CREATE TABLE `0_currencies` (
380   `currency` varchar(60) NOT NULL default '',
381   `curr_abrev` char(3) NOT NULL default '',
382   `curr_symbol` varchar(10) NOT NULL default '',
383   `country` varchar(100) NOT NULL default '',
384   `hundreds_name` varchar(15) NOT NULL default '',
385   `inactive` tinyint(1) NOT NULL default '0',
386   PRIMARY KEY  (`curr_abrev`)
387 ) TYPE=MyISAM  ;
388
389
390 ### Data of table `0_currencies` ###
391
392 INSERT INTO `0_currencies` VALUES ('Euro', 'EUR', '?', 'Europe', 'Cents', '0');
393 INSERT INTO `0_currencies` VALUES ('Pounds', 'GBP', '?', 'England', 'Pence', '0');
394 INSERT INTO `0_currencies` VALUES ('US Dollars', 'USD', '$', 'United States', 'Cents', '0');
395
396
397 ### Structure of table `0_cust_allocations` ###
398
399 DROP TABLE IF EXISTS `0_cust_allocations`;
400
401 CREATE TABLE `0_cust_allocations` (
402   `id` int(11) NOT NULL auto_increment,
403   `amt` double unsigned default NULL,
404   `date_alloc` date NOT NULL default '0000-00-00',
405   `trans_no_from` int(11) default NULL,
406   `trans_type_from` int(11) default NULL,
407   `trans_no_to` int(11) default NULL,
408   `trans_type_to` int(11) default NULL,
409   PRIMARY KEY  (`id`)
410 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
411
412
413 ### Data of table `0_cust_allocations` ###
414
415
416
417 ### Structure of table `0_cust_branch` ###
418
419 DROP TABLE IF EXISTS `0_cust_branch`;
420
421 CREATE TABLE `0_cust_branch` (
422   `branch_code` int(11) NOT NULL auto_increment,
423   `debtor_no` int(11) NOT NULL default '0',
424   `br_name` varchar(60) NOT NULL default '',
425   `br_address` tinytext NOT NULL,
426   `area` int(11) default NULL,
427   `salesman` int(11) NOT NULL default '0',
428   `phone` varchar(30) NOT NULL default '',
429   `fax` varchar(30) NOT NULL default '',
430   `contact_name` varchar(60) NOT NULL default '',
431   `email` varchar(100) NOT NULL default '',
432   `default_location` varchar(5) NOT NULL default '',
433   `tax_group_id` int(11) default NULL,
434   `sales_account` varchar(11) default NULL,
435   `sales_discount_account` varchar(11) default NULL,
436   `receivables_account` varchar(11) default NULL,
437   `payment_discount_account` varchar(11) default NULL,
438   `default_ship_via` int(11) NOT NULL default '1',
439   `disable_trans` tinyint(4) NOT NULL default '0',
440   `br_post_address` tinytext NOT NULL,
441   `group_no` int(11) 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_debtor_trans_tax_details` ###
512
513 DROP TABLE IF EXISTS `0_debtor_trans_tax_details`;
514
515 CREATE TABLE `0_debtor_trans_tax_details` (
516   `id` int(11) NOT NULL auto_increment,
517   `debtor_trans_no` int(11) default NULL,
518   `debtor_trans_type` int(11) default NULL,
519   `tax_type_id` int(11) NOT NULL default '0',
520   `tax_type_name` varchar(60) default NULL,
521   `rate` double NOT NULL default '0',
522   `included_in_price` tinyint(1) NOT NULL default '0',
523   `amount` double NOT NULL default '0',
524   PRIMARY KEY  (`id`)
525 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
526
527
528 ### Data of table `0_debtor_trans_tax_details` ###
529
530
531
532 ### Structure of table `0_debtors_master` ###
533
534 DROP TABLE IF EXISTS `0_debtors_master`;
535
536 CREATE TABLE `0_debtors_master` (
537   `debtor_no` int(11) NOT NULL auto_increment,
538   `name` varchar(60) NOT NULL default '',
539   `address` tinytext,
540   `email` varchar(100) NOT NULL default '',
541   `tax_id` varchar(55) NOT NULL default '',
542   `curr_code` char(3) NOT NULL default '',
543   `sales_type` int(11) NOT NULL default '1',
544   `dimension_id` int(11) NOT NULL default '0',
545   `dimension2_id` int(11) NOT NULL default '0',
546   `credit_status` int(11) NOT NULL default '0',
547   `payment_terms` int(11) default NULL,
548   `discount` double NOT NULL default '0',
549   `pymt_discount` double NOT NULL default '0',
550   `credit_limit` float NOT NULL default '1000',
551   `inactive` tinyint(1) NOT NULL default '0',
552   PRIMARY KEY  (`debtor_no`),
553   UNIQUE KEY `name` (`name`)
554 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
555
556
557 ### Data of table `0_debtors_master` ###
558
559
560
561 ### Structure of table `0_dimensions` ###
562
563 DROP TABLE IF EXISTS `0_dimensions`;
564
565 CREATE TABLE `0_dimensions` (
566   `id` int(11) NOT NULL auto_increment,
567   `reference` varchar(60) NOT NULL default '',
568   `name` varchar(60) NOT NULL default '',
569   `type_` tinyint(1) NOT NULL default '1',
570   `closed` tinyint(1) NOT NULL default '0',
571   `date_` date NOT NULL default '0000-00-00',
572   `due_date` date NOT NULL default '0000-00-00',
573   PRIMARY KEY  (`id`),
574   UNIQUE KEY `reference` (`reference`)
575 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
576
577
578 ### Data of table `0_dimensions` ###
579
580
581
582 ### Structure of table `0_exchange_rates` ###
583
584 DROP TABLE IF EXISTS `0_exchange_rates`;
585
586 CREATE TABLE `0_exchange_rates` (
587   `id` int(11) NOT NULL auto_increment,
588   `curr_code` char(3) NOT NULL default '',
589   `rate_buy` double NOT NULL default '0',
590   `rate_sell` double NOT NULL default '0',
591   `date_` date NOT NULL default '0000-00-00',
592   PRIMARY KEY  (`id`),
593   UNIQUE KEY `curr_code` (`curr_code`,`date_`)
594 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
595
596
597 ### Data of table `0_exchange_rates` ###
598
599
600
601 ### Structure of table `0_fiscal_year` ###
602
603 DROP TABLE IF EXISTS `0_fiscal_year`;
604
605 CREATE TABLE `0_fiscal_year` (
606   `id` int(11) NOT NULL auto_increment,
607   `begin` date default '0000-00-00',
608   `end` date default '0000-00-00',
609   `closed` tinyint(1) NOT NULL default '0',
610   PRIMARY KEY  (`id`)
611 ) TYPE=InnoDB AUTO_INCREMENT=3  AUTO_INCREMENT=3 ;
612
613
614 ### Data of table `0_fiscal_year` ###
615
616 INSERT INTO `0_fiscal_year` VALUES ('2', '2009-01-01', '2009-12-31', '0');
617
618
619 ### Structure of table `0_gl_trans` ###
620
621 DROP TABLE IF EXISTS `0_gl_trans`;
622
623 CREATE TABLE `0_gl_trans` (
624   `counter` int(11) NOT NULL auto_increment,
625   `type` smallint(6) NOT NULL default '0',
626   `type_no` bigint(16) NOT NULL default '1',
627   `tran_date` date NOT NULL default '0000-00-00',
628   `account` varchar(11) NOT NULL default '',
629   `memo_` tinytext NOT NULL,
630   `amount` double NOT NULL default '0',
631   `dimension_id` int(11) NOT NULL default '0',
632   `dimension2_id` int(11) NOT NULL default '0',
633   `person_type_id` int(11) default NULL,
634   `person_id` tinyblob,
635   PRIMARY KEY  (`counter`),
636   KEY `Type_and_Number` (`type`,`type_no`)
637 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
638
639
640 ### Data of table `0_gl_trans` ###
641
642
643
644 ### Structure of table `0_grn_batch` ###
645
646 DROP TABLE IF EXISTS `0_grn_batch`;
647
648 CREATE TABLE `0_grn_batch` (
649   `id` int(11) NOT NULL auto_increment,
650   `supplier_id` int(11) NOT NULL default '0',
651   `purch_order_no` int(11) default NULL,
652   `reference` varchar(60) NOT NULL default '',
653   `delivery_date` date NOT NULL default '0000-00-00',
654   `loc_code` varchar(5) default NULL,
655   PRIMARY KEY  (`id`)
656 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
657
658
659 ### Data of table `0_grn_batch` ###
660
661
662
663 ### Structure of table `0_grn_items` ###
664
665 DROP TABLE IF EXISTS `0_grn_items`;
666
667 CREATE TABLE `0_grn_items` (
668   `id` int(11) NOT NULL auto_increment,
669   `grn_batch_id` int(11) default NULL,
670   `po_detail_item` int(11) NOT NULL default '0',
671   `item_code` varchar(20) NOT NULL default '',
672   `description` tinytext,
673   `qty_recd` double NOT NULL default '0',
674   `quantity_inv` double NOT NULL default '0',
675   PRIMARY KEY  (`id`)
676 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
677
678
679 ### Data of table `0_grn_items` ###
680
681
682
683 ### Structure of table `0_groups` ###
684
685 DROP TABLE IF EXISTS `0_groups`;
686
687 CREATE TABLE `0_groups` (
688   `id` smallint(6) unsigned NOT NULL auto_increment,
689   `description` varchar(60) NOT NULL default '',
690   `inactive` tinyint(1) NOT NULL default '0',
691   PRIMARY KEY  (`id`),
692   UNIQUE KEY `description` (`description`)
693 ) TYPE=MyISAM AUTO_INCREMENT=4  AUTO_INCREMENT=4 ;
694
695
696 ### Data of table `0_groups` ###
697
698 INSERT INTO `0_groups` VALUES ('1', 'Small', '0');
699 INSERT INTO `0_groups` VALUES ('2', 'Medium', '0');
700 INSERT INTO `0_groups` VALUES ('3', 'Large', '0');
701
702
703 ### Structure of table `0_item_codes` ###
704
705 DROP TABLE IF EXISTS `0_item_codes`;
706
707 CREATE TABLE `0_item_codes` (
708   `id` int(11) unsigned NOT NULL auto_increment,
709   `item_code` varchar(20) NOT NULL,
710   `stock_id` varchar(20) NOT NULL,
711   `description` varchar(200) NOT NULL default '',
712   `category_id` smallint(6) unsigned NOT NULL,
713   `quantity` double NOT NULL default '1',
714   `is_foreign` tinyint(1) NOT NULL default '0',
715   `inactive` tinyint(1) NOT NULL default '0',
716   PRIMARY KEY  (`id`),
717   UNIQUE KEY `stock_id` (`stock_id`,`item_code`)
718 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
719
720
721 ### Data of table `0_item_codes` ###
722
723
724
725 ### Structure of table `0_item_tax_type_exemptions` ###
726
727 DROP TABLE IF EXISTS `0_item_tax_type_exemptions`;
728
729 CREATE TABLE `0_item_tax_type_exemptions` (
730   `item_tax_type_id` int(11) NOT NULL default '0',
731   `tax_type_id` int(11) NOT NULL default '0',
732   PRIMARY KEY  (`item_tax_type_id`,`tax_type_id`)
733 ) TYPE=InnoDB  ;
734
735
736 ### Data of table `0_item_tax_type_exemptions` ###
737
738
739
740 ### Structure of table `0_item_tax_types` ###
741
742 DROP TABLE IF EXISTS `0_item_tax_types`;
743
744 CREATE TABLE `0_item_tax_types` (
745   `id` int(11) NOT NULL auto_increment,
746   `name` varchar(60) NOT NULL default '',
747   `exempt` tinyint(1) NOT NULL default '0',
748   PRIMARY KEY  (`id`),
749   UNIQUE KEY `name` (`name`)
750 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
751
752
753 ### Data of table `0_item_tax_types` ###
754
755
756
757 ### Structure of table `0_item_units` ###
758
759 DROP TABLE IF EXISTS `0_item_units`;
760
761 CREATE TABLE `0_item_units` (
762   `abbr` varchar(20) NOT NULL,
763   `name` varchar(40) NOT NULL,
764   `decimals` tinyint(2) NOT NULL,
765   `inactive` tinyint(1) NOT NULL default '0',
766   PRIMARY KEY  (`abbr`),
767   UNIQUE KEY `name` (`name`)
768 ) TYPE=MyISAM  ;
769
770
771 ### Data of table `0_item_units` ###
772
773 INSERT INTO `0_item_units` VALUES ('each', 'Each', '0', '0');
774
775
776 ### Structure of table `0_loc_stock` ###
777
778 DROP TABLE IF EXISTS `0_loc_stock`;
779
780 CREATE TABLE `0_loc_stock` (
781   `loc_code` char(5) NOT NULL default '',
782   `stock_id` char(20) NOT NULL default '',
783   `reorder_level` bigint(20) NOT NULL default '0',
784   PRIMARY KEY  (`loc_code`,`stock_id`),
785   KEY `stock_id` (`stock_id`)
786 ) TYPE=InnoDB  ;
787
788
789 ### Data of table `0_loc_stock` ###
790
791
792
793 ### Structure of table `0_locations` ###
794
795 DROP TABLE IF EXISTS `0_locations`;
796
797 CREATE TABLE `0_locations` (
798   `loc_code` varchar(5) NOT NULL default '',
799   `location_name` varchar(60) NOT NULL default '',
800   `delivery_address` tinytext NOT NULL,
801   `phone` varchar(30) NOT NULL default '',
802   `fax` varchar(30) NOT NULL default '',
803   `email` varchar(100) NOT NULL default '',
804   `contact` varchar(30) NOT NULL default '',
805   `inactive` tinyint(1) NOT NULL default '0',
806   PRIMARY KEY  (`loc_code`)
807 ) TYPE=MyISAM  ;
808
809
810 ### Data of table `0_locations` ###
811
812 INSERT INTO `0_locations` VALUES ('DEF', 'Default', 'N/A', '', '', '', '', '0');
813
814
815 ### Structure of table `0_movement_types` ###
816
817 DROP TABLE IF EXISTS `0_movement_types`;
818
819 CREATE TABLE `0_movement_types` (
820   `id` int(11) NOT NULL auto_increment,
821   `name` varchar(60) NOT NULL default '',
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');
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   `stock_act` varchar(11) default NULL,
1239   `cogs_act` varchar(11) default NULL,
1240   `adj_gl_act` varchar(11) default NULL,
1241   `purch_price_var_act` varchar(11) default NULL,
1242   `inactive` tinyint(1) NOT NULL default '0',
1243   PRIMARY KEY  (`category_id`),
1244   UNIQUE KEY `description` (`description`)
1245 ) TYPE=MyISAM AUTO_INCREMENT=5  AUTO_INCREMENT=5 ;
1246
1247
1248 ### Data of table `0_stock_category` ###
1249
1250 INSERT INTO `0_stock_category` VALUES ('1', 'Components', '', '', '', '', '0');
1251 INSERT INTO `0_stock_category` VALUES ('2', 'Charges', '', '', '', '', '0');
1252 INSERT INTO `0_stock_category` VALUES ('3', 'Systems', '', '', '', '', '0');
1253 INSERT INTO `0_stock_category` VALUES ('4', 'Services', '', '', '', '', '0');
1254
1255
1256 ### Structure of table `0_stock_master` ###
1257
1258 DROP TABLE IF EXISTS `0_stock_master`;
1259
1260 CREATE TABLE `0_stock_master` (
1261   `stock_id` varchar(20) NOT NULL default '',
1262   `category_id` int(11) NOT NULL default '0',
1263   `tax_type_id` int(11) NOT NULL default '0',
1264   `description` varchar(200) NOT NULL default '',
1265   `long_description` tinytext NOT NULL,
1266   `units` varchar(20) NOT NULL default 'each',
1267   `mb_flag` char(1) NOT NULL default 'B',
1268   `sales_account` varchar(11) NOT NULL default '',
1269   `cogs_account` varchar(11) NOT NULL default '',
1270   `inventory_account` varchar(11) NOT NULL default '',
1271   `adjustment_account` varchar(11) NOT NULL default '',
1272   `assembly_account` varchar(11) NOT NULL default '',
1273   `dimension_id` int(11) default NULL,
1274   `dimension2_id` int(11) default NULL,
1275   `actual_cost` double NOT NULL default '0',
1276   `last_cost` double NOT NULL default '0',
1277   `material_cost` double NOT NULL default '0',
1278   `labour_cost` double NOT NULL default '0',
1279   `overhead_cost` double NOT NULL default '0',
1280   `inactive` tinyint(1) NOT NULL default '0',
1281   PRIMARY KEY  (`stock_id`)
1282 ) TYPE=InnoDB  ;
1283
1284
1285 ### Data of table `0_stock_master` ###
1286
1287
1288
1289 ### Structure of table `0_stock_moves` ###
1290
1291 DROP TABLE IF EXISTS `0_stock_moves`;
1292
1293 CREATE TABLE `0_stock_moves` (
1294   `trans_id` int(11) NOT NULL auto_increment,
1295   `trans_no` int(11) NOT NULL default '0',
1296   `stock_id` char(20) NOT NULL default '',
1297   `type` smallint(6) NOT NULL default '0',
1298   `loc_code` char(5) NOT NULL default '',
1299   `tran_date` date NOT NULL default '0000-00-00',
1300   `person_id` int(11) default NULL,
1301   `price` double NOT NULL default '0',
1302   `reference` char(40) NOT NULL default '',
1303   `qty` double NOT NULL default '1',
1304   `discount_percent` double NOT NULL default '0',
1305   `standard_cost` double NOT NULL default '0',
1306   `visible` tinyint(1) NOT NULL default '1',
1307   PRIMARY KEY  (`trans_id`),
1308   KEY `type` (`type`,`trans_no`)
1309 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1310
1311
1312 ### Data of table `0_stock_moves` ###
1313
1314
1315
1316 ### Structure of table `0_supp_allocations` ###
1317
1318 DROP TABLE IF EXISTS `0_supp_allocations`;
1319
1320 CREATE TABLE `0_supp_allocations` (
1321   `id` int(11) NOT NULL auto_increment,
1322   `amt` double unsigned default NULL,
1323   `date_alloc` date NOT NULL default '0000-00-00',
1324   `trans_no_from` int(11) default NULL,
1325   `trans_type_from` int(11) default NULL,
1326   `trans_no_to` int(11) default NULL,
1327   `trans_type_to` int(11) default NULL,
1328   PRIMARY KEY  (`id`)
1329 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1330
1331
1332 ### Data of table `0_supp_allocations` ###
1333
1334
1335
1336 ### Structure of table `0_supp_invoice_items` ###
1337
1338 DROP TABLE IF EXISTS `0_supp_invoice_items`;
1339
1340 CREATE TABLE `0_supp_invoice_items` (
1341   `id` int(11) NOT NULL auto_increment,
1342   `supp_trans_no` int(11) default NULL,
1343   `supp_trans_type` int(11) default NULL,
1344   `gl_code` varchar(11) NOT NULL default '0',
1345   `grn_item_id` int(11) default NULL,
1346   `po_detail_item_id` int(11) default NULL,
1347   `stock_id` varchar(20) NOT NULL default '',
1348   `description` tinytext,
1349   `quantity` double NOT NULL default '0',
1350   `unit_price` double NOT NULL default '0',
1351   `unit_tax` double NOT NULL default '0',
1352   `memo_` tinytext,
1353   PRIMARY KEY  (`id`)
1354 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1355
1356
1357 ### Data of table `0_supp_invoice_items` ###
1358
1359
1360
1361 ### Structure of table `0_supp_invoice_tax_items` ###
1362
1363 DROP TABLE IF EXISTS `0_supp_invoice_tax_items`;
1364
1365 CREATE TABLE `0_supp_invoice_tax_items` (
1366   `id` int(11) NOT NULL auto_increment,
1367   `supp_trans_no` int(11) default NULL,
1368   `supp_trans_type` int(11) default NULL,
1369   `tax_type_id` int(11) NOT NULL default '0',
1370   `tax_type_name` varchar(60) default NULL,
1371   `rate` double NOT NULL default '0',
1372   `included_in_price` tinyint(1) NOT NULL default '0',
1373   `amount` double NOT NULL default '0',
1374   PRIMARY KEY  (`id`)
1375 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1376
1377
1378 ### Data of table `0_supp_invoice_tax_items` ###
1379
1380
1381
1382 ### Structure of table `0_supp_trans` ###
1383
1384 DROP TABLE IF EXISTS `0_supp_trans`;
1385
1386 CREATE TABLE `0_supp_trans` (
1387   `trans_no` int(11) unsigned NOT NULL default '0',
1388   `type` smallint(6) unsigned NOT NULL default '0',
1389   `supplier_id` int(11) unsigned default NULL,
1390   `reference` tinytext NOT NULL,
1391   `supp_reference` varchar(60) NOT NULL default '',
1392   `tran_date` date NOT NULL default '0000-00-00',
1393   `due_date` date NOT NULL default '0000-00-00',
1394   `ov_amount` double NOT NULL default '0',
1395   `ov_discount` double NOT NULL default '0',
1396   `ov_gst` double NOT NULL default '0',
1397   `rate` double NOT NULL default '1',
1398   `alloc` double NOT NULL default '0',
1399   PRIMARY KEY  (`trans_no`,`type`),
1400   KEY `supplier_id` (`supplier_id`),
1401   KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
1402   KEY `type` (`type`)
1403 ) TYPE=InnoDB  ;
1404
1405
1406 ### Data of table `0_supp_trans` ###
1407
1408
1409
1410 ### Structure of table `0_suppliers` ###
1411
1412 DROP TABLE IF EXISTS `0_suppliers`;
1413
1414 CREATE TABLE `0_suppliers` (
1415   `supplier_id` int(11) NOT NULL auto_increment,
1416   `supp_name` varchar(60) NOT NULL default '',
1417   `address` tinytext NOT NULL,
1418   `supp_address` tinytext NOT NULL,
1419   `phone` varchar(30) NOT NULL default '',
1420   `fax` varchar(30) NOT NULL default '',
1421   `gst_no` varchar(25) NOT NULL default '',
1422   `contact` varchar(60) NOT NULL default '',
1423   `supp_account_no` varchar(40) NOT NULL default '',
1424   `email` varchar(100) NOT NULL default '',
1425   `website` varchar(100) NOT NULL default '',
1426   `bank_account` varchar(60) NOT NULL default '',
1427   `curr_code` char(3) default NULL,
1428   `payment_terms` int(11) default NULL,
1429   `dimension_id` int(11) default '0',
1430   `dimension2_id` int(11) default '0',
1431   `tax_group_id` int(11) default NULL,
1432   `credit_limit` double NOT NULL default '0',
1433   `purchase_account` varchar(11) default NULL,
1434   `payable_account` varchar(11) default NULL,
1435   `payment_discount_account` varchar(11) default NULL,
1436   `notes` tinytext NOT NULL,
1437   `inactive` tinyint(1) NOT NULL default '0',
1438   PRIMARY KEY  (`supplier_id`)
1439 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
1440
1441
1442 ### Data of table `0_suppliers` ###
1443
1444
1445
1446 ### Structure of table `0_sys_types` ###
1447
1448 DROP TABLE IF EXISTS `0_sys_types`;
1449
1450 CREATE TABLE `0_sys_types` (
1451   `type_id` smallint(6) NOT NULL default '0',
1452   `type_name` varchar(60) NOT NULL default '',
1453   `type_no` int(11) NOT NULL default '1',
1454   `next_reference` varchar(100) NOT NULL default '',
1455   PRIMARY KEY  (`type_id`)
1456 ) TYPE=InnoDB  ;
1457
1458
1459 ### Data of table `0_sys_types` ###
1460
1461 INSERT INTO `0_sys_types` VALUES ('0', 'Journal - GL', '17', '1');
1462 INSERT INTO `0_sys_types` VALUES ('1', 'Payment - GL', '7', '1');
1463 INSERT INTO `0_sys_types` VALUES ('2', 'Receipt - GL', '4', '1');
1464 INSERT INTO `0_sys_types` VALUES ('4', 'Funds Transfer', '3', '1');
1465 INSERT INTO `0_sys_types` VALUES ('10', 'Sales Invoice', '16', '1');
1466 INSERT INTO `0_sys_types` VALUES ('11', 'Credit Note', '2', '1');
1467 INSERT INTO `0_sys_types` VALUES ('12', 'Receipt', '6', '1');
1468 INSERT INTO `0_sys_types` VALUES ('13', 'Delivery', '1', '1');
1469 INSERT INTO `0_sys_types` VALUES ('16', 'Location Transfer', '2', '1');
1470 INSERT INTO `0_sys_types` VALUES ('17', 'Inventory Adjustment', '2', '1');
1471 INSERT INTO `0_sys_types` VALUES ('18', 'Purchase Order', '1', '1');
1472 INSERT INTO `0_sys_types` VALUES ('20', 'Supplier Invoice', '6', '1');
1473 INSERT INTO `0_sys_types` VALUES ('21', 'Supplier Credit Note', '1', '1');
1474 INSERT INTO `0_sys_types` VALUES ('22', 'Supplier Payment', '3', '1');
1475 INSERT INTO `0_sys_types` VALUES ('25', 'Purchase Order Delivery', '1', '1');
1476 INSERT INTO `0_sys_types` VALUES ('26', 'Work Order', '1', '1');
1477 INSERT INTO `0_sys_types` VALUES ('28', 'Work Order Issue', '1', '1');
1478 INSERT INTO `0_sys_types` VALUES ('29', 'Work Order Production', '1', '1');
1479 INSERT INTO `0_sys_types` VALUES ('30', 'Sales Order', '1', '1');
1480 INSERT INTO `0_sys_types` VALUES ('35', 'Cost Update', '1', '1');
1481 INSERT INTO `0_sys_types` VALUES ('40', 'Dimension', '1', '1');
1482
1483
1484 ### Structure of table `0_tax_group_items` ###
1485
1486 DROP TABLE IF EXISTS `0_tax_group_items`;
1487
1488 CREATE TABLE `0_tax_group_items` (
1489   `tax_group_id` int(11) NOT NULL default '0',
1490   `tax_type_id` int(11) NOT NULL default '0',
1491   `rate` double NOT NULL default '0',
1492   PRIMARY KEY  (`tax_group_id`,`tax_type_id`)
1493 ) TYPE=InnoDB  ;
1494
1495
1496 ### Data of table `0_tax_group_items` ###
1497
1498
1499
1500 ### Structure of table `0_tax_groups` ###
1501
1502 DROP TABLE IF EXISTS `0_tax_groups`;
1503
1504 CREATE TABLE `0_tax_groups` (
1505   `id` int(11) NOT NULL auto_increment,
1506   `name` varchar(60) NOT NULL default '',
1507   `tax_shipping` tinyint(1) NOT NULL default '0',
1508   PRIMARY KEY  (`id`),
1509   UNIQUE KEY `name` (`name`)
1510 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1511
1512
1513 ### Data of table `0_tax_groups` ###
1514
1515
1516
1517 ### Structure of table `0_tax_types` ###
1518
1519 DROP TABLE IF EXISTS `0_tax_types`;
1520
1521 CREATE TABLE `0_tax_types` (
1522   `id` int(11) NOT NULL auto_increment,
1523   `rate` double NOT NULL default '0',
1524   `sales_gl_code` varchar(11) NOT NULL default '',
1525   `purchasing_gl_code` varchar(11) NOT NULL default '',
1526   `name` varchar(60) NOT NULL default '',
1527   PRIMARY KEY  (`id`),
1528   UNIQUE KEY `name` (`name`,`rate`)
1529 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1530
1531
1532 ### Data of table `0_tax_types` ###
1533
1534
1535
1536 ### Structure of table `0_users` ###
1537
1538 DROP TABLE IF EXISTS `0_users`;
1539
1540 CREATE TABLE `0_users` (
1541   `user_id` varchar(60) NOT NULL default '',
1542   `password` varchar(100) NOT NULL default '',
1543   `real_name` varchar(100) NOT NULL default '',
1544   `full_access` int(11) NOT NULL default '1',
1545   `phone` varchar(30) NOT NULL default '',
1546   `email` varchar(100) default NULL,
1547   `language` varchar(20) default NULL,
1548   `date_format` tinyint(1) NOT NULL default '0',
1549   `date_sep` tinyint(1) NOT NULL default '0',
1550   `tho_sep` tinyint(1) NOT NULL default '0',
1551   `dec_sep` tinyint(1) NOT NULL default '0',
1552   `theme` varchar(20) NOT NULL default 'default',
1553   `page_size` varchar(20) NOT NULL default 'A4',
1554   `prices_dec` smallint(6) NOT NULL default '2',
1555   `qty_dec` smallint(6) NOT NULL default '2',
1556   `rates_dec` smallint(6) NOT NULL default '4',
1557   `percent_dec` smallint(6) NOT NULL default '1',
1558   `show_gl` tinyint(1) NOT NULL default '1',
1559   `show_codes` tinyint(1) NOT NULL default '0',
1560   `show_hints` tinyint(1) NOT NULL default '0',
1561   `last_visit_date` datetime default NULL,
1562   `query_size` tinyint(1) default '10',
1563   `graphic_links` tinyint(1) default '1',
1564   `pos` smallint(6) default '1',
1565   `print_profile` varchar(30) NOT NULL default '1',
1566   `rep_popup` tinyint(1) default '1',
1567   PRIMARY KEY  (`user_id`)
1568 ) TYPE=MyISAM  ;
1569
1570
1571 ### Data of table `0_users` ###
1572
1573 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');
1574
1575
1576 ### Structure of table `0_voided` ###
1577
1578 DROP TABLE IF EXISTS `0_voided`;
1579
1580 CREATE TABLE `0_voided` (
1581   `type` int(11) NOT NULL default '0',
1582   `id` int(11) NOT NULL default '0',
1583   `date_` date NOT NULL default '0000-00-00',
1584   `memo_` tinytext NOT NULL,
1585   UNIQUE KEY `id` (`type`,`id`)
1586 ) TYPE=InnoDB  ;
1587
1588
1589 ### Data of table `0_voided` ###
1590
1591
1592
1593 ### Structure of table `0_wo_issue_items` ###
1594
1595 DROP TABLE IF EXISTS `0_wo_issue_items`;
1596
1597 CREATE TABLE `0_wo_issue_items` (
1598   `id` int(11) NOT NULL auto_increment,
1599   `stock_id` varchar(40) default NULL,
1600   `issue_id` int(11) default NULL,
1601   `qty_issued` double default NULL,
1602   PRIMARY KEY  (`id`)
1603 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1604
1605
1606 ### Data of table `0_wo_issue_items` ###
1607
1608
1609
1610 ### Structure of table `0_wo_issues` ###
1611
1612 DROP TABLE IF EXISTS `0_wo_issues`;
1613
1614 CREATE TABLE `0_wo_issues` (
1615   `issue_no` int(11) NOT NULL auto_increment,
1616   `workorder_id` int(11) NOT NULL default '0',
1617   `reference` varchar(100) default NULL,
1618   `issue_date` date default NULL,
1619   `loc_code` varchar(5) default NULL,
1620   `workcentre_id` int(11) default NULL,
1621   PRIMARY KEY  (`issue_no`)
1622 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1623
1624
1625 ### Data of table `0_wo_issues` ###
1626
1627
1628
1629 ### Structure of table `0_wo_manufacture` ###
1630
1631 DROP TABLE IF EXISTS `0_wo_manufacture`;
1632
1633 CREATE TABLE `0_wo_manufacture` (
1634   `id` int(11) NOT NULL auto_increment,
1635   `reference` varchar(100) default NULL,
1636   `workorder_id` int(11) NOT NULL default '0',
1637   `quantity` double NOT NULL default '0',
1638   `date_` date NOT NULL default '0000-00-00',
1639   PRIMARY KEY  (`id`)
1640 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1641
1642
1643 ### Data of table `0_wo_manufacture` ###
1644
1645
1646
1647 ### Structure of table `0_wo_requirements` ###
1648
1649 DROP TABLE IF EXISTS `0_wo_requirements`;
1650
1651 CREATE TABLE `0_wo_requirements` (
1652   `id` int(11) NOT NULL auto_increment,
1653   `workorder_id` int(11) NOT NULL default '0',
1654   `stock_id` char(20) NOT NULL default '',
1655   `workcentre` int(11) NOT NULL default '0',
1656   `units_req` double NOT NULL default '1',
1657   `std_cost` double NOT NULL default '0',
1658   `loc_code` char(5) NOT NULL default '',
1659   `units_issued` double NOT NULL default '0',
1660   PRIMARY KEY  (`id`)
1661 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1662
1663
1664 ### Data of table `0_wo_requirements` ###
1665
1666
1667
1668 ### Structure of table `0_workcentres` ###
1669
1670 DROP TABLE IF EXISTS `0_workcentres`;
1671
1672 CREATE TABLE `0_workcentres` (
1673   `id` int(11) NOT NULL auto_increment,
1674   `name` char(40) NOT NULL default '',
1675   `description` char(50) NOT NULL default '',
1676   `inactive` tinyint(1) NOT NULL default '0',
1677   PRIMARY KEY  (`id`),
1678   UNIQUE KEY `name` (`name`)
1679 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
1680
1681
1682 ### Data of table `0_workcentres` ###
1683
1684
1685
1686 ### Structure of table `0_workorders` ###
1687
1688 DROP TABLE IF EXISTS `0_workorders`;
1689
1690 CREATE TABLE `0_workorders` (
1691   `id` int(11) NOT NULL auto_increment,
1692   `wo_ref` varchar(60) NOT NULL default '',
1693   `loc_code` varchar(5) NOT NULL default '',
1694   `units_reqd` double NOT NULL default '1',
1695   `stock_id` varchar(20) NOT NULL default '',
1696   `date_` date NOT NULL default '0000-00-00',
1697   `type` tinyint(4) NOT NULL default '0',
1698   `required_by` date NOT NULL default '0000-00-00',
1699   `released_date` date NOT NULL default '0000-00-00',
1700   `units_issued` double NOT NULL default '0',
1701   `closed` tinyint(1) NOT NULL default '0',
1702   `released` tinyint(1) NOT NULL default '0',
1703   `additional_costs` double NOT NULL default '0',
1704   PRIMARY KEY  (`id`),
1705   UNIQUE KEY `wo_ref` (`wo_ref`)
1706 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1707
1708
1709 ### Data of table `0_workorders` ###
1710