Some additional changes in pdf_report.inc for supporting report extensions.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 21 Dec 2009 23:36:30 +0000 (23:36 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 21 Dec 2009 23:36:30 +0000 (23:36 +0000)
CHANGELOG.txt
reporting/includes/pdf_report.inc

index 628cecb5a4900fe178ec24e07b08d7a96744af90..fc24d63837364176d88071d49fa54e84bcc14c65 100644 (file)
@@ -19,6 +19,10 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+22-Dec-2009 Joe Hunt
+! Some additional changes in pdf_report.inc for supporting report extensions.
+$ /reporting/includes/pdf_report.inc
+
 21-Dec-2009 Chaitanya/Janusz Dobrowolski
 # [0000184] Bad source document quantities update and invalid qtys during
        derivative document entry.
index c5ce8ba395d8a1c5279ee8fa6aeeadae081ae735..05942ecaeb22565450128e320b35ad707b40fa10 100644 (file)
@@ -46,6 +46,7 @@ class FrontReport extends Cpdf
        var $oldFontSize;
        var $currency;
        var $companyLogoEnable;  // select whether to use a company logo graphic in some header templates
+       var $scaleLogoWidth;
        var $footerEnable;  // select whether to print a page footer or not
        var $footerText;  // store user-generated footer text
        var $headerFunc;  // store the name of the currently selected header function
@@ -196,6 +197,7 @@ class FrontReport extends Cpdf
                $this->oldFontSize = 0;
                $this->row = $this->pageHeight - $this->topMargin;
                $this->currency = '';
+               $this->scaleLogoWidth = false; // if Logo, scale on width (else height).
                $this->headerFunc = 'Header';  // default to the original header template
                $rtl = ($_SESSION['language']->dir === 'rtl' ? 'rtl' : 'ltr');
                $code = $_SESSION['language']->code;
@@ -469,7 +471,10 @@ class FrontReport extends Cpdf
 
                        // Width being zero means that the image will be scaled to the specified height
                        // keeping its aspect ratio intact.
-                       $this->AddImage($logo, $companyCol, $this->row - (LOGO_HEIGHT * LOGO_Y_POS_ADJ_FACTOR), 0, LOGO_HEIGHT);
+                       if ($this->scaleLogoWidth)
+                               $this->AddImage($logo, $companyCol, $this->row, COMPANY_WIDTH, 0);
+                       else    
+                               $this->AddImage($logo, $companyCol, $this->row - (LOGO_HEIGHT * LOGO_Y_POS_ADJ_FACTOR), 0, LOGO_HEIGHT);
                }
                else
                        $this->Text($companyCol, $this->company['coy_name']);