X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Fincludes%2Fpdf_report.inc;h=8c5d5727d42d1d6e11b41f327451c2369c39f1de;hb=c4eae7a18f0eb824e6eda7be2ba6fa820e9e58c9;hp=07d83546638daf144c956502eaedad4ad0ad6f72;hpb=b6af4ea4c99734cfd051395289107bbba5a405e9;p=fa-stable.git diff --git a/reporting/includes/pdf_report.inc b/reporting/includes/pdf_report.inc index 07d83546..8c5d5727 100644 --- a/reporting/includes/pdf_report.inc +++ b/reporting/includes/pdf_report.inc @@ -1,22 +1,22 @@ . + See the License here . ***********************************************************************/ /* $Revision$ */ $page_security = 8; //include_once($path_to_root . "reporting/includes/class.pdf.inc"); include_once(dirname(__FILE__)."/class.pdf.inc"); include_once(dirname(__FILE__)."/printer_class.inc"); -include_once($path_to_root . "admin/db/company_db.inc"); -include_once($path_to_root . "admin/db/printers_db.inc"); -include_once($path_to_root . "config.php"); +include_once($path_to_root . "/admin/db/company_db.inc"); +include_once($path_to_root . "/admin/db/printers_db.inc"); +include_once($path_to_root . "/config.php"); class FrontReport extends Cpdf { var $size; @@ -124,7 +124,7 @@ class FrontReport extends Cpdf } $this->size = array(0, 0, $this->pageWidth, $this->pageHeight); $this->title = $title; - $this->filename = $filename; + $this->filename = $filename.".pdf"; $this->pageNumber = 0; $this->endLine = $this->pageWidth - $this->rightMargin; $this->companyCol = $this->endLine - 150; @@ -150,7 +150,7 @@ class FrontReport extends Cpdf function Info($params, $cols, $headers, $aligns, $cols2 = null, $headers2 = null, $aligns2 = null) { - global $app_title, $version, $power_by, $power_url, $path_to_root, $db_connections; + global $app_title, $version, $power_by, $power_url; $this->addinfo('Title', $this->title); $this->addinfo('Subject', $this->title); @@ -164,7 +164,6 @@ class FrontReport extends Cpdf $this->fiscal_year = sql2date($year['begin']) . " - " . sql2date($year['end']) . " " . "(" . $how . ")"; $this->company = get_company_prefs(); $this->user = $_SESSION["wa_current_user"]->name; - //$this->host = $db_connections[$_SESSION["wa_current_user"]->company]["host"]; $this->host = $_SERVER['SERVER_NAME']; $this->params = $params; $this->cols = $cols; @@ -268,14 +267,14 @@ class FrontReport extends Cpdf $header2type = true; if ($this->currency != $myrow['curr_code']) { - include($path_to_root . "reporting/includes/doctext2.inc"); + include($path_to_root . "/reporting/includes/doctext2.inc"); } else { - include($path_to_root . "reporting/includes/doctext.inc"); + include($path_to_root . "/reporting/includes/doctext.inc"); } - include($path_to_root . "reporting/includes/header2.inc"); + include($path_to_root . "/reporting/includes/header2.inc"); $this->row = $temp; } @@ -320,6 +319,18 @@ class FrontReport extends Cpdf { return $this->TextWrap($this->cols[$c], $this->row - $r, $this->cols[$n] - $this->cols[$c] + $corr, $txt, $this->aligns[$c]); } + + function AmountCol($c, $n, $txt, $dec=0, $corr=0, $r=0) + { + return $this->TextCol($c, $n, number_format2($txt, $dec), $corr, $r); + } + + function DateCol($c, $n, $txt, $conv=false, $corr=0, $r=0) + { + if ($conv) + $txt = sql2date($txt); + return $this->TextCol($c, $n, $txt, $corr, $r); + } function TextCol2($c, $n, $txt, $corr=0, $r=0) {