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