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