Fixed Quote Valid Days in System and GL Setup, Setup tab.
[fa-stable.git] / includes / prefs / sysprefs.inc
index 3c5df2f0652abe348e4be53d9f1f1d6ff1142865..8f8d522b9553806588dd46cf737a8c8949b700e1 100644 (file)
@@ -1,13 +1,30 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
 include_once($path_to_root . "/admin/db/company_db.inc");
 
 class sys_prefs 
 {
+       var $prefs;
+       var $db_ok; // check whether database has been upgraded after src update.
+
+       function sys_prefs()
+       {
+//             $this->prefs = get_company_prefs();
+       
+       }
        
        function allow_negative_stock() 
        {
-               return get_company_pref('allow_negative_stock');
+               return $this->prefs['allow_negative_stock'];
        }
        
     /* Sherifoz 26.06.03 Proportion by which items can be received over the quantity that is specified in a purchase
@@ -16,7 +33,7 @@ class sys_prefs
     */
        function over_receive_allowance() 
        {
-               return get_company_pref('po_over_receive');
+               return $this->prefs['po_over_receive'];
        }
        
     /* Proportion by which a purchase invoice line is an overcharge for a purchase order item received
@@ -26,22 +43,37 @@ class sys_prefs
     */ 
        function over_charge_allowance() 
        {
-               return get_company_pref('po_over_charge');
+               return $this->prefs['po_over_charge'];
        }
        
        function default_credit_limit() 
        {
-               return get_company_pref('default_credit_limit');
+               return $this->prefs['default_credit_limit'];
        }                               
        
        function default_wo_required_by() 
        {
-               return get_company_pref('default_workorder_required');
+               return $this->prefs['default_workorder_required'];
+       }
+
+       function default_quote_valid_days() 
+       {
+               return $this->prefs['default_quote_valid_days'];
+       }
+
+       function default_delivery_required_by() 
+       {
+               return $this->prefs['default_delivery_required'];
        }
 
        function default_dimension_required_by() 
        {
-               return get_company_pref('default_dim_required');
+               return $this->prefs['default_dim_required'];
+       }       
+       
+       function auto_currency_revaluation() 
+       {
+               return $this->prefs['auto_curr_reval'];
        }       
        
        function allocation_settled_allowance()