20a08974b440d51621f4ddc960e516852544efa0
[fa-stable.git] / config.php
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     //--------------------------------------------------
13
14         // User configurable variables
15         //---------------------------------------------------
16
17         /*Show debug messages returned from an error on the page.
18         Debugging info level also determined by settings in PHP.ini
19         if $debug=1 show debugging info, dont show if $debug=0 */
20
21 if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_to_root']))
22         die("Restricted access");
23         // Log file for error/warning messages. Should be set to any location
24         // writable by www server. When set to empty string logging is switched off. 
25         // Special value 'syslog' can be used for system logger usage (see php manual).
26         $error_logfile = dirname(__FILE__).'/tmp/errors.log';
27         $debug                  = 1;
28         $show_sql               = 0;
29         $go_debug               = 0;
30         $pdf_debug              = 0;
31         // set $sql_trail to 1 only if you want to perform bugtracking sql trail
32         // Warning: this produces huge amount of data in sql_trail table.
33         // Don't forget switch the option off and flush the table manually after 
34         // trail, or your future backup files are overloaded with unneeded data.
35         //
36         $sql_trail              = 0; // save all sql queries in sql_trail
37         $select_trail   = 0; // track also SELECT queries
38         if ($go_debug == 1)
39         {
40                 error_reporting(E_ALL);
41                 ini_set("display_errors", "On");
42         }
43         else
44         {
45                 error_reporting(E_USER_WARNING|E_USER_ERROR|E_USER_NOTICE);
46                 // ini_alter("error_reporting","E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR|E_PARSE");
47                 ini_set("display_errors", "On");
48         }
49
50         if($error_logfile != '') {
51                 ini_set("error_log", $error_logfile);
52                 ini_set("ignore_repeated_errors", "On");
53                 ini_set("log_errors", "On");
54         }               
55         // Main Title
56         $app_title = "FrontAccounting";
57         // application version
58         $version                = "2.1.2";
59
60         // Build for development purposes
61         $build_version  = date("d.m.Y", filemtime("$path_to_root/CHANGELOG.txt"));
62
63         // Powered by
64         $power_by               = "FrontAccounting";
65         $power_url              = "http://frontaccounting.net";
66
67         /* use popup windows for views */
68         $use_popup_windows = 1;
69
70         /* use date picker for all date fields */
71         $use_date_picker = 1;
72
73         /* use Audit Trails in GL */
74         $use_audit_trail = 0;
75
76         /* use old style convert (income and expense in BS, PL) */
77         $use_oldstyle_convert = 0;
78
79         /* Integrated base Wiki Help URL or null if not used */
80         //$help_base_url = $path_to_root.'/modules/wiki/index.php?n='._('Help').'.';
81         $help_base_url = null;
82
83         /* per user data/cache directory */
84         $comp_path = $path_to_root.'/company';
85
86         /* allow alpha characters in accounts. 0 = numeric, 1 = alpha numeric, 2 = uppercase alpha numeric */
87         $accounts_alpha = 0;
88
89         /* Date systems. 0 = traditional, 1 = Jalali used by Iran, nabour countries, Afghanistan and some other Central Asian nations,
90         2 = Islamic used by other arabic nations */
91         $date_system = 0;
92
93         /* email stock location if order below reorder-level */
94         $loc_notification = 0;
95
96         /* print_invoice_no. 0 = print reference number, 1 = print invoice number */
97         $print_invoice_no = 0;
98
99         $dateformats    = array("MMDDYYYY", "DDMMYYYY", "YYYYMMDD");
100         $dateseps               = array("/", ".", "-", " ");
101         $thoseps                = array(",", ".", " ");
102         $decseps                = array(".", ",");
103
104         $pagesizes              = array("Letter", "A4"); // default PDF pagesize
105
106         /* Default border and spacing for tables */
107         /* Should be moved to CSS */
108
109         $table_style    = "cellpadding=3 border=1 bordercolor='#8cacbb' style='border-collapse: collapse'";
110         $table_style2   = "cellpadding=3 border=1 bordercolor='#cccccc' style='border-collapse: collapse'";
111
112         /* Accounts Payable */
113         /* System check to see if quantity charged on purchase invoices exceeds the quantity received.
114         If this parameter is checked the proportion by which the purchase invoice is an overcharge
115         referred to before reporting an error */
116
117         $check_qty_charged_vs_del_qty = true;
118
119         /* System check to see if price charged on purchase invoices exceeds the purchase order price.
120         If this parameter is checked the proportion by which the purchase invoice is an overcharge
121         referred to before reporting an error */
122
123         $check_price_charged_vs_order_price = True;
124
125         $config_allocation_settled_allowance = 0.005;
126
127         // Internal configurable variables
128         //-----------------------------------------------------------------------------------
129
130         /* Whether to display the demo login and password or not */
131
132         $allow_demo_mode = false;
133
134         /* for uploaded item pictures */
135         $pic_width              = 80;
136         $pic_height     = 50;
137         $max_image_size = 500;
138
139         /* skin for Business Graphics, 1, 2 or 3 */
140         $graph_skin     = 1;
141
142         /*Security Group definitions - Depending on the AccessLevel of the user defined in the user set up
143         the areas of functionality accessible can be modified.
144         Each AccessLevel is associated with an array containing the security categories that the user is entitled to access
145         Each script has a particular security category associated with it.
146         If the security setting of the page is contained in the security group as determined by the access level then the user will be allowed access.
147         Each page has a $page_security = x; variable
148         This value is compared to contents of the array applicable which is based on the access level of the user.
149         Access authorisation is checked in session.inc. If you wish to add more security groups
150         with then you must add a new SecurityHeading to the security_headings array
151         and a new array of Security categories to the Security Groups _at_the_end_ of the array
152         This mechanism allows more fine grained control of access
153         security_groups is an array of arrays
154         The index is the order in which the array of allowed pages is defined new ones can be defined at will
155         or by changing the numbers in each array the security access can be tailored. These numbers need to read
156         in conjunction with the Page Security index
157         Special case is security level 20 which is reserved for admins of first
158         registered company (site admins). All potentially dangerous for whole FA
159         site operations like installing addon modules require access level 20.
160         */
161
162         $security_headings = array(
163                         _("Inquiries"),
164                         _("Accountant"),
165                         _("System Administrator"),
166         );
167
168         $security_groups = array(
169                         array(1,2),
170                         array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,16),
171                         array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,20),
172         );
173
174         /* default start-up tab (orders/AP/stock/manuf/proj/GL/system) */
175         $def_app = "orders";
176
177         //MySQL Backup and Restore Settings
178
179 if(isset($_SESSION["wa_current_user"])) {
180         define("BACKUP_PATH", $comp_path.'/'.user_company()."/backup/");
181 }
182         // static js files path
183         $js_path = $path_to_root.'/js/';
184         // standard external js scripts included in all files
185         $js_static = array('JsHttpRequest.js', 'behaviour.js', 'utils.js', 'inserts.js');
186         // additional js source included in header
187         $js_lib = $js_userlib = array();
188
189 if (!defined('ICON_EDIT'))
190 {
191         define("ICON_EDIT", "edit.gif");        
192         define("ICON_DELETE", "delete.gif");    
193         define("ICON_ADD", "ok.gif");   
194         define("ICON_UPDATE", "ok.gif");        
195         define("ICON_OK", "ok.gif");    
196         define("ICON_CANCEL", "cancel.png");    
197         define("ICON_GL", "gl.png");    
198         define("ICON_PRINT", "print.png");      
199         define("ICON_PDF", "pdf.gif");  
200         define("ICON_DOC", "invoice.gif");      
201         define("ICON_CREDIT", "credit.gif");    
202         define("ICON_RECEIVE", "receive.gif");  
203         define("ICON_DOWN", "download.gif");    
204         define("ICON_MONEY", "money.png");      
205         define("ICON_REMOVE", "remove.png");    
206         define("ICON_REPORT", "report.png");    
207         define("ICON_VIEW", "view.gif");        
208 }
209 ?>