noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
class_print_ledger_misc.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  *   This file is part of NOALYSS.
00004  *
00005  *   NOALYSS is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   NOALYSS is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with NOALYSS; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00021 
00022 /*!\file
00023  * \brief print a listing of financial
00024  */
00025 require_once('class_pdf.php');
00026 class Print_Ledger_Misc extends PDF
00027 {
00028     function __construct($p_cn,$p_jrn)
00029     {
00030         parent::__construct($p_cn,'P','mm','A4');
00031         $this->ledger=$p_jrn;
00032         $this->jrn_type=$p_jrn->get_type();
00033     }
00034     function Header()
00035     {
00036         //Arial bold 12
00037         $this->SetFont('DejaVu', 'B', 12);
00038         //Title
00039         $this->Cell(0,10,$this->dossier, 'B', 0, 'C');
00040         //Line break
00041         $this->Ln(20);
00042         $this->SetFont('DejaVu', 'B', 7);
00043         $this->Cell(30,6,'Piece');
00044         $this->Cell(10,6,'Date');
00045         $this->Cell(20,6,'Interne');
00046         $this->Cell(25,6,'Tiers');
00047         $this->Cell(80,6,'Commentaire');
00048         $this->Cell(15,6,'Montant');
00049         $this->Ln(6);
00050 
00051     }
00052     function Footer()
00053     {
00054         //Position at 2 cm from bottom
00055         $this->SetY(-20);
00056         //Arial italic 8
00057         $this->SetFont('Arial', 'I', 8);
00058         //Page number
00059         $this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
00060         $this->Ln(3);
00061         // Created by NOALYSS
00062         $this->Cell(0,8,'Created by NOALYSS, online on http://www.aevalys.eu',0,0,'C',false,'http://www.aevalys.eu');
00063     }
00064     /**
00065      *@brief print the pdf
00066      *@param
00067      *@param
00068      *@return
00069      *@see
00070      */
00071     function export()
00072     {
00073         $a_jrn=$this->ledger->get_operation($_GET['from_periode'],
00074                                             $_GET['to_periode']);
00075         $this->SetFont('DejaVu', '', 6);
00076         if ( $a_jrn == null ) return;
00077         for ( $i=0;$i<count($a_jrn);$i++)
00078         {
00079             $row=$a_jrn[$i];
00080             $this->LongLine(30,5,$row['pj']);
00081             $this->Cell(10,5,$row['date_fmt']);
00082             $this->Cell(20,5,$row['internal']);
00083             $type=$this->cn->get_value("select jrn_def_type from jrn_def where jrn_def_id=$1",array($a_jrn[$i]['jr_def_id']));
00084             $other=mb_substr($this->ledger->get_tiers($type,$a_jrn[$i]['id']),0,25);
00085             $this->LongLine(25,5,$other,0,'L');
00086             $this->LongLine(80,5,$row['comment'],0,'L');
00087             $this->Cell(15,5,nbm($row['montant']),0,0,'R');
00088             $this->Ln(5);
00089 
00090         }
00091     }
00092 }
 All Data Structures Namespaces Files Functions Variables Enumerations