30f624daef773fa0d4f92d09e98b2a66f2f6ed1c
[fa-stable.git] / sql / en_US-new.sql
1 # Built by FrontAccounting 2.1.2
2 # http://frontaccounting.net
3 # Company: Company name
4 # User: Administrator
5 # COA: en_US-new.sql
6
7
8 ### Structure of table `0_areas` ###
9
10 DROP TABLE IF EXISTS `0_areas`;
11
12 CREATE TABLE `0_areas` (
13   `area_code` int(11) NOT NULL auto_increment,
14   `description` varchar(60) NOT NULL default '',
15   `inactive` tinyint(1) NOT NULL default '0',
16   PRIMARY KEY  (`area_code`),
17   UNIQUE KEY `description` (`description`)
18 ) TYPE=MyISAM AUTO_INCREMENT=2 ;
19
20
21 ### Data of table `0_areas` ###
22
23 INSERT INTO `0_areas` VALUES ('1', 'Global', '0');
24
25 ### Structure of table `0_attachments` ###
26
27 DROP TABLE IF EXISTS `0_attachments`;
28
29 CREATE TABLE `0_attachments` (
30   `id` int(11) unsigned NOT NULL auto_increment,
31   `description` varchar(60) NOT NULL default '',
32   `type_no` int(11) NOT NULL default '0',
33   `trans_no` int(11) NOT NULL default '0',
34   `unique_name` varchar(60) NOT NULL default '',
35   `tran_date` date NOT NULL default '0000-00-00',
36   `filename` varchar(60) NOT NULL default '',
37   `filesize` int(11) NOT NULL default '0',
38   `filetype` varchar(60) NOT NULL default '',
39   PRIMARY KEY  (`id`),
40   KEY `type_no` (`type_no`,`trans_no`)
41 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
42
43
44 ### Data of table `0_attachments` ###
45
46 ### Structure of table `0_audit_trail` ###
47
48 DROP TABLE IF EXISTS `0_audit_trail`;
49
50 CREATE TABLE `0_audit_trail` (
51   `id` int(11) NOT NULL AUTO_INCREMENT,
52   `type` smallint(6) unsigned NOT NULL default '0',
53   `trans_no` int(11) unsigned NOT NULL default '0',
54   `user` smallint(6) unsigned NOT NULL default '0',
55   `stamp` timestamp NOT NULL,
56   `description` varchar(60) default NULL,
57   `fiscal_year` int(11) NOT NULL,
58   `gl_date` date NOT NULL default '0000-00-00',
59   `gl_seq` int(11) unsigned default NULL,
60    PRIMARY KEY (`id`),
61   KEY `Seq` (`fiscal_year`, `gl_date`, `gl_seq`),
62   KEY `Type_and_Number` (`type`,`trans_no`)
63 ) TYPE=InnoDB  ;
64
65 ### Data of table `0_audit_trail` ###
66
67
68
69 ### Structure of table `0_bank_accounts` ###
70
71 DROP TABLE IF EXISTS `0_bank_accounts`;
72
73 CREATE TABLE `0_bank_accounts` (
74   `account_code` varchar(15) NOT NULL default '',
75   `account_type` smallint(6) NOT NULL default '0',
76   `bank_account_name` varchar(60) NOT NULL default '',
77   `bank_account_number` varchar(100) NOT NULL default '',
78   `bank_name` varchar(60) NOT NULL default '',
79   `bank_address` tinytext,
80   `bank_curr_code` char(3) NOT NULL default '',
81   `dflt_curr_act` TINYINT(1) NOT NULL default '0',
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   KEY (`account_code`)
90 ) TYPE=MyISAM AUTO_INCREMENT=3 ;
91
92
93 ### Data of table `0_bank_accounts` ###
94
95 INSERT INTO `0_bank_accounts` VALUES ('1060', '0', 'Current account', 'N/A', 'N/A', '', 'USD', '1', '1', '0000-00-00 00:00:00', '0', '0');
96 INSERT INTO `0_bank_accounts` VALUES ('1065', '3', 'Petty Cash account', 'N/A', 'N/A', '', 'USD', '0', '2', '0000-00-00 00:00:00', '0', '0');
97
98
99 ### Structure of table `0_bank_trans` ###
100
101 DROP TABLE IF EXISTS `0_bank_trans`;
102
103 CREATE TABLE `0_bank_trans` (
104   `id` int(11) NOT NULL auto_increment,
105   `type` smallint(6) default NULL,
106   `trans_no` int(11) default NULL,
107   `bank_act` varchar(15) default NULL,
108   `ref` varchar(40) default NULL,
109   `trans_date` date NOT NULL default '0000-00-00',
110   `amount` double default NULL,
111   `dimension_id` int(11) NOT NULL default '0',
112   `dimension2_id` int(11) NOT NULL default '0',
113   `person_type_id` int(11) NOT NULL default '0',
114   `person_id` tinyblob,
115   `reconciled` date default NULL,
116   PRIMARY KEY  (`id`),
117   KEY `bank_act` (`bank_act`,`ref`),
118   KEY `type` (`type`,`trans_no`),
119   KEY (`bank_act`,`reconciled`),
120   KEY (`bank_act`,`trans_date`)
121 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
122
123
124 ### Data of table `0_bank_trans` ###
125
126
127
128 ### Structure of table `0_bom` ###
129
130 DROP TABLE IF EXISTS `0_bom`;
131
132 CREATE TABLE `0_bom` (
133   `id` int(11) NOT NULL auto_increment,
134   `parent` char(20) NOT NULL default '',
135   `component` char(20) NOT NULL default '',
136   `workcentre_added` int(11) NOT NULL default '0',
137   `loc_code` char(5) NOT NULL default '',
138   `quantity` double NOT NULL default '1',
139   PRIMARY KEY  (`parent`,`component`,`workcentre_added`,`loc_code`),
140   KEY `component` (`component`),
141   KEY `id` (`id`),
142   KEY `loc_code` (`loc_code`),
143   KEY `parent` (`parent`,`loc_code`),
144   KEY `workcentre_added` (`workcentre_added`)
145 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
146
147
148 ### Data of table `0_bom` ###
149
150
151
152 ### Structure of table `0_budget_trans` ###
153
154 DROP TABLE IF EXISTS `0_budget_trans`;
155
156 CREATE TABLE `0_budget_trans` (
157   `counter` int(11) NOT NULL auto_increment,
158   `type` smallint(6) NOT NULL default '0',
159   `type_no` bigint(16) NOT NULL default '1',
160   `tran_date` date NOT NULL default '0000-00-00',
161   `account` varchar(15) NOT NULL default '',
162   `memo_` tinytext NOT NULL,
163   `amount` double NOT NULL default '0',
164   `dimension_id` int(11) default '0',
165   `dimension2_id` int(11) default '0',
166   `person_type_id` int(11) default NULL,
167   `person_id` tinyblob,
168   PRIMARY KEY  (`counter`),
169   KEY `Type_and_Number` (`type`,`type_no`),
170   KEY `Account` (`account`, `tran_date`, `dimension_id`, `dimension2_id`)
171 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
172
173
174 ### Data of table `0_budget_trans` ###
175
176
177
178 ### Structure of table `0_chart_class` ###
179
180 DROP TABLE IF EXISTS `0_chart_class`;
181
182 CREATE TABLE `0_chart_class` (
183   `cid` varchar(3) NOT NULL,
184   `class_name` varchar(60) NOT NULL default '',
185   `ctype` tinyint(1) NOT NULL default '0',
186   `inactive` tinyint(1) NOT NULL default '0',
187   PRIMARY KEY  (`cid`)
188 ) TYPE=MyISAM  ;
189
190
191 ### Data of table `0_chart_class` ###
192
193 INSERT INTO `0_chart_class` VALUES ('1', 'Assets', '1', '0');
194 INSERT INTO `0_chart_class` VALUES ('2', 'Liabilities', '2', '0');
195 INSERT INTO `0_chart_class` VALUES ('3', 'Income', '4', '0');
196 INSERT INTO `0_chart_class` VALUES ('4', 'Costs', '6', '0');
197
198 ### Structure of table `0_chart_master` ###
199
200 DROP TABLE IF EXISTS `0_chart_master`;
201
202 CREATE TABLE `0_chart_master` (
203   `account_code` varchar(15) NOT NULL default '',
204   `account_code2` varchar(15) default '',
205   `account_name` varchar(60) NOT NULL default '',
206   `account_type` varchar(10) NOT NULL default '0',
207   `inactive` tinyint(1) NOT NULL default '0',
208   PRIMARY KEY  (`account_code`),
209   KEY `account_name` (`account_name`),
210   KEY `accounts_by_type` (`account_type`, `account_code`)
211 ) TYPE=MyISAM  ;
212
213
214 ### Data of table `0_chart_master` ###
215
216 INSERT INTO `0_chart_master` VALUES ('1060', '', 'Checking Account', '1', '0');
217 INSERT INTO `0_chart_master` VALUES ('1065', '', 'Petty Cash', '1', '0');
218 INSERT INTO `0_chart_master` VALUES ('1200', '', 'Accounts Receivables', '1', '0');
219 INSERT INTO `0_chart_master` VALUES ('1205', '', 'Allowance for doubtful accounts', '1', '0');
220 INSERT INTO `0_chart_master` VALUES ('1510', '', 'Inventory', '2', '0');
221 INSERT INTO `0_chart_master` VALUES ('1520', '', 'Stocks of Raw Materials', '2', '0');
222 INSERT INTO `0_chart_master` VALUES ('1530', '', 'Stocks of Work In Progress', '2', '0');
223 INSERT INTO `0_chart_master` VALUES ('1540', '', 'Stocks of Finsihed Goods', '2', '0');
224 INSERT INTO `0_chart_master` VALUES ('1550', '', 'Goods Received Clearing account', '2', '0');
225 INSERT INTO `0_chart_master` VALUES ('1820', '', 'Office Furniture & Equipment', '3', '0');
226 INSERT INTO `0_chart_master` VALUES ('1825', '', 'Accum. Amort. -Furn. & Equip.', '3', '0');
227 INSERT INTO `0_chart_master` VALUES ('1840', '', 'Vehicle', '3', '0');
228 INSERT INTO `0_chart_master` VALUES ('1845', '', 'Accum. Amort. -Vehicle', '3', '0');
229 INSERT INTO `0_chart_master` VALUES ('2100', '', 'Accounts Payable', '4', '0');
230 INSERT INTO `0_chart_master` VALUES ('2110', '', 'Accrued Income Tax - Federal', '4', '0');
231 INSERT INTO `0_chart_master` VALUES ('2120', '', 'Accrued Income Tax - State', '4', '0');
232 INSERT INTO `0_chart_master` VALUES ('2130', '', 'Accrued Franchise Tax', '4', '0');
233 INSERT INTO `0_chart_master` VALUES ('2140', '', 'Accrued Real & Personal Prop Tax', '4', '0');
234 INSERT INTO `0_chart_master` VALUES ('2145', '', 'Purchase Tax', '4', '0');
235 INSERT INTO `0_chart_master` VALUES ('2150', '', 'Sales Tax', '4', '0');
236 INSERT INTO `0_chart_master` VALUES ('2160', '', 'Accrued Use Tax Payable', '4', '0');
237 INSERT INTO `0_chart_master` VALUES ('2210', '', 'Accrued Wages', '4', '0');
238 INSERT INTO `0_chart_master` VALUES ('2220', '', 'Accrued Comp Time', '4', '0');
239 INSERT INTO `0_chart_master` VALUES ('2230', '', 'Accrued Holiday Pay', '4', '0');
240 INSERT INTO `0_chart_master` VALUES ('2240', '', 'Accrued Vacation Pay', '4', '0');
241 INSERT INTO `0_chart_master` VALUES ('2310', '', 'Accr. Benefits - 401K', '4', '0');
242 INSERT INTO `0_chart_master` VALUES ('2320', '', 'Accr. Benefits - Stock Purchase', '4', '0');
243 INSERT INTO `0_chart_master` VALUES ('2330', '', 'Accr. Benefits - Med, Den', '4', '0');
244 INSERT INTO `0_chart_master` VALUES ('2340', '', 'Accr. Benefits - Payroll Taxes', '4', '0');
245 INSERT INTO `0_chart_master` VALUES ('2350', '', 'Accr. Benefits - Credit Union', '4', '0');
246 INSERT INTO `0_chart_master` VALUES ('2360', '', 'Accr. Benefits - Savings Bond', '4', '0');
247 INSERT INTO `0_chart_master` VALUES ('2370', '', 'Accr. Benefits - Garnish', '4', '0');
248 INSERT INTO `0_chart_master` VALUES ('2380', '', 'Accr. Benefits - Charity Cont.', '4', '0');
249 INSERT INTO `0_chart_master` VALUES ('2620', '', 'Bank Loans', '5', '0');
250 INSERT INTO `0_chart_master` VALUES ('2680', '', 'Loans from Shareholders', '5', '0');
251 INSERT INTO `0_chart_master` VALUES ('3350', '', 'Common Shares', '6', '0');
252 INSERT INTO `0_chart_master` VALUES ('3590', '', 'Retained Earnings - prior years', '7', '0');
253 INSERT INTO `0_chart_master` VALUES ('4010', '', 'Sales', '8', '0');
254 INSERT INTO `0_chart_master` VALUES ('4430', '', 'Shipping & Handling', '9', '0');
255 INSERT INTO `0_chart_master` VALUES ('4440', '', 'Interest', '9', '0');
256 INSERT INTO `0_chart_master` VALUES ('4450', '', 'Foreign Exchange Gain', '9', '0');
257 INSERT INTO `0_chart_master` VALUES ('4500', '', 'Prompt Payment Discounts', '9', '0');
258 INSERT INTO `0_chart_master` VALUES ('4510', '', 'Discounts Given', '9', '0');
259 INSERT INTO `0_chart_master` VALUES ('5010', '', 'Cost of Goods Sold - Retail', '10', '0');
260 INSERT INTO `0_chart_master` VALUES ('5020', '', 'Material Usage Varaiance', '10', '0');
261 INSERT INTO `0_chart_master` VALUES ('5030', '', 'Consumable Materials', '10', '0');
262 INSERT INTO `0_chart_master` VALUES ('5040', '', 'Purchase price Variance', '10', '0');
263 INSERT INTO `0_chart_master` VALUES ('5050', '', 'Purchases of materials', '10', '0');
264 INSERT INTO `0_chart_master` VALUES ('5060', '', 'Discounts Received', '10', '0');
265 INSERT INTO `0_chart_master` VALUES ('5100', '', 'Freight', '10', '0');
266 INSERT INTO `0_chart_master` VALUES ('5410', '', 'Wages & Salaries', '11', '0');
267 INSERT INTO `0_chart_master` VALUES ('5420', '', 'Wages - Overtime', '11', '0');
268 INSERT INTO `0_chart_master` VALUES ('5430', '', 'Benefits - Comp Time', '11', '0');
269 INSERT INTO `0_chart_master` VALUES ('5440', '', 'Benefits - Payroll Taxes', '11', '0');
270 INSERT INTO `0_chart_master` VALUES ('5450', '', 'Benefits - Workers Comp', '11', '0');
271 INSERT INTO `0_chart_master` VALUES ('5460', '', 'Benefits - Pension', '11', '0');
272 INSERT INTO `0_chart_master` VALUES ('5470', '', 'Benefits - General Benefits', '11', '0');
273 INSERT INTO `0_chart_master` VALUES ('5510', '', 'Inc Tax Exp - Federal', '11', '0');
274 INSERT INTO `0_chart_master` VALUES ('5520', '', 'Inc Tax Exp - State', '11', '0');
275 INSERT INTO `0_chart_master` VALUES ('5530', '', 'Taxes - Real Estate', '11', '0');
276 INSERT INTO `0_chart_master` VALUES ('5540', '', 'Taxes - Personal Property', '11', '0');
277 INSERT INTO `0_chart_master` VALUES ('5550', '', 'Taxes - Franchise', '11', '0');
278 INSERT INTO `0_chart_master` VALUES ('5560', '', 'Taxes - Foreign Withholding', '11', '0');
279 INSERT INTO `0_chart_master` VALUES ('5610', '', 'Accounting & Legal', '12', '0');
280 INSERT INTO `0_chart_master` VALUES ('5615', '', 'Advertising & Promotions', '12', '0');
281 INSERT INTO `0_chart_master` VALUES ('5620', '', 'Bad Debts', '12', '0');
282 INSERT INTO `0_chart_master` VALUES ('5660', '', 'Amortization Expense', '12', '0');
283 INSERT INTO `0_chart_master` VALUES ('5685', '', 'Insurance', '12', '0');
284 INSERT INTO `0_chart_master` VALUES ('5690', '', 'Interest & Bank Charges', '12', '0');
285 INSERT INTO `0_chart_master` VALUES ('5700', '', 'Office Supplies', '12', '0');
286 INSERT INTO `0_chart_master` VALUES ('5760', '', 'Rent', '12', '0');
287 INSERT INTO `0_chart_master` VALUES ('5765', '', 'Repair & Maintenance', '12', '0');
288 INSERT INTO `0_chart_master` VALUES ('5780', '', 'Telephone', '12', '0');
289 INSERT INTO `0_chart_master` VALUES ('5785', '', 'Travel & Entertainment', '12', '0');
290 INSERT INTO `0_chart_master` VALUES ('5790', '', 'Utilities', '12', '0');
291 INSERT INTO `0_chart_master` VALUES ('5795', '', 'Registrations', '12', '0');
292 INSERT INTO `0_chart_master` VALUES ('5800', '', 'Licenses', '12', '0');
293 INSERT INTO `0_chart_master` VALUES ('5810', '', 'Foreign Exchange Loss', '12', '0');
294 INSERT INTO `0_chart_master` VALUES ('9990', '', 'Year Profit/Loss', '12', '0');
295
296
297 ### Structure of table `0_chart_types` ###
298
299 DROP TABLE IF EXISTS `0_chart_types`;
300
301 CREATE TABLE `0_chart_types` (
302   `id` varchar(10) NOT NULL,
303   `name` varchar(60) NOT NULL default '',
304   `class_id` varchar(3) NOT NULL default '',
305   `parent` varchar(10) NOT NULL default '-1',
306   `inactive` tinyint(1) NOT NULL default '0',
307   PRIMARY KEY  (`id`),
308   KEY  (`class_id`),
309   KEY `name` (`name`)
310 ) TYPE=MyISAM ;
311
312
313 ### Data of table `0_chart_types` ###
314
315 INSERT INTO `0_chart_types` VALUES ('1', 'Current Assets', '1', '-1', '0');
316 INSERT INTO `0_chart_types` VALUES ('2', 'Inventory Assets', '1', '-1', '0');
317 INSERT INTO `0_chart_types` VALUES ('3', 'Capital Assets', '1', '-1', '0');
318 INSERT INTO `0_chart_types` VALUES ('4', 'Current Liabilities', '2', '-1', '0');
319 INSERT INTO `0_chart_types` VALUES ('5', 'Long Term Liabilities', '2', '-1', '0');
320 INSERT INTO `0_chart_types` VALUES ('6', 'Share Capital', '2', '-1', '0');
321 INSERT INTO `0_chart_types` VALUES ('7', 'Retained Earnings', '2', '-1', '0');
322 INSERT INTO `0_chart_types` VALUES ('8', 'Sales Revenue', '3', '-1', '0');
323 INSERT INTO `0_chart_types` VALUES ('9', 'Other Revenue', '3', '-1', '0');
324 INSERT INTO `0_chart_types` VALUES ('10', 'Cost of Goods Sold', '4', '-1', '0');
325 INSERT INTO `0_chart_types` VALUES ('11', 'Payroll Expenses', '4', '-1', '0');
326 INSERT INTO `0_chart_types` VALUES ('12', 'General & Administrative expenses', '4', -1, '0');
327
328
329 ### Structure of table `0_comments` ###
330
331 DROP TABLE IF EXISTS `0_comments`;
332
333 CREATE TABLE `0_comments` (
334   `type` int(11) NOT NULL default '0',
335   `id` int(11) NOT NULL default '0',
336   `date_` date default '0000-00-00',
337   `memo_` tinytext,
338   KEY `type_and_id` (`type`, `id`)
339 ) TYPE=InnoDB  ;
340
341
342 ### Data of table `0_comments` ###
343
344
345
346 ### Structure of table `0_company` ###
347
348 DROP TABLE IF EXISTS `0_company`;
349
350 CREATE TABLE `0_company` (
351   `coy_code` int(11) NOT NULL default '1',
352   `coy_name` varchar(60) NOT NULL default '',
353   `gst_no` varchar(25) NOT NULL default '',
354   `coy_no` varchar(25) NOT NULL default '0',
355   `tax_prd` int(11) NOT NULL default '1',
356   `tax_last` int(11) NOT NULL default '1',
357   `postal_address` tinytext NOT NULL,
358   `phone` varchar(30) NOT NULL default '',
359   `fax` varchar(30) NOT NULL default '',
360   `email` varchar(100) NOT NULL default '',
361   `coy_logo` varchar(100) NOT NULL default '',
362   `domicile` varchar(55) NOT NULL default '',
363   `curr_default` char(3) NOT NULL default '',
364   `debtors_act` varchar(15) NOT NULL default '',
365   `pyt_discount_act` varchar(15) NOT NULL default '',
366   `creditors_act` varchar(15) NOT NULL default '',
367   `bank_charge_act` varchar(15) NOT NULL default '',
368   `exchange_diff_act` varchar(15) NOT NULL default '',
369   `profit_loss_year_act` varchar(15) NOT NULL default '',
370   `retained_earnings_act` varchar(15) NOT NULL default '',
371   `freight_act` varchar(15) NOT NULL default '',
372   `default_sales_act` varchar(15) NOT NULL default '',
373   `default_sales_discount_act` varchar(15) NOT NULL default '',
374   `default_prompt_payment_act` varchar(15) NOT NULL default '',
375   `default_inventory_act` varchar(15) NOT NULL default '',
376   `default_cogs_act` varchar(15) NOT NULL default '',
377   `default_adj_act` varchar(15) NOT NULL default '',
378   `default_inv_sales_act` varchar(15) NOT NULL default '',
379   `default_assembly_act` varchar(15) NOT NULL default '',
380   `payroll_act` varchar(15) NOT NULL default '',
381   `allow_negative_stock` tinyint(1) NOT NULL default '0',
382   `po_over_receive` int(11) NOT NULL default '10',
383   `po_over_charge` int(11) NOT NULL default '10',
384   `default_credit_limit` int(11) NOT NULL default '1000',
385   `default_workorder_required` int(11) NOT NULL default '20',
386   `default_dim_required` int(11) NOT NULL default '20',
387   `past_due_days` int(11) NOT NULL default '30',
388   `use_dimension` tinyint(1) default '0',
389   `f_year` int(11) NOT NULL default '1',
390   `no_item_list` tinyint(1) NOT NULL default '0',
391   `no_customer_list` tinyint(1) NOT NULL default '0',
392   `no_supplier_list` tinyint(1) NOT NULL default '0',
393   `base_sales` int(11) NOT NULL default '-1',
394   `foreign_codes` tinyint(1) NOT NULL default '0',
395   `accumulate_shipping` tinyint(1) NOT NULL default '0',
396   `legal_text` tinytext NOT NULL,
397   `default_delivery_required` smallint(6) NOT NULL default '1',
398   `version_id` varchar(11) NOT NULL default '',
399   `time_zone` tinyint(1) NOT NULL default '0',
400   `add_pct` int(5) NOT NULL default '-1',
401   `round_to` int(5) NOT NULL default '1',
402   `login_tout` SMALLINT(6) NOT NULL DEFAULT '600',
403   PRIMARY KEY  (`coy_code`)
404 ) TYPE=MyISAM  ;
405
406 ### Data of table `0_company` ###
407
408 INSERT INTO `0_company` VALUES ('1', 'Company name', '', '', '1', '1', 'N/A', '', '', '', '', '', 'USD', '1200', '5060', '2100', '5690', '4450', '9990', '3590', '4430', '4010', '4510', '4500', '1510', '5010', '5040', '4010', '1530', '5000', '0', '10', '10', '1000', '20', '20', '30', '1', '1', '0', '0', '0', '1', '0', '0', '', '1', '2.2', '0', '-1', '1', '600');
409
410 ### Structure of table `0_credit_status` ###
411
412 DROP TABLE IF EXISTS `0_credit_status`;
413
414 CREATE TABLE `0_credit_status` (
415   `id` int(11) NOT NULL auto_increment,
416   `reason_description` char(100) NOT NULL default '',
417   `dissallow_invoices` tinyint(1) NOT NULL default '0',
418   `inactive` tinyint(1) NOT NULL default '0',
419   PRIMARY KEY  (`id`),
420   UNIQUE KEY `reason_description` (`reason_description`)
421 ) TYPE=MyISAM AUTO_INCREMENT=5 ;
422
423
424 ### Data of table `0_credit_status` ###
425
426 INSERT INTO `0_credit_status` VALUES ('1', 'Good History', '0', '0');
427 INSERT INTO `0_credit_status` VALUES ('3', 'No more work until payment received', '1', '0');
428 INSERT INTO `0_credit_status` VALUES ('4', 'In liquidation', '1', '0');
429
430
431 ### Structure of table `0_currencies` ###
432
433 DROP TABLE IF EXISTS `0_currencies`;
434
435 CREATE TABLE `0_currencies` (
436   `currency` varchar(60) NOT NULL default '',
437   `curr_abrev` char(3) NOT NULL default '',
438   `curr_symbol` varchar(10) NOT NULL default '',
439   `country` varchar(100) NOT NULL default '',
440   `hundreds_name` varchar(15) NOT NULL default '',
441   `auto_update` tinyint(1) NOT NULL default '1',
442   `inactive` tinyint(1) NOT NULL default '0',
443   PRIMARY KEY  (`curr_abrev`)
444 ) TYPE=MyISAM  ;
445
446
447 ### Data of table `0_currencies` ###
448
449 INSERT INTO `0_currencies` VALUES ('US Dollars', 'USD', '$', 'United States', 'Cents', '1', '0');
450 INSERT INTO `0_currencies` VALUES ('CA Dollars', 'CAD', '$', 'Canada', 'Cents', '1', '0');
451 INSERT INTO `0_currencies` VALUES ('Euro', 'EUR', '?', 'Europe', 'Cents', '1', '0');
452 INSERT INTO `0_currencies` VALUES ('Pounds', 'GBP', '?', 'England', 'Pence', '1', '0');
453
454 ### Structure of table `0_cust_allocations` ###
455
456 DROP TABLE IF EXISTS `0_cust_allocations`;
457
458 CREATE TABLE `0_cust_allocations` (
459   `id` int(11) NOT NULL auto_increment,
460   `amt` double unsigned default NULL,
461   `date_alloc` date NOT NULL default '0000-00-00',
462   `trans_no_from` int(11) default NULL,
463   `trans_type_from` int(11) default NULL,
464   `trans_no_to` int(11) default NULL,
465   `trans_type_to` int(11) default NULL,
466   PRIMARY KEY  (`id`),
467   KEY `From` (`trans_type_from`, `trans_no_from`),
468   KEY `To` (`trans_type_to`, `trans_no_to`)
469 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
470
471
472 ### Data of table `0_cust_allocations` ###
473
474
475
476 ### Structure of table `0_cust_branch` ###
477
478 DROP TABLE IF EXISTS `0_cust_branch`;
479
480 CREATE TABLE `0_cust_branch` (
481   `branch_code` int(11) NOT NULL auto_increment,
482   `debtor_no` int(11) NOT NULL default '0',
483   `br_name` varchar(60) NOT NULL default '',
484   `branch_ref`  varchar(30) NOT NULL default '',
485   `br_address` tinytext NOT NULL,
486   `area` int(11) default NULL,
487   `salesman` int(11) NOT NULL default '0',
488   `phone` varchar(30) NOT NULL default '',
489   `phone2` varchar(30) NOT NULL default '',
490   `fax` varchar(30) NOT NULL default '',
491   `contact_name` varchar(60) NOT NULL default '',
492   `email` varchar(100) NOT NULL default '',
493   `default_location` varchar(5) NOT NULL default '',
494   `tax_group_id` int(11) default NULL,
495   `sales_account` varchar(15) default NULL,
496   `sales_discount_account` varchar(15) default NULL,
497   `receivables_account` varchar(15) default NULL,
498   `payment_discount_account` varchar(15) default NULL,
499   `default_ship_via` int(11) NOT NULL default '1',
500   `disable_trans` tinyint(4) NOT NULL default '0',
501   `br_post_address` tinytext NOT NULL,
502   `group_no` int(11) NOT NULL default '0',
503   `notes` tinytext NOT NULL,
504   `rep_lang` char(5) default NULL,
505   `inactive` tinyint(1) NOT NULL default '0',
506   PRIMARY KEY  (`branch_code`,`debtor_no`),
507   KEY `branch_code` (`branch_code`),
508   KEY (`branch_ref`),
509   KEY (`group_no`)
510 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
511
512
513 ### Data of table `0_cust_branch` ###
514
515
516
517 ### Structure of table `0_debtor_trans` ###
518
519 DROP TABLE IF EXISTS `0_debtor_trans`;
520
521 CREATE TABLE `0_debtor_trans` (
522   `trans_no` int(11) unsigned NOT NULL default '0',
523   `type` smallint(6) unsigned NOT NULL default '0',
524   `version` tinyint(1) unsigned NOT NULL default '0',
525   `debtor_no` int(11) unsigned default NULL,
526   `branch_code` int(11) NOT NULL default '-1',
527   `tran_date` date NOT NULL default '0000-00-00',
528   `due_date` date NOT NULL default '0000-00-00',
529   `reference` varchar(60) NOT NULL default '',
530   `tpe` int(11) NOT NULL default '0',
531   `order_` int(11) NOT NULL default '0',
532   `ov_amount` double NOT NULL default '0',
533   `ov_gst` double NOT NULL default '0',
534   `ov_freight` double NOT NULL default '0',
535   `ov_freight_tax` double NOT NULL default '0',
536   `ov_discount` double NOT NULL default '0',
537   `alloc` double NOT NULL default '0',
538   `rate` double NOT NULL default '1',
539   `ship_via` int(11) default NULL,
540   `trans_link` int(11) NOT NULL default '0',
541   `dimension_id` int(11) NOT NULL default '0',
542   `dimension2_id` int(11) NOT NULL default '0',
543   `payment_terms` int(11) default NULL,
544   PRIMARY KEY  (`type`, `trans_no`),
545   KEY `debtor_no` (`debtor_no`,`branch_code`),
546   KEY (`tran_date`)
547 ) TYPE=InnoDB  ;
548
549
550 ### Data of table `0_debtor_trans` ###
551
552
553
554 ### Structure of table `0_debtor_trans_details` ###
555
556 DROP TABLE IF EXISTS `0_debtor_trans_details`;
557
558 CREATE TABLE `0_debtor_trans_details` (
559   `id` int(11) NOT NULL auto_increment,
560   `debtor_trans_no` int(11) default NULL,
561   `debtor_trans_type` int(11) default NULL,
562   `stock_id` varchar(20) NOT NULL default '',
563   `description` tinytext,
564   `unit_price` double NOT NULL default '0',
565   `unit_tax` double NOT NULL default '0',
566   `quantity` double NOT NULL default '0',
567   `discount_percent` double NOT NULL default '0',
568   `standard_cost` double NOT NULL default '0',
569   `qty_done` double NOT NULL default '0',
570   PRIMARY KEY  (`id`),
571   KEY `Transaction` (`debtor_trans_type`, `debtor_trans_no`)
572 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
573
574
575 ### Data of table `0_debtor_trans_details` ###
576
577
578
579 ### Structure of table `0_debtors_master` ###
580
581 DROP TABLE IF EXISTS `0_debtors_master`;
582
583 CREATE TABLE `0_debtors_master` (
584   `debtor_no` int(11) NOT NULL auto_increment,
585   `name` varchar(100) NOT NULL default '',
586   `debtor_ref` varchar(30) NOT NULL,
587   `address` tinytext,
588   `email` varchar(100) NOT NULL default '',
589   `tax_id` varchar(55) NOT NULL default '',
590   `curr_code` char(3) NOT NULL default '',
591   `rep_lang` char(5) default NULL,
592   `sales_type` int(11) NOT NULL default '1',
593   `dimension_id` int(11) NOT NULL default '0',
594   `dimension2_id` int(11) NOT NULL default '0',
595   `credit_status` int(11) NOT NULL default '0',
596   `payment_terms` int(11) default NULL,
597   `discount` double NOT NULL default '0',
598   `pymt_discount` double NOT NULL default '0',
599   `credit_limit` float NOT NULL default '1000',
600   `notes` tinytext NOT NULL,
601   `inactive` tinyint(1) NOT NULL default '0',
602   PRIMARY KEY  (`debtor_no`),
603   UNIQUE KEY `name` (`name`),
604   KEY (`debtor_ref`)
605 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
606
607
608 ### Data of table `0_debtors_master` ###
609
610
611
612 ### Structure of table `0_dimensions` ###
613
614 DROP TABLE IF EXISTS `0_dimensions`;
615
616 CREATE TABLE `0_dimensions` (
617   `id` int(11) NOT NULL auto_increment,
618   `reference` varchar(60) NOT NULL default '',
619   `name` varchar(60) NOT NULL default '',
620   `type_` tinyint(1) NOT NULL default '1',
621   `closed` tinyint(1) NOT NULL default '0',
622   `date_` date NOT NULL default '0000-00-00',
623   `due_date` date NOT NULL default '0000-00-00',
624   PRIMARY KEY  (`id`),
625   UNIQUE KEY `reference` (`reference`),
626   KEY (`date_`),
627   KEY (`due_date`),
628   KEY (`type_`)
629 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
630
631
632 ### Data of table `0_dimensions` ###
633
634
635
636 ### Structure of table `0_exchange_rates` ###
637
638 DROP TABLE IF EXISTS `0_exchange_rates`;
639
640 CREATE TABLE `0_exchange_rates` (
641   `id` int(11) NOT NULL auto_increment,
642   `curr_code` char(3) NOT NULL default '',
643   `rate_buy` double NOT NULL default '0',
644   `rate_sell` double NOT NULL default '0',
645   `date_` date NOT NULL default '0000-00-00',
646   PRIMARY KEY  (`id`),
647   UNIQUE KEY `curr_code` (`curr_code`,`date_`)
648 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
649
650
651 ### Data of table `0_exchange_rates` ###
652
653
654
655 ### Structure of table `0_fiscal_year` ###
656
657 DROP TABLE IF EXISTS `0_fiscal_year`;
658
659 CREATE TABLE `0_fiscal_year` (
660   `id` int(11) NOT NULL auto_increment,
661   `begin` date default '0000-00-00',
662   `end` date default '0000-00-00',
663   `closed` tinyint(1) NOT NULL default '0',
664   PRIMARY KEY  (`id`),
665   UNIQUE KEY(`begin`),
666   UNIQUE KEY(`end`)
667 ) TYPE=InnoDB AUTO_INCREMENT=2 ;
668
669
670 ### Data of table `0_fiscal_year` ###
671
672 INSERT INTO `0_fiscal_year` VALUES ('1', '2008-01-01', '2008-12-31', '0');
673
674
675 ### Structure of table `0_gl_trans` ###
676
677 DROP TABLE IF EXISTS `0_gl_trans`;
678
679 CREATE TABLE `0_gl_trans` (
680   `counter` int(11) NOT NULL auto_increment,
681   `type` smallint(6) NOT NULL default '0',
682   `type_no` bigint(16) NOT NULL default '1',
683   `tran_date` date NOT NULL default '0000-00-00',
684   `account` varchar(15) NOT NULL default '',
685   `memo_` tinytext NOT NULL,
686   `amount` double NOT NULL default '0',
687   `dimension_id` int(11) NOT NULL default '0',
688   `dimension2_id` int(11) NOT NULL default '0',
689   `person_type_id` int(11) default NULL,
690   `person_id` tinyblob,
691   PRIMARY KEY  (`counter`),
692   KEY `Type_and_Number` (`type`,`type_no`),
693   KEY (`dimension_id`),
694   KEY (`dimension2_id`),
695   KEY (`tran_date`),
696   KEY `account_and_tran_date` (`account`,`tran_date`)
697 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
698
699
700 ### Data of table `0_gl_trans` ###
701
702
703
704 ### Structure of table `0_grn_batch` ###
705
706 DROP TABLE IF EXISTS `0_grn_batch`;
707
708 CREATE TABLE `0_grn_batch` (
709   `id` int(11) NOT NULL auto_increment,
710   `supplier_id` int(11) NOT NULL default '0',
711   `purch_order_no` int(11) default NULL,
712   `reference` varchar(60) NOT NULL default '',
713   `delivery_date` date NOT NULL default '0000-00-00',
714   `loc_code` varchar(5) default NULL,
715   PRIMARY KEY  (`id`),
716   KEY(`delivery_date`),
717   KEY(`purch_order_no`)
718 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
719
720
721 ### Data of table `0_grn_batch` ###
722
723
724
725 ### Structure of table `0_grn_items` ###
726
727 DROP TABLE IF EXISTS `0_grn_items`;
728
729 CREATE TABLE `0_grn_items` (
730   `id` int(11) NOT NULL auto_increment,
731   `grn_batch_id` int(11) default NULL,
732   `po_detail_item` int(11) NOT NULL default '0',
733   `item_code` varchar(20) NOT NULL default '',
734   `description` tinytext,
735   `qty_recd` double NOT NULL default '0',
736   `quantity_inv` double NOT NULL default '0',
737   PRIMARY KEY  (`id`),
738   KEY (`grn_batch_id`)
739 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
740
741
742 ### Data of table `0_grn_items` ###
743
744
745
746 ### Structure of table `0_groups` ###
747
748 DROP TABLE IF EXISTS `0_groups`;
749
750 CREATE TABLE `0_groups` (
751   `id` smallint(6) unsigned NOT NULL auto_increment,
752   `description` varchar(60) NOT NULL default '',
753   `inactive` tinyint(1) NOT NULL default '0',
754   PRIMARY KEY  (`id`),
755   UNIQUE KEY `description` (`description`)
756 ) TYPE=MyISAM AUTO_INCREMENT=4 ;
757
758
759 ### Data of table `0_groups` ###
760
761 INSERT INTO `0_groups` VALUES ('1', 'Small', '0');
762 INSERT INTO `0_groups` VALUES ('2', 'Medium', '0');
763 INSERT INTO `0_groups` VALUES ('3', 'Large', '0');
764
765
766 ### Structure of table `0_item_codes` ###
767
768 DROP TABLE IF EXISTS `0_item_codes`;
769
770 CREATE TABLE `0_item_codes` (
771   `id` int(11) unsigned NOT NULL auto_increment,
772   `item_code` varchar(20) NOT NULL,
773   `stock_id` varchar(20) NOT NULL,
774   `description` varchar(200) NOT NULL default '',
775   `category_id` smallint(6) unsigned NOT NULL,
776   `quantity` double NOT NULL default '1',
777   `is_foreign` tinyint(1) NOT NULL default '0',
778   `inactive` tinyint(1) NOT NULL default '0',
779   PRIMARY KEY  (`id`),
780   UNIQUE KEY `stock_id` (`stock_id`,`item_code`),
781   KEY (`item_code`)
782 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
783
784
785 ### Data of table `0_item_codes` ###
786
787
788
789 ### Structure of table `0_item_tax_type_exemptions` ###
790
791 DROP TABLE IF EXISTS `0_item_tax_type_exemptions`;
792
793 CREATE TABLE `0_item_tax_type_exemptions` (
794   `item_tax_type_id` int(11) NOT NULL default '0',
795   `tax_type_id` int(11) NOT NULL default '0',
796   PRIMARY KEY  (`item_tax_type_id`,`tax_type_id`)
797 ) TYPE=InnoDB  ;
798
799
800 ### Data of table `0_item_tax_type_exemptions` ###
801
802
803
804 ### Structure of table `0_item_tax_types` ###
805
806 DROP TABLE IF EXISTS `0_item_tax_types`;
807
808 CREATE TABLE `0_item_tax_types` (
809   `id` int(11) NOT NULL auto_increment,
810   `name` varchar(60) NOT NULL default '',
811   `exempt` tinyint(1) NOT NULL default '0',
812   `inactive` tinyint(1) NOT NULL default '0',
813   PRIMARY KEY  (`id`),
814   UNIQUE KEY `name` (`name`)
815 ) TYPE=InnoDB AUTO_INCREMENT=2 ;
816
817
818 ### Data of table `0_item_tax_types` ###
819
820 INSERT INTO `0_item_tax_types` VALUES ('1', 'Regular', '0', '0');
821
822
823 ### Structure of table `0_item_units` ###
824
825 DROP TABLE IF EXISTS `0_item_units`;
826
827 CREATE TABLE `0_item_units` (
828   `abbr` varchar(20) NOT NULL,
829   `name` varchar(40) NOT NULL,
830   `decimals` tinyint(2) NOT NULL,
831   `inactive` tinyint(1) NOT NULL default '0',
832   PRIMARY KEY  (`abbr`),
833   UNIQUE KEY `name` (`name`)
834 ) TYPE=MyISAM  ;
835
836
837 ### Data of table `0_item_units` ###
838
839 INSERT INTO `0_item_units` VALUES ('ea.', 'Each', '0', '0');
840
841
842 ### Structure of table `0_loc_stock` ###
843
844 DROP TABLE IF EXISTS `0_loc_stock`;
845
846 CREATE TABLE `0_loc_stock` (
847   `loc_code` char(5) NOT NULL default '',
848   `stock_id` char(20) NOT NULL default '',
849   `reorder_level` bigint(20) NOT NULL default '0',
850   PRIMARY KEY  (`loc_code`,`stock_id`),
851   KEY `stock_id` (`stock_id`)
852 ) TYPE=InnoDB  ;
853
854
855 ### Data of table `0_loc_stock` ###
856
857
858
859 ### Structure of table `0_locations` ###
860
861 DROP TABLE IF EXISTS `0_locations`;
862
863 CREATE TABLE `0_locations` (
864   `loc_code` varchar(5) NOT NULL default '',
865   `location_name` varchar(60) NOT NULL default '',
866   `delivery_address` tinytext NOT NULL,
867   `phone` varchar(30) NOT NULL default '',
868   `phone2` varchar(30) NOT NULL default '',
869   `fax` varchar(30) NOT NULL default '',
870   `email` varchar(100) NOT NULL default '',
871   `contact` varchar(30) NOT NULL default '',
872   `inactive` tinyint(1) NOT NULL default '0',
873   PRIMARY KEY  (`loc_code`)
874 ) TYPE=MyISAM  ;
875
876
877 ### Data of table `0_locations` ###
878
879 INSERT INTO `0_locations` VALUES ('DEF', 'Default', 'N/A', '', '', '', '', '', '0');
880
881
882 ### Structure of table `0_movement_types` ###
883
884 DROP TABLE IF EXISTS `0_movement_types`;
885
886 CREATE TABLE `0_movement_types` (
887   `id` int(11) NOT NULL auto_increment,
888   `name` varchar(60) NOT NULL default '',
889   `inactive` tinyint(1) NOT NULL default '0',
890   PRIMARY KEY  (`id`),
891   UNIQUE KEY `name` (`name`)
892 ) TYPE=MyISAM AUTO_INCREMENT=2 ;
893
894
895 ### Data of table `0_movement_types` ###
896
897 INSERT INTO `0_movement_types` VALUES ('1', 'Adjustment', '0');
898
899
900 ### Structure of table `0_payment_terms` ###
901
902 DROP TABLE IF EXISTS `0_payment_terms`;
903
904 CREATE TABLE `0_payment_terms` (
905   `terms_indicator` int(11) NOT NULL auto_increment,
906   `terms` char(80) NOT NULL default '',
907   `days_before_due` smallint(6) NOT NULL default '0',
908   `day_in_following_month` smallint(6) NOT NULL default '0',
909   `inactive` tinyint(1) NOT NULL default '0',
910   PRIMARY KEY  (`terms_indicator`),
911   UNIQUE KEY `terms` (`terms`)
912 ) TYPE=MyISAM AUTO_INCREMENT=5 ;
913
914
915 ### Data of table `0_payment_terms` ###
916
917 INSERT INTO `0_payment_terms` VALUES ('1', 'Due 15th Of the Following Month', '0', '17', '0');
918 INSERT INTO `0_payment_terms` VALUES ('2', 'Due By End Of The Following Month', '0', '30', '0');
919 INSERT INTO `0_payment_terms` VALUES ('3', 'Payment due within 10 days', '10', '0', '0');
920 INSERT INTO `0_payment_terms` VALUES ('4', 'Cash Only', '1', '0', '0');
921
922
923 ### Structure of table `0_prices` ###
924
925 DROP TABLE IF EXISTS `0_prices`;
926
927 CREATE TABLE `0_prices` (
928   `id` int(11) NOT NULL auto_increment,
929   `stock_id` varchar(20) NOT NULL default '',
930   `sales_type_id` int(11) NOT NULL default '0',
931   `curr_abrev` char(3) NOT NULL default '',
932   `price` double NOT NULL default '0',
933   PRIMARY KEY  (`id`),
934   UNIQUE KEY `price` (`stock_id`,`sales_type_id`,`curr_abrev`)
935 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
936
937
938 ### Data of table `0_prices` ###
939
940
941
942 ### Structure of table `0_print_profiles` ###
943
944 DROP TABLE IF EXISTS `0_print_profiles`;
945
946 CREATE TABLE `0_print_profiles` (
947   `id` smallint(6) unsigned NOT NULL auto_increment,
948   `profile` varchar(30) NOT NULL,
949   `report` varchar(5) default NULL,
950   `printer` tinyint(3) unsigned default NULL,
951   PRIMARY KEY  (`id`),
952   UNIQUE KEY `profile` (`profile`,`report`)
953 ) TYPE=MyISAM AUTO_INCREMENT=10 ;
954
955
956 ### Data of table `0_print_profiles` ###
957
958 INSERT INTO `0_print_profiles` VALUES ('1', 'Out of office', '', '0');
959 INSERT INTO `0_print_profiles` VALUES ('2', 'Sales Department', '', '0');
960 INSERT INTO `0_print_profiles` VALUES ('3', 'Central', '', '2');
961 INSERT INTO `0_print_profiles` VALUES ('4', 'Sales Department', '104', '2');
962 INSERT INTO `0_print_profiles` VALUES ('5', 'Sales Department', '105', '2');
963 INSERT INTO `0_print_profiles` VALUES ('6', 'Sales Department', '107', '2');
964 INSERT INTO `0_print_profiles` VALUES ('7', 'Sales Department', '109', '2');
965 INSERT INTO `0_print_profiles` VALUES ('8', 'Sales Department', '110', '2');
966 INSERT INTO `0_print_profiles` VALUES ('9', 'Sales Department', '201', '2');
967
968
969 ### Structure of table `0_printers` ###
970
971 DROP TABLE IF EXISTS `0_printers`;
972
973 CREATE TABLE `0_printers` (
974   `id` tinyint(3) unsigned NOT NULL auto_increment,
975   `name` varchar(20) NOT NULL,
976   `description` varchar(60) NOT NULL,
977   `queue` varchar(20) NOT NULL,
978   `host` varchar(40) NOT NULL,
979   `port` smallint(11) unsigned NOT NULL,
980   `timeout` tinyint(3) unsigned NOT NULL,
981   PRIMARY KEY  (`id`),
982   UNIQUE KEY `name` (`name`)
983 ) TYPE=MyISAM AUTO_INCREMENT=4 ;
984
985
986 ### Data of table `0_printers` ###
987
988 INSERT INTO `0_printers` VALUES ('1', 'QL500', 'Label printer', 'QL500', 'server', '127', '20');
989 INSERT INTO `0_printers` VALUES ('2', 'Samsung', 'Main network printer', 'scx4521F', 'server', '515', '5');
990 INSERT INTO `0_printers` VALUES ('3', 'Local', 'Local print server at user IP', 'lp', '', '515', '10');
991
992
993 ### Structure of table `0_purch_data` ###
994
995 DROP TABLE IF EXISTS `0_purch_data`;
996
997 CREATE TABLE `0_purch_data` (
998   `supplier_id` int(11) NOT NULL default '0',
999   `stock_id` char(20) NOT NULL default '',
1000   `price` double NOT NULL default '0',
1001   `suppliers_uom` char(50) NOT NULL default '',
1002   `conversion_factor` double NOT NULL default '1',
1003   `supplier_description` char(50) NOT NULL default '',
1004   PRIMARY KEY  (`supplier_id`,`stock_id`)
1005 ) TYPE=MyISAM  ;
1006
1007
1008 ### Data of table `0_purch_data` ###
1009
1010
1011
1012 ### Structure of table `0_purch_order_details` ###
1013
1014 DROP TABLE IF EXISTS `0_purch_order_details`;
1015
1016 CREATE TABLE `0_purch_order_details` (
1017   `po_detail_item` int(11) NOT NULL auto_increment,
1018   `order_no` int(11) NOT NULL default '0',
1019   `item_code` varchar(20) NOT NULL default '',
1020   `description` tinytext,
1021   `delivery_date` date NOT NULL default '0000-00-00',
1022   `qty_invoiced` double NOT NULL default '0',
1023   `unit_price` double NOT NULL default '0',
1024   `act_price` double NOT NULL default '0',
1025   `std_cost_unit` double NOT NULL default '0',
1026   `quantity_ordered` double NOT NULL default '0',
1027   `quantity_received` double NOT NULL default '0',
1028   PRIMARY KEY  (`po_detail_item`),
1029   KEY `order` (`order_no`, `po_detail_item`)
1030 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1031
1032
1033 ### Data of table `0_purch_order_details` ###
1034
1035
1036
1037 ### Structure of table `0_purch_orders` ###
1038
1039 DROP TABLE IF EXISTS `0_purch_orders`;
1040
1041 CREATE TABLE `0_purch_orders` (
1042   `order_no` int(11) NOT NULL auto_increment,
1043   `supplier_id` int(11) NOT NULL default '0',
1044   `comments` tinytext,
1045   `ord_date` date NOT NULL default '0000-00-00',
1046   `reference` tinytext NOT NULL,
1047   `requisition_no` tinytext,
1048   `into_stock_location` varchar(5) NOT NULL default '',
1049   `delivery_address` tinytext NOT NULL,
1050   PRIMARY KEY  (`order_no`),
1051   KEY (`ord_date`)
1052 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1053
1054
1055 ### Data of table `0_purch_orders` ###
1056
1057
1058
1059 ### Structure of table `0_quick_entries` ###
1060
1061 DROP TABLE IF EXISTS `0_quick_entries`;
1062
1063 CREATE TABLE `0_quick_entries` (
1064   `id` smallint(6) unsigned NOT NULL auto_increment,
1065   `type` tinyint(1) NOT NULL default '0',
1066   `description` varchar(60) NOT NULL,
1067   `base_amount` double NOT NULL default '0',
1068   `base_desc` varchar(60) default NULL,
1069   `bal_type` tinyint(1) NOT NULL default '0',
1070   PRIMARY KEY  (`id`),
1071   KEY `description` (`description`)
1072 ) TYPE=MyISAM AUTO_INCREMENT=4 ;
1073
1074
1075 ### Data of table `0_quick_entries` ###
1076
1077 INSERT INTO `0_quick_entries` VALUES ('1', '1', 'Maintenance', '0', 'Amount', '0');
1078 INSERT INTO `0_quick_entries` VALUES ('2', '4', 'Phone', '0', 'Amount', '0');
1079 INSERT INTO `0_quick_entries` VALUES ('3', '2', 'Cash Sales', '0', 'Amount', '0');
1080
1081
1082 ### Structure of table `0_quick_entry_lines` ###
1083
1084 DROP TABLE IF EXISTS `0_quick_entry_lines`;
1085
1086 CREATE TABLE `0_quick_entry_lines` (
1087   `id` smallint(6) unsigned NOT NULL auto_increment,
1088   `qid` smallint(6) unsigned NOT NULL,
1089   `amount` double default '0',
1090   `action` varchar(2) NOT NULL,
1091   `dest_id` varchar(15) NOT NULL,
1092   `dimension_id` smallint(6) unsigned default NULL,
1093   `dimension2_id` smallint(6) unsigned default NULL,
1094   PRIMARY KEY  (`id`),
1095   KEY `qid` (`qid`)
1096 ) TYPE=MyISAM AUTO_INCREMENT=7 ;
1097
1098
1099 ### Data of table `0_quick_entry_lines` ###
1100
1101 INSERT INTO `0_quick_entry_lines` VALUES ('1', '1', '0', 't-', '1', '0', '0');
1102 INSERT INTO `0_quick_entry_lines` VALUES ('2', '2', '0', 't-', '1', '0', '0');
1103 INSERT INTO `0_quick_entry_lines` VALUES ('3', '3', '0', 't-', '1', '0', '0');
1104 INSERT INTO `0_quick_entry_lines` VALUES ('4', '3', '0', '=', '4010', '0', '0');
1105 INSERT INTO `0_quick_entry_lines` VALUES ('5', '1', '0', '=', '5765', '0', '0');
1106 INSERT INTO `0_quick_entry_lines` VALUES ('6', '2', '0', '=', '5780', '0', '0');
1107
1108
1109 ### Structure of table `0_recurrent_invoices` ###
1110
1111 DROP TABLE IF EXISTS `0_recurrent_invoices`;
1112
1113 CREATE TABLE `0_recurrent_invoices` (
1114   `id` smallint(6) unsigned NOT NULL auto_increment,
1115   `description` varchar(60) NOT NULL default '',
1116   `order_no` int(11) unsigned NOT NULL,
1117   `debtor_no` int(11) unsigned default NULL,
1118   `group_no` smallint(6) unsigned default NULL,
1119   `days` int(11) NOT NULL default '0',
1120   `monthly` int(11) NOT NULL default '0',
1121   `begin` date NOT NULL default '0000-00-00',
1122   `end` date NOT NULL default '0000-00-00',
1123   `last_sent` date NOT NULL default '0000-00-00',
1124   PRIMARY KEY  (`id`),
1125   UNIQUE KEY `description` (`description`)
1126 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1127
1128
1129 ### Data of table `0_recurrent_invoices` ###
1130
1131
1132
1133 ### Structure of table `0_refs` ###
1134
1135 DROP TABLE IF EXISTS `0_refs`;
1136
1137 CREATE TABLE `0_refs` (
1138   `id` int(11) NOT NULL default '0',
1139   `type` int(11) NOT NULL default '0',
1140   `reference` varchar(100) NOT NULL default '',
1141   PRIMARY KEY  (`id`,`type`),
1142   KEY `Type_and_Reference` (`type`,`reference`)
1143 ) TYPE=InnoDB  ;
1144
1145
1146 ### Data of table `0_refs` ###
1147
1148
1149
1150 ### Structure of table `0_sales_order_details` ###
1151
1152 DROP TABLE IF EXISTS `0_sales_order_details`;
1153
1154 CREATE TABLE `0_sales_order_details` (
1155   `id` int(11) NOT NULL auto_increment,
1156   `order_no` int(11) NOT NULL default '0',
1157   `trans_type` smallint(6) NOT NULL default '30',
1158   `stk_code` varchar(20) NOT NULL default '',
1159   `description` tinytext,
1160   `qty_sent` double NOT NULL default '0',
1161   `unit_price` double NOT NULL default '0',
1162   `quantity` double NOT NULL default '0',
1163   `discount_percent` double NOT NULL default '0',
1164   PRIMARY KEY  (`id`),
1165   KEY `sorder` (`trans_type`, `order_no`)
1166 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1167
1168
1169 ### Data of table `0_sales_order_details` ###
1170
1171
1172
1173 ### Structure of table `0_sales_orders` ###
1174
1175 DROP TABLE IF EXISTS `0_sales_orders`;
1176
1177 CREATE TABLE `0_sales_orders` (
1178   `order_no` int(11) NOT NULL,
1179   `trans_type` smallint(6) NOT NULL default '30',
1180   `version` tinyint(1) unsigned NOT NULL default '0',
1181   `type` tinyint(1) NOT NULL default '0',
1182   `debtor_no` int(11) NOT NULL default '0',
1183   `branch_code` int(11) NOT NULL default '0',
1184   `reference` varchar(100) NOT NULL default '',
1185   `customer_ref` tinytext NOT NULL,
1186   `comments` tinytext,
1187   `ord_date` date NOT NULL default '0000-00-00',
1188   `order_type` int(11) NOT NULL default '0',
1189   `ship_via` int(11) NOT NULL default '0',
1190   `delivery_address` tinytext NOT NULL,
1191   `contact_phone` varchar(30) default NULL,
1192   `contact_email` varchar(100) default NULL,
1193   `deliver_to` tinytext NOT NULL,
1194   `freight_cost` double NOT NULL default '0',
1195   `from_stk_loc` varchar(5) NOT NULL default '',
1196   `delivery_date` date NOT NULL default '0000-00-00',
1197   `payment_terms` int(11) default NULL,
1198   PRIMARY KEY  (`trans_type`, `order_no`)
1199 ) TYPE=InnoDB;
1200
1201
1202 ### Data of table `0_sales_orders` ###
1203
1204
1205
1206 ### Structure of table `0_sales_pos` ###
1207
1208 DROP TABLE IF EXISTS `0_sales_pos`;
1209
1210 CREATE TABLE `0_sales_pos` (
1211   `id` smallint(6) unsigned NOT NULL auto_increment,
1212   `pos_name` varchar(30) NOT NULL,
1213   `cash_sale` tinyint(1) NOT NULL,
1214   `credit_sale` tinyint(1) NOT NULL,
1215   `pos_location` varchar(5) NOT NULL,
1216   `pos_account` smallint(6) unsigned NOT NULL,
1217   `inactive` tinyint(1) NOT NULL default '0',
1218   PRIMARY KEY  (`id`),
1219   UNIQUE KEY `pos_name` (`pos_name`)
1220 ) TYPE=MyISAM AUTO_INCREMENT=2 ;
1221
1222
1223 ### Data of table `0_sales_pos` ###
1224
1225 INSERT INTO `0_sales_pos` VALUES ('1', 'Default', '1', '1', 'DEF', '2', '0');
1226
1227
1228 ### Structure of table `0_sales_types` ###
1229
1230 DROP TABLE IF EXISTS `0_sales_types`;
1231
1232 CREATE TABLE `0_sales_types` (
1233   `id` int(11) NOT NULL auto_increment,
1234   `sales_type` char(50) NOT NULL default '',
1235   `tax_included` int(1) NOT NULL default '0',
1236   `factor` double NOT NULL default '1',
1237   `inactive` tinyint(1) NOT NULL default '0',
1238   PRIMARY KEY  (`id`),
1239   UNIQUE KEY `sales_type` (`sales_type`)
1240 ) TYPE=MyISAM AUTO_INCREMENT=3 ;
1241
1242
1243 ### Data of table `0_sales_types` ###
1244
1245 INSERT INTO `0_sales_types` VALUES ('1', 'Retail', '1', '1', '0');
1246 INSERT INTO `0_sales_types` VALUES ('2', 'Wholesale', '0', '0.7', '0');
1247
1248
1249 ### Structure of table `0_salesman` ###
1250
1251 DROP TABLE IF EXISTS `0_salesman`;
1252
1253 CREATE TABLE `0_salesman` (
1254   `salesman_code` int(11) NOT NULL auto_increment,
1255   `salesman_name` char(60) NOT NULL default '',
1256   `salesman_phone` char(30) NOT NULL default '',
1257   `salesman_fax` char(30) NOT NULL default '',
1258   `salesman_email` varchar(100) NOT NULL default '',
1259   `provision` double NOT NULL default '0',
1260   `break_pt` double NOT NULL default '0',
1261   `provision2` double NOT NULL default '0',
1262   `inactive` tinyint(1) NOT NULL default '0',
1263   PRIMARY KEY  (`salesman_code`),
1264   UNIQUE KEY `salesman_name` (`salesman_name`)
1265 ) TYPE=MyISAM AUTO_INCREMENT=2 ;
1266
1267
1268 ### Data of table `0_salesman` ###
1269
1270 INSERT INTO `0_salesman` VALUES ('1', 'Sales Person', '', '', '', '5', '1000', '4', '0');
1271
1272 ### Structure of table `0_security_roles` ###
1273
1274 DROP TABLE IF EXISTS `0_security_roles`;
1275 CREATE TABLE IF NOT EXISTS `0_security_roles` (
1276   `id` int(11) NOT NULL auto_increment,
1277   `role` varchar(30) NOT NULL,
1278   `description` varchar(50) default NULL,
1279   `sections` text,
1280   `areas` text,
1281   `inactive` tinyint(1) NOT NULL default '0',
1282   PRIMARY KEY  (`id`),
1283   UNIQUE KEY `role` (`role`)
1284 ) TYPE=MyISAM  AUTO_INCREMENT=11 ;
1285
1286 --
1287 -- Data of table `0_security_roles`
1288 --
1289
1290 INSERT INTO `0_security_roles` VALUES (1, 'Inquiries', 'Inquiries', '768;2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15872;16128', '257;258;259;260;513;514;515;516;517;518;519;520;521;522;523;524;525;773;774;2822;3073;3075;3076;3077;3329;3330;3331;3332;3333;3334;3335;5377;5633;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8450;8451;10497;10753;11009;11010;11012;13313;13315;15617;15618;15619;15620;15621;15622;15623;15624;15625;15626;15873;15882;16129;16130;16131;16132', 0);
1291 INSERT INTO `0_security_roles` VALUES (2, 'System Administrator', 'System Administrator', '256;512;768;2816;3072;3328;5376;5632;5888;7936;8192;8448;10496;10752;11008;13056;13312;15616;15872;16128', '257;258;259;260;513;514;515;516;517;518;519;520;521;522;523;524;525;769;770;771;772;773;774;2817;2818;2819;2820;2821;2822;2823;3073;3074;3082;3075;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5634;5635;5636;5637;5641;5638;5639;5640;5889;5891;7937;7938;7939;7940;8193;8194;8195;8196;8197;8449;8450;8451;10497;10753;10754;10755;10756;10757;11009;11010;11012;13057;13313;13314;13315;15617;15618;15619;15620;15621;15622;15623;15624;15625;15626;15627;15873;15874;15875;15876;15877;15878;15879;15880;15883;15881;15882;16129;16130;16131;16132', 0);
1292 INSERT INTO `0_security_roles` VALUES (3, 'Salesman', 'Salesman', '768;3072;5632;8192;15872', '773;774;3073;3075;3081;5633;8194;15873', 0);
1293 INSERT INTO `0_security_roles` VALUES (4, 'Stock Manager', 'Stock Manager', '2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15872;16128', '2818;2822;3073;3076;3077;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5633;5640;5889;5890;5891;8193;8194;8450;8451;10753;11009;11010;11012;13313;13315;15882;16129;16130;16131;16132', 0);
1294 INSERT INTO `0_security_roles` VALUES (5, 'Production Manager', 'Production Manager', '512;2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '521;523;524;2818;2819;2820;2821;2822;2823;3073;3074;3076;3077;3078;3079;3080;3081;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5633;5640;5640;5889;5890;5891;8193;8194;8196;8197;8450;8451;10753;10755;11009;11010;11012;13313;13315;15617;15619;15620;15621;15624;15624;15876;15877;15880;15882;16129;16130;16131;16132', 0);
1295 INSERT INTO `0_security_roles` VALUES (6, 'Purchase Officer', 'Purchase Officer', '512;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '521;523;524;2818;2819;2820;2821;2822;2823;3073;3074;3076;3077;3078;3079;3080;3081;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5377;5633;5635;5640;5640;5889;5890;5891;8193;8194;8196;8197;8449;8450;8451;10753;10755;11009;11010;11012;13313;13315;15617;15619;15620;15621;15624;15624;15876;15877;15880;15882;16129;16130;16131;16132', 0);
1296 INSERT INTO `0_security_roles` VALUES (7, 'AR Officer', 'AR Officer', '512;768;2816;3072;3328;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '521;523;524;771;773;774;2818;2819;2820;2821;2822;2823;3073;3073;3074;3075;3076;3077;3078;3079;3080;3081;3081;3329;3330;3330;3330;3331;3331;3332;3333;3334;3335;5633;5633;5634;5637;5638;5639;5640;5640;5889;5890;5891;8193;8194;8194;8196;8197;8450;8451;10753;10755;11009;11010;11012;13313;13315;15617;15619;15620;15621;15624;15624;15873;15876;15877;15878;15880;15882;16129;16130;16131;16132', 0);
1297 INSERT INTO `0_security_roles` VALUES (8, 'AP Officer', 'AP Officer', '512;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '257;258;259;260;521;523;524;769;770;771;772;773;774;2818;2819;2820;2821;2822;2823;3073;3074;3082;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5635;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8196;8197;8449;8450;8451;10497;10753;10755;11009;11010;11012;13057;13313;13315;15617;15619;15620;15621;15624;15876;15877;15880;15882;16129;16130;16131;16132', 0);
1298 INSERT INTO `0_security_roles` VALUES (9, 'Accountant', 'New Accountant', '512;768;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '257;258;259;260;521;523;524;771;772;773;774;2818;2819;2820;2821;2822;2823;3073;3074;3075;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5634;5635;5637;5638;5639;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8196;8197;8449;8450;8451;10497;10753;10755;11009;11010;11012;13313;13315;15617;15618;15619;15620;15621;15624;15873;15876;15877;15878;15880;15882;16129;16130;16131;16132', 0);
1299 INSERT INTO `0_security_roles` VALUES (10, 'Sub Admin', 'Sub Admin', '512;768;2816;3072;3328;5376;5632;5888;8192;8448;10752;11008;13312;15616;15872;16128', '257;258;259;260;521;523;524;771;772;773;774;2818;2819;2820;2821;2822;2823;3073;3074;3082;3075;3076;3077;3078;3079;3080;3081;3329;3330;3331;3332;3333;3334;3335;5377;5633;5634;5635;5637;5638;5639;5640;5889;5890;5891;7937;7938;7939;7940;8193;8194;8196;8197;8449;8450;8451;10497;10753;10755;11009;11010;11012;13057;13313;13315;15617;15619;15620;15621;15624;15873;15874;15876;15877;15878;15879;15880;15882;16129;16130;16131;16132', 0);
1300
1301 ### Structure of table `0_shippers` ###
1302
1303 DROP TABLE IF EXISTS `0_shippers`;
1304
1305 CREATE TABLE `0_shippers` (
1306   `shipper_id` int(11) NOT NULL auto_increment,
1307   `shipper_name` varchar(60) NOT NULL default '',
1308   `phone` varchar(30) NOT NULL default '',
1309   `phone2` varchar(30) NOT NULL default '',
1310   `contact` tinytext NOT NULL,
1311   `address` tinytext NOT NULL,
1312   `inactive` tinyint(1) NOT NULL default '0',
1313   PRIMARY KEY  (`shipper_id`),
1314   UNIQUE KEY `name` (`shipper_name`)
1315 ) TYPE=MyISAM AUTO_INCREMENT=2 ;
1316
1317
1318 ### Data of table `0_shippers` ###
1319
1320 INSERT INTO `0_shippers` VALUES ('1', 'Default', '', '', '', '', '0');
1321
1322
1323 ### Structure of table `0_sql_trail` ###
1324
1325 DROP TABLE IF EXISTS `0_sql_trail`;
1326
1327 CREATE TABLE `0_sql_trail` (
1328   `id` int(11) unsigned NOT NULL auto_increment,
1329   `sql` text NOT NULL,
1330   `result` tinyint(1) NOT NULL,
1331   `msg` varchar(255) NOT NULL,
1332   PRIMARY KEY  (`id`)
1333 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
1334
1335
1336 ### Data of table `0_sql_trail` ###
1337
1338
1339
1340 ### Structure of table `0_stock_category` ###
1341
1342 DROP TABLE IF EXISTS `0_stock_category`;
1343
1344 CREATE TABLE `0_stock_category` (
1345   `category_id` int(11) NOT NULL auto_increment,
1346   `description` varchar(60) NOT NULL default '',
1347   `dflt_tax_type` int(11) NOT NULL default '1',
1348   `dflt_units` varchar(20) NOT NULL default 'each',
1349   `dflt_mb_flag` char(1) NOT NULL default 'B',
1350   `dflt_sales_act` varchar(15) NOT NULL default '',
1351   `dflt_cogs_act` varchar(15) NOT NULL default '',
1352   `dflt_inventory_act` varchar(15) NOT NULL default '',
1353   `dflt_adjustment_act` varchar(15) NOT NULL default '',
1354   `dflt_assembly_act` varchar(15) NOT NULL default '',
1355   `dflt_dim1` int(11) default NULL,
1356   `dflt_dim2` int(11) default NULL,
1357   `inactive` tinyint(1) NOT NULL default '0',
1358   `dflt_no_sale` tinyint(1) NOT NULL default '0',
1359   PRIMARY KEY  (`category_id`),
1360   UNIQUE KEY `description` (`description`)
1361 ) TYPE=MyISAM AUTO_INCREMENT=5 ;
1362
1363
1364 ### Data of table `0_stock_category` ###
1365
1366 INSERT INTO `0_stock_category` VALUES ('1', 'Components', '1', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0');
1367 INSERT INTO `0_stock_category` VALUES ('2', 'Charges', '1', 'each', 'D', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0');
1368 INSERT INTO `0_stock_category` VALUES ('3', 'Systems', '1', 'each', 'M', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0');
1369 INSERT INTO `0_stock_category` VALUES ('4', 'Services', '1', 'hrs', 'D', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0');
1370
1371
1372 ### Structure of table `0_stock_master` ###
1373
1374 DROP TABLE IF EXISTS `0_stock_master`;
1375
1376 CREATE TABLE `0_stock_master` (
1377   `stock_id` varchar(20) NOT NULL default '',
1378   `category_id` int(11) NOT NULL default '0',
1379   `tax_type_id` int(11) NOT NULL default '0',
1380   `description` varchar(200) NOT NULL default '',
1381   `long_description` tinytext NOT NULL,
1382   `units` varchar(20) NOT NULL default 'each',
1383   `mb_flag` char(1) NOT NULL default 'B',
1384   `sales_account` varchar(15) NOT NULL default '',
1385   `cogs_account` varchar(15) NOT NULL default '',
1386   `inventory_account` varchar(15) NOT NULL default '',
1387   `adjustment_account` varchar(15) NOT NULL default '',
1388   `assembly_account` varchar(15) NOT NULL default '',
1389   `dimension_id` int(11) default NULL,
1390   `dimension2_id` int(11) default NULL,
1391   `actual_cost` double NOT NULL default '0',
1392   `last_cost` double NOT NULL default '0',
1393   `material_cost` double NOT NULL default '0',
1394   `labour_cost` double NOT NULL default '0',
1395   `overhead_cost` double NOT NULL default '0',
1396   `inactive` tinyint(1) NOT NULL default '0',
1397   `no_sale` tinyint(1) NOT NULL default '0',
1398   `editable` tinyint(1) NOT NULL default '0',
1399   PRIMARY KEY  (`stock_id`)
1400 ) TYPE=InnoDB  ;
1401
1402
1403 ### Data of table `0_stock_master` ###
1404
1405
1406
1407 ### Structure of table `0_stock_moves` ###
1408
1409 DROP TABLE IF EXISTS `0_stock_moves`;
1410
1411 CREATE TABLE `0_stock_moves` (
1412   `trans_id` int(11) NOT NULL auto_increment,
1413   `trans_no` int(11) NOT NULL default '0',
1414   `stock_id` char(20) NOT NULL default '',
1415   `type` smallint(6) NOT NULL default '0',
1416   `loc_code` char(5) NOT NULL default '',
1417   `tran_date` date NOT NULL default '0000-00-00',
1418   `person_id` int(11) default NULL,
1419   `price` double NOT NULL default '0',
1420   `reference` char(40) NOT NULL default '',
1421   `qty` double NOT NULL default '1',
1422   `discount_percent` double NOT NULL default '0',
1423   `standard_cost` double NOT NULL default '0',
1424   `visible` tinyint(1) NOT NULL default '1',
1425   PRIMARY KEY  (`trans_id`),
1426   KEY `type` (`type`,`trans_no`),
1427   KEY `Move` (`stock_id`,`loc_code`, `tran_date`)
1428 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1429
1430
1431 ### Data of table `0_stock_moves` ###
1432
1433
1434
1435 ### Structure of table `0_supp_allocations` ###
1436
1437 DROP TABLE IF EXISTS `0_supp_allocations`;
1438
1439 CREATE TABLE `0_supp_allocations` (
1440   `id` int(11) NOT NULL auto_increment,
1441   `amt` double unsigned default NULL,
1442   `date_alloc` date NOT NULL default '0000-00-00',
1443   `trans_no_from` int(11) default NULL,
1444   `trans_type_from` int(11) default NULL,
1445   `trans_no_to` int(11) default NULL,
1446   `trans_type_to` int(11) default NULL,
1447   PRIMARY KEY  (`id`),
1448   KEY `From` (`trans_type_from`, `trans_no_from`),
1449   KEY `To` (`trans_type_to`, `trans_no_to`)
1450 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1451
1452
1453 ### Data of table `0_supp_allocations` ###
1454
1455
1456
1457 ### Structure of table `0_supp_invoice_items` ###
1458
1459 DROP TABLE IF EXISTS `0_supp_invoice_items`;
1460
1461 CREATE TABLE `0_supp_invoice_items` (
1462   `id` int(11) NOT NULL auto_increment,
1463   `supp_trans_no` int(11) default NULL,
1464   `supp_trans_type` int(11) default NULL,
1465   `gl_code` varchar(15) NOT NULL default '0',
1466   `grn_item_id` int(11) default NULL,
1467   `po_detail_item_id` int(11) default NULL,
1468   `stock_id` varchar(20) NOT NULL default '',
1469   `description` tinytext,
1470   `quantity` double NOT NULL default '0',
1471   `unit_price` double NOT NULL default '0',
1472   `unit_tax` double NOT NULL default '0',
1473   `memo_` tinytext,
1474   PRIMARY KEY  (`id`),
1475   KEY `Transaction` (`supp_trans_type`, `supp_trans_no`, `stock_id`)
1476 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1477
1478
1479 ### Data of table `0_supp_invoice_items` ###
1480
1481
1482
1483 ### Structure of table `0_supp_trans` ###
1484
1485 DROP TABLE IF EXISTS `0_supp_trans`;
1486
1487 CREATE TABLE `0_supp_trans` (
1488   `trans_no` int(11) unsigned NOT NULL default '0',
1489   `type` smallint(6) unsigned NOT NULL default '0',
1490   `supplier_id` int(11) unsigned default NULL,
1491   `reference` tinytext NOT NULL,
1492   `supp_reference` varchar(60) NOT NULL default '',
1493   `tran_date` date NOT NULL default '0000-00-00',
1494   `due_date` date NOT NULL default '0000-00-00',
1495   `ov_amount` double NOT NULL default '0',
1496   `ov_discount` double NOT NULL default '0',
1497   `ov_gst` double NOT NULL default '0',
1498   `rate` double NOT NULL default '1',
1499   `alloc` double NOT NULL default '0',
1500   PRIMARY KEY  (`type`, `trans_no`),
1501   KEY `supplier_id` (`supplier_id`),
1502   KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
1503   KEY `type` (`type`),
1504   KEY (`tran_date`)
1505 ) TYPE=InnoDB  ;
1506
1507
1508 ### Data of table `0_supp_trans` ###
1509
1510
1511
1512 ### Structure of table `0_suppliers` ###
1513
1514 DROP TABLE IF EXISTS `0_suppliers`;
1515
1516 CREATE TABLE `0_suppliers` (
1517   `supplier_id` int(11) NOT NULL auto_increment,
1518   `supp_name` varchar(60) NOT NULL default '',
1519   `supp_ref` varchar(30) NOT NULL default '',
1520   `address` tinytext NOT NULL,
1521   `supp_address` tinytext NOT NULL,
1522   `phone` varchar(30) NOT NULL default '',
1523   `phone2` varchar(30) NOT NULL default '',
1524   `fax` varchar(30) NOT NULL default '',
1525   `gst_no` varchar(25) NOT NULL default '',
1526   `contact` varchar(60) NOT NULL default '',
1527   `supp_account_no` varchar(40) NOT NULL default '',
1528   `email` varchar(100) NOT NULL default '',
1529   `website` varchar(100) NOT NULL default '',
1530   `bank_account` varchar(60) NOT NULL default '',
1531   `curr_code` char(3) default NULL,
1532   `rep_lang` char(5) default NULL,
1533   `payment_terms` int(11) default NULL,
1534   `dimension_id` int(11) default '0',
1535   `dimension2_id` int(11) default '0',
1536   `tax_group_id` int(11) default NULL,
1537   `credit_limit` double NOT NULL default '0',
1538   `purchase_account` varchar(15) default NULL,
1539   `payable_account` varchar(15) default NULL,
1540   `payment_discount_account` varchar(15) default NULL,
1541   `notes` tinytext NOT NULL,
1542   `inactive` tinyint(1) NOT NULL default '0',
1543   PRIMARY KEY  (`supplier_id`),
1544   KEY (`supp_ref`)
1545 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
1546
1547
1548 ### Data of table `0_suppliers` ###
1549
1550
1551 ### Structure of table `0_sys_prefs` ###
1552
1553 DROP TABLE IF EXISTS `0_sys_prefs`;
1554
1555 CREATE TABLE `0_sys_prefs` (
1556   `name` varchar(35) NOT NULL default '',
1557   `category` varchar(30) default NULL,
1558   `type` varchar(20) NOT NULL default 'varchar',
1559   `length` smallint(6) default NULL,
1560   `value` tinytext,
1561   PRIMARY KEY  (`name`),
1562   KEY `category` (`category`)
1563 ) TYPE=MyISAM;
1564
1565
1566 ### Data of table `0_sys_prefs` ###
1567
1568 INSERT INTO `0_sys_prefs` VALUES ('coy_name', 'setup.company', 'varchar', '60', 'Company name');
1569 INSERT INTO `0_sys_prefs` VALUES ('gst_no', 'setup.company', 'varchar', '25', NULL);
1570 INSERT INTO `0_sys_prefs` VALUES ('coy_no', 'setup.company', 'varchar', '25', NULL);
1571 INSERT INTO `0_sys_prefs` VALUES ('tax_prd', 'setup.company', 'int', '11', '1');
1572 INSERT INTO `0_sys_prefs` VALUES ('tax_last', 'setup.company', 'int', '11', '1');
1573 INSERT INTO `0_sys_prefs` VALUES ('postal_address', 'setup.company', 'tinytext', '0', 'N/A');
1574 INSERT INTO `0_sys_prefs` VALUES ('phone', 'setup.company', 'varchar', '30', NULL);
1575 INSERT INTO `0_sys_prefs` VALUES ('fax', 'setup.company', 'varchar', '30', NULL);
1576 INSERT INTO `0_sys_prefs` VALUES ('email', 'setup.company', 'varchar', '100', NULL);
1577 INSERT INTO `0_sys_prefs` VALUES ('coy_logo', 'setup.company', 'varchar', '100', NULL);
1578 INSERT INTO `0_sys_prefs` VALUES ('domicile', 'setup.company', 'varchar', '55', NULL);
1579 INSERT INTO `0_sys_prefs` VALUES ('curr_default', 'setup.company', 'char', '3', 'USD');
1580 INSERT INTO `0_sys_prefs` VALUES ('use_dimension', 'setup.company', 'tinyint', '1', '1');
1581 INSERT INTO `0_sys_prefs` VALUES ('f_year', 'setup.company', 'int', '11', '1');
1582 INSERT INTO `0_sys_prefs` VALUES ('no_item_list', 'setup.company', 'tinyint', '1', '0');
1583 INSERT INTO `0_sys_prefs` VALUES ('no_customer_list', 'setup.company', 'tinyint', '1', '0');
1584 INSERT INTO `0_sys_prefs` VALUES ('no_supplier_list', 'setup.company', 'tinyint', '1', '0');
1585 INSERT INTO `0_sys_prefs` VALUES ('base_sales', 'setup.company', 'int', '11', '1');
1586 INSERT INTO `0_sys_prefs` VALUES ('time_zone', 'setup.company', 'tinyint', '1', '0');
1587 INSERT INTO `0_sys_prefs` VALUES ('add_pct', 'setup.company', 'int', '5', '-1');
1588 INSERT INTO `0_sys_prefs` VALUES ('round_to', 'setup.company', 'int', '5', '1');
1589 INSERT INTO `0_sys_prefs` VALUES ('login_tout', 'setup.company', 'smallint', '6', '600');
1590 INSERT INTO `0_sys_prefs` VALUES ('past_due_days', 'glsetup.general', 'int', '11', '30');
1591 INSERT INTO `0_sys_prefs` VALUES ('profit_loss_year_act', 'glsetup.general', 'varchar', '15', '9990');
1592 INSERT INTO `0_sys_prefs` VALUES ('retained_earnings_act', 'glsetup.general', 'varchar', '15', '3590');
1593 INSERT INTO `0_sys_prefs` VALUES ('bank_charge_act', 'glsetup.general', 'varchar', '15', '5690');
1594 INSERT INTO `0_sys_prefs` VALUES ('exchange_diff_act', 'glsetup.general', 'varchar', '15', '4450');
1595 INSERT INTO `0_sys_prefs` VALUES ('default_credit_limit', 'glsetup.customer', 'int', '11', '1000');
1596 INSERT INTO `0_sys_prefs` VALUES ('accumulate_shipping', 'glsetup.customer', 'tinyint', '1', '0');
1597 INSERT INTO `0_sys_prefs` VALUES ('legal_text', 'glsetup.customer', 'tinytext', '0', NULL);
1598 INSERT INTO `0_sys_prefs` VALUES ('freight_act', 'glsetup.customer', 'varchar', '15', '4430');
1599 INSERT INTO `0_sys_prefs` VALUES ('debtors_act', 'glsetup.sales', 'varchar', '15', '1200');
1600 INSERT INTO `0_sys_prefs` VALUES ('default_sales_act', 'glsetup.sales', 'varchar', '15', '4010');
1601 INSERT INTO `0_sys_prefs` VALUES ('default_sales_discount_act', 'glsetup.sales', 'varchar', '15', '4510');
1602 INSERT INTO `0_sys_prefs` VALUES ('default_prompt_payment_act', 'glsetup.sales', 'varchar', '15', '4500');
1603 INSERT INTO `0_sys_prefs` VALUES ('default_delivery_required', 'glsetup.sales', 'smallint', '6', '1');
1604 INSERT INTO `0_sys_prefs` VALUES ('default_dim_required', 'glsetup.dims', 'int', '11', '20');
1605 INSERT INTO `0_sys_prefs` VALUES ('pyt_discount_act', 'glsetup.purchase', 'varchar', '15', '5060');
1606 INSERT INTO `0_sys_prefs` VALUES ('creditors_act', 'glsetup.purchase', 'varchar', '15', '2100');
1607 INSERT INTO `0_sys_prefs` VALUES ('po_over_receive', 'glsetup.purchase', 'int', '11', '10');
1608 INSERT INTO `0_sys_prefs` VALUES ('po_over_charge', 'glsetup.purchase', 'int', '11', '10');
1609 INSERT INTO `0_sys_prefs` VALUES ('allow_negative_stock', 'glsetup.inventory', 'tinyint', '1', '0');
1610 INSERT INTO `0_sys_prefs` VALUES ('default_inventory_act', 'glsetup.items', 'varchar', '15', '1510');
1611 INSERT INTO `0_sys_prefs` VALUES ('default_cogs_act', 'glsetup.items', 'varchar', '15', '5010');
1612 INSERT INTO `0_sys_prefs` VALUES ('default_adj_act', 'glsetup.items', 'varchar', '15', '5040');
1613 INSERT INTO `0_sys_prefs` VALUES ('default_inv_sales_act', 'glsetup.items', 'varchar', '15', '4010');
1614 INSERT INTO `0_sys_prefs` VALUES ('default_assembly_act', 'glsetup.items', 'varchar', '15', '1530');
1615 INSERT INTO `0_sys_prefs` VALUES ('default_workorder_required', 'glsetup.manuf', 'int', '11', '20');
1616 INSERT INTO `0_sys_prefs` VALUES ('version_id', 'system', 'varchar', '11', '2.3');
1617
1618
1619 ### Structure of table `0_sys_types` ###
1620
1621 DROP TABLE IF EXISTS `0_sys_types`;
1622
1623 CREATE TABLE `0_sys_types` (
1624   `type_id` smallint(6) NOT NULL default '0',
1625   `type_no` int(11) NOT NULL default '1',
1626   `next_reference` varchar(100) NOT NULL default '',
1627   PRIMARY KEY  (`type_id`)
1628 ) TYPE=InnoDB  ;
1629
1630
1631 ### Data of table `0_sys_types` ###
1632
1633 INSERT INTO `0_sys_types` VALUES ('0', '17', '1');
1634 INSERT INTO `0_sys_types` VALUES ('1', '7', '1');
1635 INSERT INTO `0_sys_types` VALUES ('2', '4', '1');
1636 INSERT INTO `0_sys_types` VALUES ('4', '3', '1');
1637 INSERT INTO `0_sys_types` VALUES ('10', '16', '1');
1638 INSERT INTO `0_sys_types` VALUES ('11', '2', '1');
1639 INSERT INTO `0_sys_types` VALUES ('12', '6', '1');
1640 INSERT INTO `0_sys_types` VALUES ('13', '1', '1');
1641 INSERT INTO `0_sys_types` VALUES ('16', '2', '1');
1642 INSERT INTO `0_sys_types` VALUES ('17', '2', '1');
1643 INSERT INTO `0_sys_types` VALUES ('18', '1', '1');
1644 INSERT INTO `0_sys_types` VALUES ('20', '6', '1');
1645 INSERT INTO `0_sys_types` VALUES ('21', '1', '1');
1646 INSERT INTO `0_sys_types` VALUES ('22', '3', '1');
1647 INSERT INTO `0_sys_types` VALUES ('25', '1', '1');
1648 INSERT INTO `0_sys_types` VALUES ('26', '1', '1');
1649 INSERT INTO `0_sys_types` VALUES ('28', '1', '1');
1650 INSERT INTO `0_sys_types` VALUES ('29', '1', '1');
1651 INSERT INTO `0_sys_types` VALUES ('30', '0', '1');
1652 INSERT INTO `0_sys_types` VALUES ('32', '0', '1');
1653 INSERT INTO `0_sys_types` VALUES ('35', '1', '1');
1654 INSERT INTO `0_sys_types` VALUES ('40', '1', '1');
1655
1656
1657 ### Structure of table `0_tax_group_items` ###
1658
1659 DROP TABLE IF EXISTS `0_tax_group_items`;
1660
1661 CREATE TABLE `0_tax_group_items` (
1662   `tax_group_id` int(11) NOT NULL default '0',
1663   `tax_type_id` int(11) NOT NULL default '0',
1664   `rate` double NOT NULL default '0',
1665   PRIMARY KEY  (`tax_group_id`,`tax_type_id`)
1666 ) TYPE=InnoDB  ;
1667
1668
1669 ### Data of table `0_tax_group_items` ###
1670
1671 INSERT INTO `0_tax_group_items` VALUES ('1', '1', '5');
1672
1673
1674 ### Structure of table `0_tax_groups` ###
1675
1676 DROP TABLE IF EXISTS `0_tax_groups`;
1677
1678 CREATE TABLE `0_tax_groups` (
1679   `id` int(11) NOT NULL auto_increment,
1680   `name` varchar(60) NOT NULL default '',
1681   `tax_shipping` tinyint(1) NOT NULL default '0',
1682   `inactive` tinyint(1) NOT NULL default '0',
1683   PRIMARY KEY  (`id`),
1684   UNIQUE KEY `name` (`name`)
1685 ) TYPE=InnoDB AUTO_INCREMENT=3 ;
1686
1687
1688 ### Data of table `0_tax_groups` ###
1689
1690 INSERT INTO `0_tax_groups` VALUES ('1', 'Tax', '0', '0');
1691 INSERT INTO `0_tax_groups` VALUES ('2', 'Tax Exempt', '0', '0');
1692
1693
1694 ### Structure of table `0_tax_types` ###
1695
1696 DROP TABLE IF EXISTS `0_tax_types`;
1697
1698 CREATE TABLE `0_tax_types` (
1699   `id` int(11) NOT NULL auto_increment,
1700   `rate` double NOT NULL default '0',
1701   `sales_gl_code` varchar(15) NOT NULL default '',
1702   `purchasing_gl_code` varchar(15) NOT NULL default '',
1703   `name` varchar(60) NOT NULL default '',
1704   `inactive` tinyint(1) NOT NULL default '0',
1705   PRIMARY KEY  (`id`)
1706 ) TYPE=InnoDB AUTO_INCREMENT=2 ;
1707
1708
1709 ### Data of table `0_tax_types` ###
1710
1711 INSERT INTO `0_tax_types` VALUES ('1', '5', '2150', '2145', 'Tax', '0');
1712
1713
1714 ### Structure of table `0_trans_tax_details` ###
1715
1716 DROP TABLE IF EXISTS `0_trans_tax_details`;
1717
1718 CREATE TABLE `0_trans_tax_details` (
1719   `id` int(11) NOT NULL auto_increment,
1720   `trans_type` smallint(6) default NULL,
1721   `trans_no` int(11) default NULL,
1722   `tran_date` date NOT NULL,
1723   `tax_type_id` int(11) NOT NULL default '0',
1724   `rate` double NOT NULL default '0',
1725   `ex_rate` double NOT NULL default '1',
1726   `included_in_price` tinyint(1) NOT NULL default '0',
1727   `net_amount` double NOT NULL default '0',
1728   `amount` double NOT NULL default '0',
1729   `memo` tinytext,
1730   PRIMARY KEY  (`id`),
1731   KEY `Type_and_Number` (`trans_type`,`trans_no`),
1732   KEY (`tran_date`)
1733 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
1734
1735
1736 ### Data of table `0_trans_tax_details` ###
1737
1738
1739
1740 ### Structure of table `0_users` ###
1741
1742 DROP TABLE IF EXISTS `0_users`;
1743
1744 CREATE TABLE `0_users` (
1745   `id` SMALLINT(6) AUTO_INCREMENT,
1746   `user_id` varchar(60) NOT NULL default '',
1747   `password` varchar(100) NOT NULL default '',
1748   `real_name` varchar(100) NOT NULL default '',
1749   `role_id` int(11) NOT NULL default '1',
1750   `phone` varchar(30) NOT NULL default '',
1751   `email` varchar(100) default NULL,
1752   `language` varchar(20) default NULL,
1753   `date_format` tinyint(1) NOT NULL default '0',
1754   `date_sep` tinyint(1) NOT NULL default '0',
1755   `tho_sep` tinyint(1) NOT NULL default '0',
1756   `dec_sep` tinyint(1) NOT NULL default '0',
1757   `theme` varchar(20) NOT NULL default 'default',
1758   `page_size` varchar(20) NOT NULL default 'A4',
1759   `prices_dec` smallint(6) NOT NULL default '2',
1760   `qty_dec` smallint(6) NOT NULL default '2',
1761   `rates_dec` smallint(6) NOT NULL default '4',
1762   `percent_dec` smallint(6) NOT NULL default '1',
1763   `show_gl` tinyint(1) NOT NULL default '1',
1764   `show_codes` tinyint(1) NOT NULL default '0',
1765   `show_hints` tinyint(1) NOT NULL default '0',
1766   `last_visit_date` datetime default NULL,
1767   `query_size` tinyint(1) default '10',
1768   `graphic_links` tinyint(1) default '1',
1769   `pos` smallint(6) default '1',
1770   `print_profile` varchar(30) NOT NULL default '1',
1771   `rep_popup` tinyint(1) default '1',
1772   `sticky_doc_date` tinyint(1) default '0',
1773   `startup_tab` varchar(20) NOT NULL default '',
1774   `inactive` tinyint(1) NOT NULL default '0',
1775   PRIMARY KEY  (`id`),
1776   UNIQUE KEY  (`user_id`)
1777 ) TYPE=MyISAM  AUTO_INCREMENT=2;
1778
1779
1780 ### Data of table `0_users` ###
1781
1782 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', 'orders', '0');
1783
1784 ### Structure of table `0_voided` ###
1785
1786 DROP TABLE IF EXISTS `0_voided`;
1787
1788 CREATE TABLE `0_voided` (
1789   `type` int(11) NOT NULL default '0',
1790   `id` int(11) NOT NULL default '0',
1791   `date_` date NOT NULL default '0000-00-00',
1792   `memo_` tinytext NOT NULL,
1793   UNIQUE KEY `id` (`type`,`id`)
1794 ) TYPE=InnoDB  ;
1795
1796
1797 ### Data of table `0_voided` ###
1798
1799
1800
1801 ### Structure of table `0_wo_issue_items` ###
1802
1803 DROP TABLE IF EXISTS `0_wo_issue_items`;
1804
1805 CREATE TABLE `0_wo_issue_items` (
1806   `id` int(11) NOT NULL auto_increment,
1807   `stock_id` varchar(40) default NULL,
1808   `issue_id` int(11) default NULL,
1809   `qty_issued` double default NULL,
1810   PRIMARY KEY  (`id`)
1811 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1812
1813
1814 ### Data of table `0_wo_issue_items` ###
1815
1816
1817
1818 ### Structure of table `0_wo_issues` ###
1819
1820 DROP TABLE IF EXISTS `0_wo_issues`;
1821
1822 CREATE TABLE `0_wo_issues` (
1823   `issue_no` int(11) NOT NULL auto_increment,
1824   `workorder_id` int(11) NOT NULL default '0',
1825   `reference` varchar(100) default NULL,
1826   `issue_date` date default NULL,
1827   `loc_code` varchar(5) default NULL,
1828   `workcentre_id` int(11) default NULL,
1829   PRIMARY KEY  (`issue_no`),
1830   KEY (`workorder_id`)
1831 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1832
1833
1834 ### Data of table `0_wo_issues` ###
1835
1836
1837
1838 ### Structure of table `0_wo_manufacture` ###
1839
1840 DROP TABLE IF EXISTS `0_wo_manufacture`;
1841
1842 CREATE TABLE `0_wo_manufacture` (
1843   `id` int(11) NOT NULL auto_increment,
1844   `reference` varchar(100) default NULL,
1845   `workorder_id` int(11) NOT NULL default '0',
1846   `quantity` double NOT NULL default '0',
1847   `date_` date NOT NULL default '0000-00-00',
1848   PRIMARY KEY  (`id`),
1849   KEY (`workorder_id`)
1850 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1851
1852
1853 ### Data of table `0_wo_manufacture` ###
1854
1855
1856
1857 ### Structure of table `0_wo_requirements` ###
1858
1859 DROP TABLE IF EXISTS `0_wo_requirements`;
1860
1861 CREATE TABLE `0_wo_requirements` (
1862   `id` int(11) NOT NULL auto_increment,
1863   `workorder_id` int(11) NOT NULL default '0',
1864   `stock_id` char(20) NOT NULL default '',
1865   `workcentre` int(11) NOT NULL default '0',
1866   `units_req` double NOT NULL default '1',
1867   `std_cost` double NOT NULL default '0',
1868   `loc_code` char(5) NOT NULL default '',
1869   `units_issued` double NOT NULL default '0',
1870   PRIMARY KEY  (`id`),
1871   KEY (`workorder_id`)
1872 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1873
1874
1875 ### Data of table `0_wo_requirements` ###
1876
1877
1878
1879 ### Structure of table `0_workcentres` ###
1880
1881 DROP TABLE IF EXISTS `0_workcentres`;
1882
1883 CREATE TABLE `0_workcentres` (
1884   `id` int(11) NOT NULL auto_increment,
1885   `name` char(40) NOT NULL default '',
1886   `description` char(50) NOT NULL default '',
1887   `inactive` tinyint(1) NOT NULL default '0',
1888   PRIMARY KEY  (`id`),
1889   UNIQUE KEY `name` (`name`)
1890 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
1891
1892
1893 ### Data of table `0_workcentres` ###
1894
1895
1896
1897 ### Structure of table `0_workorders` ###
1898
1899 DROP TABLE IF EXISTS `0_workorders`;
1900
1901 CREATE TABLE `0_workorders` (
1902   `id` int(11) NOT NULL auto_increment,
1903   `wo_ref` varchar(60) NOT NULL default '',
1904   `loc_code` varchar(5) NOT NULL default '',
1905   `units_reqd` double NOT NULL default '1',
1906   `stock_id` varchar(20) NOT NULL default '',
1907   `date_` date NOT NULL default '0000-00-00',
1908   `type` tinyint(4) NOT NULL default '0',
1909   `required_by` date NOT NULL default '0000-00-00',
1910   `released_date` date NOT NULL default '0000-00-00',
1911   `units_issued` double NOT NULL default '0',
1912   `closed` tinyint(1) NOT NULL default '0',
1913   `released` tinyint(1) NOT NULL default '0',
1914   `additional_costs` double NOT NULL default '0',
1915   PRIMARY KEY  (`id`),
1916   UNIQUE KEY `wo_ref` (`wo_ref`)
1917 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
1918
1919
1920 ### Data of table `0_workorders` ###
1921
1922
1923
1924 ### Structure of table `0_tags` ###
1925
1926 DROP TABLE IF EXISTS `0_tags`;
1927
1928 CREATE TABLE `0_tags` (
1929   `id` int(11) NOT NULL auto_increment,
1930   `type` smallint(6) NOT NULL,
1931   `name` varchar(30) NOT NULL,
1932   `description` varchar(60) default NULL,
1933   `inactive` tinyint(1) NOT NULL default '0',
1934   PRIMARY KEY  (`id`),
1935   UNIQUE KEY(`type`,`name`)
1936 ) TYPE=MyISAM AUTO_INCREMENT=1;
1937
1938
1939 ### Data of table `0_chart_tags` ###
1940
1941
1942
1943 ### Structure of table `0_tag_associations` ###
1944
1945 DROP TABLE IF EXISTS `0_tag_associations`;
1946
1947 CREATE TABLE `0_tag_associations` (
1948   `record_id` varchar(15) NOT NULL,
1949   `tag_id` int(11) NOT NULL,
1950   UNIQUE KEY(`record_id`,`tag_id`)
1951 ) TYPE=MyISAM;
1952
1953
1954 ### Data of table `0_tag_associations` ###
1955
1956 DROP TABLE IF EXISTS `0_useronline` ;
1957
1958 CREATE TABLE `0_useronline` (
1959         `id` int(11) NOT NULL AUTO_INCREMENT ,
1960         `timestamp` int(15) NOT NULL default '0',
1961         `ip` varchar(40) NOT NULL default '',
1962         `file` varchar(100) NOT NULL default '',
1963         PRIMARY KEY `id` (`id`) ,
1964         KEY (`timestamp`),
1965         KEY(`ip`)
1966 ) TYPE=MYISAM AUTO_INCREMENT=1;
1967