Fixed a couple of problems in installation procedures.
[fa-stable.git] / includes / prefs / sysprefs.inc
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU General Public License, GPL, 
5         as published by the Free Software Foundation, either version 3 
6         of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 include_once($path_to_root . "/admin/db/company_db.inc");
13
14 class sys_prefs 
15 {
16         var $prefs;
17         var $db_ok; // check whether database has been upgraded after src update.
18
19         function sys_prefs()
20         {
21                 global $path_to_root;
22
23                 include $path_to_root.'/config.default.php';
24                 if (file_exists($path_to_root.'/config.php'))
25                         include $path_to_root.'/config.php';
26
27                 // set system wide preferences
28                 foreach(get_defined_vars() as $name => $value)
29                         $this->$name = $value;
30
31                 if (!@$this->time_zone)
32                         $this->time_zone = ini_get('date.timezone');
33
34                 if (!$this->time_zone)
35                         $this->time_zone = 'Europe/Berlin';
36
37             ini_set('date.timezone', $this->time_zone);
38         }
39
40         function allow_negative_stock() 
41         {
42                 return $this->prefs['allow_negative_stock'];
43         }
44
45     /* Sherifoz 26.06.03 Proportion by which items can be received over the quantity that is specified in a purchase
46     invoice
47     The figure entered is interpreted as a percentage ie 10 means 0.1 or 10% not 10 times
48     */
49         function over_receive_allowance() 
50         {
51                 return $this->prefs['po_over_receive'];
52         }
53         
54     /* Proportion by which a purchase invoice line is an overcharge for a purchase order item received
55     is an overcharge. If the overcharge is more than this percentage then an error is reported and
56     purchase invoice line cannot be entered
57     The figure entered is interpreted as a percentage ie 20 means 0.2 or 20% not 20 times
58     */  
59         function over_charge_allowance() 
60         {
61                 return $this->prefs['po_over_charge'];
62         }
63         
64         function default_credit_limit() 
65         {
66                 return $this->prefs['default_credit_limit'];
67         }                               
68         
69         function default_wo_required_by() 
70         {
71                 return $this->prefs['default_workorder_required'];
72         }
73
74         function default_quote_valid_days() 
75         {
76                 return $this->prefs['default_quote_valid_days'];
77         }
78
79         function default_delivery_required_by() 
80         {
81                 return $this->prefs['default_delivery_required'];
82         }
83
84         function default_receival_required_by() 
85         {
86                 return $this->prefs['default_receival_required'];
87         }
88
89         function default_dimension_required_by() 
90         {
91                 return $this->prefs['default_dim_required'];
92         }       
93         
94         function auto_currency_revaluation() 
95         {
96                 return $this->prefs['auto_curr_reval'];
97         }       
98         
99         function allocation_settled_allowance()
100         {
101                 return $this->config_allocation_settled_allowance;
102         }
103
104         function no_zero_lines_amount() 
105         {
106                 return $this->prefs['no_zero_lines_amount'];
107         }
108
109         function show_po_item_codes() 
110         {
111                 return $this->prefs['show_po_item_codes'];
112         }
113
114         function accounts_alpha() 
115         {
116                 return $this->prefs['accounts_alpha'];
117         }
118
119         function loc_notification() 
120         {
121                 return $this->prefs['loc_notification'];
122         }
123
124         function print_invoice_no() 
125         {
126                 return $this->prefs['print_invoice_no'];
127         }
128
129         function allow_negative_prices() 
130         {
131                 return $this->prefs['allow_negative_prices'];
132         }
133
134         function print_item_images_on_quote() 
135         {
136                 return $this->prefs['print_item_images_on_quote'];
137         }
138
139         function alternative_tax_include_on_docs() 
140         {
141                 return $this->prefs['alternative_tax_include_on_docs'];
142         }
143
144         function suppress_tax_rates() 
145         {
146                 return $this->prefs['suppress_tax_rates'];
147         }
148 }
149