X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Fincludes%2Fexcel_report.inc;h=fb7ed1be71b04b370e26c1d26eefa4e53c96a073;hb=7202616e85a0fb8907ced404e418d8a16a5ed53a;hp=931abc93fc58a72896228d0903aceff0559865aa;hpb=18ccf94f0421e7693bc40e177732a3f937b54d1a;p=fa-stable.git diff --git a/reporting/includes/excel_report.inc b/reporting/includes/excel_report.inc index 931abc93..fb7ed1be 100644 --- a/reporting/includes/excel_report.inc +++ b/reporting/includes/excel_report.inc @@ -9,8 +9,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ -/* $Revision$ */ -$page_security = 8; include_once($path_to_root . "/reporting/includes/Workbook.php"); include_once($path_to_root . "/admin/db/company_db.inc"); include_once($path_to_root . "/config.php"); @@ -57,8 +55,13 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook function FrontReport($title, $filename, $size = 'A4', $fontsize = 9) { - global $comp_path, $dateseps; - + global $comp_path, $dateseps, $page_security; + if (!$_SESSION["wa_current_user"]->can_access_page($page_security)) + { + display_error(_("The security settings on your account do not permit you to print this report")); + end_page(); + exit; + } $this->size = $size; $this->title = $title; $this->lineHeight = 12; @@ -142,10 +145,12 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook { if (!isset($this->formatAmount[$dec])) { - global $thoseps,$decseps; + //global $thoseps,$decseps; $dec = (int)$dec; - $tsep = $thoseps[user_tho_sep()]; - $dsep = $decseps[user_dec_sep()]; + //$tsep = $thoseps[user_tho_sep()]; + //$dsep = $decseps[user_dec_sep()]; + $tsep = ','; + $dsep = '.'; $format = "###{$tsep}###{$tsep}###{$tsep}##0"; if ($dec>0) $format .= "{$dsep}".str_repeat('0',$dec); @@ -165,10 +170,6 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook { global $app_title, $version, $power_by, $power_url; $this->company = get_company_prefs(); - //$this->docTitle($this->title); - //$this->docAuthor($app_title . ' ' . $version); - //$this->docCompany($this->company['coy_name']); - //$this->docManager($power_by . ' - ' . $power_url); $year = get_current_fiscalyear(); if ($year['closed'] == 0) $how = _("Active"); @@ -325,9 +326,7 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook $txt = date2sql($txt); list($year, $mo, $day) = explode("-", $txt); $date = $this->ymd2date((int)$year, (int)$mo, (int)$day); - //$date = $this->ymd2date(2009, 3, 2); $this->sheet->writeNumber($this->y, $c, $date, $this->formatDate); - //$this->sheet->write_string($this->y, $c, $txt); } function TextCol2($c, $n, $txt, $corr=0, $r=0) @@ -399,16 +398,6 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook { $excel_column_width_factor = 256; $unit_offset_length = 6.5; - /* - $unit_offset_map = array(0, 36, 73, 109, 146, 182, 219); - $width_units = $excel_column_width_factor * ($px / $unit_offset_length); - $width_units += $unit_offset_map[($px % $unit_offset_length)]; - return $width_units; - $pixels = (float)((float)$px / (float)$excel_column_width_factor) * $unit_offset_length; - $ofs = $px % $excel_column_width_factor; - $pixels += round((float)$ofs / ((float) $excel_column_width_factor / $unit_offset_length)); - return (int)$pixels; - */ return ($px / $unit_offset_length); }