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