Fixed error log warning (missing installed_extensions.inc) during upgrade to 2.2.
[fa-stable.git] / admin / db / company_db.inc
index 1bb58326d8bacbdefedb7afb4ff14af08bc25b2d..621e986571a85afc31a3ccfcc60c8f735f598f2e 100644 (file)
@@ -66,7 +66,7 @@ function update_company_gl_setup($retained_act, $profit_loss_act, $debtors_act,
 function update_company_setup($coy_name, $coy_no, $gst_no, $tax_prd, $tax_last, 
        $postal_address, $phone, $fax, $email, $coy_logo, $domicile, $Dimension, 
        $curr_default, $f_year, $no_item_list, $no_customer_list, $no_supplier_list, 
-       $base_sales, $time_zone)
+       $base_sales, $time_zone, $add_pct, $round_to, $login_tout)
 {
        if ($f_year == null)
                $f_year = 0;
@@ -87,7 +87,10 @@ function update_company_setup($coy_name, $coy_no, $gst_no, $tax_prd, $tax_last,
                curr_default=".db_escape($curr_default).",
                f_year=$f_year,
                base_sales=$base_sales,
-               time_zone=$time_zone
+               time_zone=$time_zone,
+               add_pct=$add_pct,
+               round_to=$round_to,
+               login_tout = ".db_escape($login_tout)."
                WHERE coy_code=1";
 
        db_query($sql, "The company setup could not be updated ");
@@ -118,14 +121,14 @@ function add_fiscalyear($from_date, $to_date, $closed)
        $to = date2sql($to_date);
 
        $sql = "INSERT INTO ".TB_PREF."fiscal_year (begin, end, closed)
-               VALUES (".db_escape($from).",".db_escape($to).", $closed)";
+               VALUES (".db_escape($from).",".db_escape($to).", ".db_escape($closed).")";
 
        db_query($sql, "could not add fiscal year");
 }
 
 function update_fiscalyear($id, $closed)
 {
-       $sql = "UPDATE ".TB_PREF."fiscal_year SET closed=$closed
+       $sql = "UPDATE ".TB_PREF."fiscal_year SET closed=".db_escape($closed)."
                WHERE id=".db_escape($id);
 
        db_query($sql, "could not update fiscal year");
@@ -151,7 +154,7 @@ function get_current_fiscalyear()
 {
        $year = get_company_pref('f_year');
 
-       $sql = "SELECT * FROM ".TB_PREF."fiscal_year WHERE id=$year";
+       $sql = "SELECT * FROM ".TB_PREF."fiscal_year WHERE id=".db_escape($year);
 
        $result = db_query($sql, "could not get current fiscal year");
 
@@ -178,5 +181,16 @@ function get_base_sales_type()
        return $myrow[0];
 }
 
+function get_company_extensions($id = -1) {
+       global $path_to_root;
+
+       $file = $path_to_root.($id == -1 ? '' : '/company/'.$id).'/installed_extensions.php';
+       $installed_extensions = array();
+       if (is_file($file)) {
+               include($file);
+       }
+       return $installed_extensions;
+}
+
 
 ?>
\ No newline at end of file