00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 require_once('class_pdf.php');
00026 class Print_Ledger_Financial extends PDF
00027 {
00028 function __construct($p_cn,$p_jrn)
00029 {
00030 parent::__construct($p_cn,'L','mm','A4');
00031 $this->ledger=$p_jrn;
00032 $this->jrn_type=$p_jrn->get_type();
00033 }
00034 function Header()
00035 {
00036
00037 $this->SetFont('DejaVu', 'B', 12);
00038
00039 $this->Cell(0,10,$this->dossier, 'B', 0, 'C');
00040
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(40,6,'Dest/Orig');
00047 $this->Cell(105,6,'Commentaire');
00048 $this->Cell(15,6,'Montant');
00049 $this->Ln(6);
00050
00051 }
00052 function Footer()
00053 {
00054
00055 $this->SetY(-20);
00056
00057 $this->SetFont('Arial', 'I', 8);
00058
00059 $this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
00060 $this->Ln(3);
00061
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
00066
00067
00068 function export()
00069 {
00070 $a_jrn=$this->ledger->get_operation($_GET['from_periode'],
00071 $_GET['to_periode']);
00072 $this->SetFont('DejaVu', '', 6);
00073 if ( $a_jrn == null ) return;
00074 for ( $i=0;$i<count($a_jrn);$i++)
00075 {
00076 $row=$a_jrn[$i];
00077 $this->LongLine(30,5,$row['pj']);
00078 $this->Cell(10,5,$row['date_fmt']);
00079 $this->Cell(20,5,$row['internal']);
00080
00081 $name=$this->ledger->get_tiers($this->jrn_type,$row['id']);
00082 $this->LongLine(40,5,$name,0,'L');
00083
00084
00085 $this->LongLine(105,5,$row['comment'],0,'L');
00086 $amount=$this->cn->get_value('select qf_amount from quant_fin where jr_id=$1',array( $row['id']));
00087 $this->Cell(15,5,sprintf('%s',nbm($amount)),0,0,'R');
00088 $this->Ln(5);
00089
00090 }
00091 }
00092 }