X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Fincludes%2Fpdf_report.inc;h=c849f98fea60c9253257280a9d499d659cf1bbe6;hb=604d89ac6d18712d8b55bed821afe07b7106db3d;hp=9b0c9d4584029006a684ecf0535e5d7a4373767a;hpb=9967d9b22e1200e516aadf98ffcbcc65ac1c35bb;p=fa-stable.git
diff --git a/reporting/includes/pdf_report.inc b/reporting/includes/pdf_report.inc
index 9b0c9d45..c849f98f 100644
--- a/reporting/includes/pdf_report.inc
+++ b/reporting/includes/pdf_report.inc
@@ -1,10 +1,22 @@
.
+***********************************************************************/
/* $Revision$ */
$page_security = 8;
//include_once($path_to_root . "reporting/includes/class.pdf.inc");
include_once(dirname(__FILE__)."/class.pdf.inc");
-include_once($path_to_root . "admin/db/company_db.inc");
-include_once($path_to_root . "config.php");
+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");
class FrontReport extends Cpdf
{
var $size;
@@ -138,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);
@@ -152,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;
@@ -256,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;
}
@@ -278,12 +289,12 @@ class FrontReport extends Cpdf
function SetDrawColor($r, $g, $b)
{
- $this->setStrokeColor($r / 255, $g / 255, $b / 255);
+ $this->setStrokeColor($r, $g, $b);
}
function SetTextColor($r, $g, $b)
{
- TCPDF::SetTextColor($r / 255, $g / 255, $b / 255);
+ TCPDF::SetTextColor($r, $g, $b);
}
function Text($c, $txt, $n=0, $corr=0, $r=0)
@@ -314,7 +325,13 @@ class FrontReport extends Cpdf
return $this->TextWrap($this->cols2[$c], $this->row - $r, $this->cols2[$n] - $this->cols2[$c] + $corr, $txt, $this->aligns2[$c]);
}
- function TextColLines($c, $n, $txt, $corr=0)
+ function TextColLines($c, $n, $txt, $corr=0, $r=0)
+ {
+ $this->row -= $r;
+ $this->TextWrapLines($this->cols[$c], $this->cols[$n] - $this->cols[$c] + $corr, $txt, $this->aligns[$c]);
+ }
+
+ function TextWrapLines($c, $width, $txt, $align='left')
{
$str = Explode("\n", $txt);
for ($i = 0; $i < count($str); $i++)
@@ -322,7 +339,7 @@ class FrontReport extends Cpdf
$l = $str[$i];
do
{
- $l = $this->TextCol($c, $n, $l, $corr);
+ $l = $this->TextWrap($c, $this->row , $width, $l, $align);
$this->NewLine();
}
while ($l != '');
@@ -343,19 +360,17 @@ class FrontReport extends Cpdf
function NewLine($l=1, $np=0)
{
$this->row -= ($l * $this->lineHeight);
- if ($np > 0 && $this->row < $this->bottomMargin + ($np * $this->lineHeight))
+ if ($this->row < $this->bottomMargin + ($np * $this->lineHeight))
$this->Header();
}
function End($email=0, $subject=null, $myrow=null, $doctype = 0)
{
- global $go_debug, $path_to_root, $comp_path;
+ global $pdf_debug, $path_to_root, $comp_path;
- if ($go_debug == 1)
+ if ($pdf_debug == 1)
{
- $buf = $this->Output();
- $len = strlen($buf);
- $pdfcode = $buf;
+ $pdfcode = $this->Output('','S');
$pdfcode = str_replace("\n", "\n
", htmlspecialchars($pdfcode));
echo '