00001 <?
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00026 include_once("class_poste.php");
00027 include_once("ac_common.php");
00028 include_once("postgres.php");
00029 include_once("class.ezpdf.php");
00030 include_once("impress_inc.php");
00031 include("poste.php");
00032
00033 $cn=DbConnect($_SESSION['g_dossier']);
00034 foreach ($HTTP_POST_VARS as $key=>$element) {
00035 ${"$key"}=$element;
00036 }
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 $ret="";
00049 $pdf=& new Cezpdf();
00050 $pdf->selectFont('./addon/fonts/Helvetica.afm');
00051
00052
00053
00054 $Poste=new poste($cn,$poste_id);
00055 list($array,$tot_deb,$tot_cred)=$Poste->GetRow($from_periode,$to_periode);
00056
00057
00058
00059
00060 $Libelle=sprintf("(%s) %s ",$Poste->id,$Poste->GetName());
00061
00062
00063 $pdf->ezTable($array,
00064 array ('jr_internal'=>'Opération',
00065 'j_date' => 'Date',
00066 'jrn_name'=>'Journal',
00067 'description'=>'Description',
00068 'deb_montant'=> 'Montant',
00069 'cred_montant'=> 'Montant'
00070 ),$Libelle,
00071 array('shaded'=>0,'showHeadings'=>1,'width'=>500,
00072 'cols'=>array('montant'=> array('justification'=>'right'),
00073 )));
00074 $str_debit=sprintf("Débit % 12.2f",$tot_deb);
00075 $str_cred=sprintf("Crédit % 12.2f",$tot_cred);
00076 $diff_solde=$tot_deb-$tot_cred;
00077 if ( $diff_solde < 0 ) {
00078 $solde=" C ";
00079 $diff_solde*=-1;
00080 } else
00081 {
00082 $solde=" D ";
00083 }
00084 $str_solde=sprintf(" Solde %s %12.2f",$solde,$diff_solde);
00085
00086 $pdf->ezText($str_debit,10,array('justification'=>'right'));
00087 $pdf->ezText($str_cred,10,array('justification'=>'right'));
00088 $pdf->ezText($str_solde,14,array('justification'=>'right'));
00089
00090
00091
00092
00093
00094 $pdf->ezStream();
00095
00096 ?>