altocompta/html/quick_code_pdf.php
Dany De Bontridder f22f87f5b2 Merged revisions 2977-2992 via svnmerge from
file:///home/developper/svn/phpcompta/branches/rel500

........
  r2980 | danydb | 2010-03-14 12:34:36 +0100 (Sun, 14 Mar 2010) | 2 lines
  
  Fix Bug : Update date_limit, incorrect date when date is null
........
  r2981 | danydb | 2010-03-14 12:54:18 +0100 (Sun, 14 Mar 2010) | 1 line
  
  Class Database : add new value $this->sql and $this->array
........
  r2982 | danydb | 2010-03-14 12:55:18 +0100 (Sun, 14 Mar 2010) | 1 line
  
  Fix Bug : when giving a bank name the saldo is not display
........
  r2983 | danydb | 2010-03-14 12:55:53 +0100 (Sun, 14 Mar 2010) | 1 line
  
  Fix Bug : restore cannot apply a path on a template
........
  r2984 | danydb | 2010-03-14 12:56:20 +0100 (Sun, 14 Mar 2010) | 1 line
  
  code cleaning remove useless comment
........
  r2985 | danydb | 2010-03-16 20:50:46 +0100 (Tue, 16 Mar 2010) | 2 lines
  
  Bug in the import : the counter is incremented twice
........
  r2986 | danydb | 2010-03-22 13:57:03 +0100 (Mon, 22 Mar 2010) | 1 line
  
  Update DUTCH message.po
........
  r2987 | danydb | 2010-03-22 21:21:49 +0100 (Mon, 22 Mar 2010) | 2 lines
  
  Fix bug : the month in the calendar always has 31 days
........
  r2988 | danydb | 2010-03-24 21:32:22 +0100 (Wed, 24 Mar 2010) | 2 lines
  
  Change : when entering a quick code in a financial ledger, the label is updated and not the description
........
  r2989 | danydb | 2010-03-24 22:01:06 +0100 (Wed, 24 Mar 2010) | 3 lines
  
  Fix Bug : cannot get operation from COMMERCIAL->FOURNISSEUR
........
  r2990 | danydb | 2010-04-05 13:56:33 +0200 (Mon, 05 Apr 2010) | 2 lines
  
  Improve Database : new function exist_schema
........
  r2991 | danydb | 2010-04-07 13:32:56 +0200 (Wed, 07 Apr 2010) | 2 lines
  
  Fix : Bug forecats periode is always equal to 0, so we lose the modifications
........
2010-04-08 14:14:16 +00:00

92 lines
2.6 KiB
PHP

<?php
/*
* This file is part of PhpCompta.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* PhpCompta is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
// $Revision$
/*! \file
* \brief send the account list in PDF
*/
include_once("class_acc_account_ledger.php");
include_once("ac_common.php");
require_once('class_database.php');
include_once("class.ezpdf.php");
include_once("impress_inc.php");
require_once("class_fiche.php");
require_once ('header_print.php');
require_once('class_dossier.php');
$gDossier=dossier::id();
$cn=new Database($gDossier);
foreach ($_POST as $key=>$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->get_row_date($from_periode,$to_periode);
// don't print empty account
if ( count($array) == 0 ) {
continue;
}
$Libelle=utf8_decode(sprintf("(%s) %s ",$Fiche->id,$Fiche->getName()));
header_pdf($cn,$pdf);
$pdf->ezTable($array,
array ('jr_internal'=>'Operation',
'j_date_fmt' => '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'),
)),true);
$str_debit=utf8_decode(sprintf("Débit % 12.2f",$tot_deb));
$str_cred=utf8_decode(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();
header_pdf($cn,$pdf);
$pdf->ezStream();
?>