company_path() helper used.
[fa-stable.git] / admin / db / fiscalyears_db.inc
index cbd4784ee9de60787cf55abce2cc6f65b24e9e6c..4dc32b6952de79e35ceb4e50a7f8d72336a16e44 100644 (file)
@@ -159,13 +159,12 @@ function open_year($year)
 //---------------------------------------------------------------------------------------------
 function delete_attachments_and_comments($type_no, $trans_no)
 {
-       global $comp_path;
        
        $sql = "SELECT * FROM ".TB_PREF."attachments WHERE type_no = $type_no AND trans_no = $trans_no";
        $result = db_query($sql, "Could not retrieve attachments");
        while ($row = db_fetch($result))
        {
-               $dir =  $comp_path."/".user_company(). "/attachments";
+               $dir =  company_path(). "/attachments";
                if (file_exists($dir."/".$row['unique_name']))
                        unlink($dir."/".$row['unique_name']);
                $sql = "DELETE FROM ".TB_PREF."attachments WHERE  type_no = $type_no AND trans_no = $trans_no";