Allowing the Tax Report to be printed to Excel/OO Calc
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 26 Apr 2010 08:32:48 +0000 (08:32 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 26 Apr 2010 08:32:48 +0000 (08:32 +0000)
CHANGELOG.txt
reporting/includes/excel_report.inc
reporting/rep709.php
reporting/reports_main.php

index b7a86e2b3937665f0dc4e9b38139864bd3ee9d4c..f732a28c613c529f6785ec0d4460c22435e01c78 100644 (file)
@@ -19,6 +19,12 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+26-Apr-2010 Joe Hunt
+! Allowing the Tax Report to be printed to Excel/OO Calc
+$ /reporting/rep709.php
+  /reports_main.php
+  /reporting/includes/excel_report.inc
+  
 21-Apr-2010 Joe Hunt
 # [0000223] Incorrect backup of tables with more than 2 digit prefix
 $ /admin/db/maintenance_db.inc
index f9065cea67bfe0dca5b1d1bb5d25e98362619292..4f8dbc6a2e10907c41e0e5b2f313a933b6f3c0ee 100644 (file)
@@ -70,7 +70,7 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook
                $this->endLine = 760;
                $this->fontSize = $fontsize;
                $this->oldFontSize = 0;
-               $this->y = 1;
+               $this->y = 0;
                $this->currency = '';
                $this->excelColWidthFactor = $excelColWidthFactor;
                $rtl = ($_SESSION['language']->dir == 'rtl');
@@ -236,7 +236,6 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook
 
        function Header()
        {
-               $this->y = 0;
                $tcol = $this->numcols - 1;
                $this->sheet->setRow($this->y, 20);
                for ($i = 0; $i < $this->numcols; $i++)
index 3fc4c6375673372cf19974563a047c1fb5625ee0..29fbc02532bf9b1ddbabf2bd98db7159b3a6c8d9 100644 (file)
@@ -77,8 +77,12 @@ function print_tax_report()
        $to = $_POST['PARAM_1'];
        $summaryOnly = $_POST['PARAM_2'];
        $comments = $_POST['PARAM_3'];
+       $destination = $_POST['PARAM_4'];
 
-       include_once($path_to_root . "/reporting/includes/pdf_report.inc");
+       if ($destination)
+               include_once($path_to_root . "/reporting/includes/excel_report.inc");
+       else
+               include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
        $dec = user_price_dec();
 
@@ -165,11 +169,14 @@ function print_tax_report()
 
        $aligns2 = array('left', 'right', 'right', 'right',     'right', 'right', 'right');
 
-       for ($i = 0; $i < count($cols2); $i++)
-               $rep->cols[$i] = $rep->leftMargin + $cols2[$i];
+       $rep->Info($params, $cols2, $headers2, $aligns2);
+
+       //for ($i = 0; $i < count($cols2); $i++)
+       //      $rep->cols[$i] = $rep->leftMargin + $cols2[$i];
 
-       $rep->headers = $headers2;
-       $rep->aligns = $aligns2;
+       //$rep->numcols = count($headers2);
+       //$rep->headers = $headers2;
+       //$rep->aligns = $aligns2;
        $rep->Header();
 
        $taxtotal = 0;
index 5bc356a1ccee7f8c38dbea29d33c068c99ddf5d0..31767cc0baab036768b13f188416d13a2f850376 100644 (file)
@@ -361,7 +361,8 @@ $reports->addReport(_('General Ledger'),709,_('Ta&x Report'),
        array(  _('Start Date') => 'DATEBEGINTAX',
                        _('End Date') => 'DATEENDTAX',
                        _('Summary Only') => 'YES_NO',
-                       _('Comments') => 'TEXTBOX'));
+                       _('Comments') => 'TEXTBOX',
+                       _('Destination') => 'DESTINATION'));
 $reports->addReport(_('General Ledger'),710,_('Audit Trail'),
        array(  _('Start Date') => 'DATEBEGINM',
                        _('End Date') => 'DATEENDM',