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