La librairie fpdfi etant une source different de fpdf, elle est mise separee et n'est plus melangee.
This commit is contained in:
parent
8f8a423a87
commit
4dfde355f0
@ -27,7 +27,6 @@
|
|||||||
\brief Fichier de la classe permettant de générer les rapports de paiement
|
\brief Fichier de la classe permettant de générer les rapports de paiement
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/includes/fpdf/fpdfi/fpdi_protection.php');
|
require_once(DOL_DOCUMENT_ROOT.'/includes/fpdf/fpdfi/fpdi_protection.php');
|
||||||
|
|
||||||
|
|
||||||
@ -35,14 +34,13 @@ require_once(DOL_DOCUMENT_ROOT.'/includes/fpdf/fpdfi/fpdi_protection.php');
|
|||||||
\class pdf_paiement
|
\class pdf_paiement
|
||||||
\brief Classe permettant de générer les rapports de paiement
|
\brief Classe permettant de générer les rapports de paiement
|
||||||
*/
|
*/
|
||||||
|
class pdf_paiement extends FPDF
|
||||||
class pdf_paiement
|
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
\brief Constructeur
|
\brief Constructeur
|
||||||
\param db handler accès base de donnée
|
\param db handler accès base de donnée
|
||||||
*/
|
*/
|
||||||
function pdf_paiement($db=0)
|
function pdf_paiement($db)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@ -50,6 +48,16 @@ class pdf_paiement
|
|||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->description = $langs->transnoentities("ListOfCustomerPayments");
|
$this->description = $langs->transnoentities("ListOfCustomerPayments");
|
||||||
|
|
||||||
|
// Dimension page pour format A4
|
||||||
|
$this->type = 'pdf';
|
||||||
|
$this->page_largeur = 210;
|
||||||
|
$this->page_hauteur = 297;
|
||||||
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
|
$this->marge_gauche=10;
|
||||||
|
$this->marge_droite=10;
|
||||||
|
$this->marge_haute=10;
|
||||||
|
$this->marge_basse=10;
|
||||||
|
|
||||||
$this->tab_top = 30;
|
$this->tab_top = 30;
|
||||||
|
|
||||||
$this->line_height = 5;
|
$this->line_height = 5;
|
||||||
@ -62,7 +70,7 @@ class pdf_paiement
|
|||||||
\param pdf pdf object
|
\param pdf pdf object
|
||||||
\param page current page number
|
\param page current page number
|
||||||
\param pages number of pages
|
\param pages number of pages
|
||||||
*/
|
*/
|
||||||
function Header(&$pdf, $page, $pages)
|
function Header(&$pdf, $page, $pages)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
@ -121,7 +129,6 @@ class pdf_paiement
|
|||||||
$yp = 0;
|
$yp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$pdf->SetXY (10, $this->tab_top + 10 + $yp);
|
$pdf->SetXY (10, $this->tab_top + 10 + $yp);
|
||||||
$pdf->MultiCell(30, $this->line_height, $lines[$j][1], 0, 'J', 1);
|
$pdf->MultiCell(30, $this->line_height, $lines[$j][1], 0, 'J', 1);
|
||||||
|
|
||||||
@ -152,6 +159,7 @@ class pdf_paiement
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Fonction générant le rapport sur le disque
|
\brief Fonction générant le rapport sur le disque
|
||||||
\param _dir repertoire
|
\param _dir repertoire
|
||||||
@ -209,8 +217,9 @@ class pdf_paiement
|
|||||||
$sql .= " AND p.fk_paiement = c.id ";
|
$sql .= " AND p.fk_paiement = c.id ";
|
||||||
$sql .= " AND date_format(p.datep, '%Y%m') = " . sprintf("%04d%02d",$year,$month);
|
$sql .= " AND date_format(p.datep, '%Y%m') = " . sprintf("%04d%02d",$year,$month);
|
||||||
$sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC";
|
$sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC";
|
||||||
$result = $this->db->query($sql);
|
|
||||||
|
|
||||||
|
dolibarr_syslog("pdf_paiement::write_pdf_file sql=".$sql);
|
||||||
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$lignes = $this->db->num_rows($result);
|
$lignes = $this->db->num_rows($result);
|
||||||
@ -230,10 +239,14 @@ class pdf_paiement
|
|||||||
$lines[$i][4] = price($objp->paiement_amount);
|
$lines[$i][4] = price($objp->paiement_amount);
|
||||||
$lines[$i][5] = price($objp->facture_amount);
|
$lines[$i][5] = price($objp->facture_amount);
|
||||||
$lines[$i][6] = price($objp->pf_amount);
|
$lines[$i][6] = price($objp->pf_amount);
|
||||||
$lines[$i][7] = price($objp->prowid);
|
$lines[$i][7] = $objp->prowid;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dolibarr_print_error($this->db);
|
||||||
|
}
|
||||||
|
|
||||||
$pages = intval($lignes / $this->line_per_page);
|
$pages = intval($lignes / $this->line_per_page);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user