$element) { ${"$key"}=$element; } $ret=""; $pdf=& new Cezpdf(); $pdf->selectFont('./addon/fonts/Helvetica.afm'); echo_debug("quick_code_pdf",__LINE__,$f_id); $Fiche=new fiche($cn,$f_id); list($array,$tot_deb,$tot_cred)=$Fiche->GetRow($from_periode,$to_periode); // don't print empty account if ( count($array) == 0 ) { continue; } $Libelle=sprintf("(%s) %s ",$Fiche->id,$Fiche->getName()); // $pdf->ezText($Libelle,30); $pdf->ezTable($array, array ('jr_internal'=>'Opération', 'j_date' => 'Date', 'jrn_name'=>'Journal', 'description'=>'Description', 'deb_montant'=> 'Montant', 'cred_montant'=> 'Montant' ),$Libelle, array('shaded'=>0,'showHeadings'=>1,'width'=>500, 'cols'=>array('montant'=> array('justification'=>'right'), ))); $str_debit=sprintf("Débit % 12.2f",$tot_deb); $str_cred=sprintf("Crédit % 12.2f",$tot_cred); $diff_solde=$tot_deb-$tot_cred; if ( $diff_solde < 0 ) { $solde=" C "; $diff_solde*=-1; } else { $solde=" D "; } $str_solde=sprintf(" Solde %s %12.2f",$solde,$diff_solde); $pdf->ezText($str_debit,10,array('justification'=>'right')); $pdf->ezText($str_cred,10,array('justification'=>'right')); $pdf->ezText($str_solde,14,array('justification'=>'right')); //New page $pdf->ezNewPage(); $pdf->ezStream(); ?>