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