diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php
index be3426024d0..4aa5055a6b8 100644
--- a/htdocs/compta/paiement/cheque/fiche.php
+++ b/htdocs/compta/paiement/cheque/fiche.php
@@ -344,7 +344,7 @@ else
print "
";
print '| '.$i.' | ';
- print ''.$objp->num_chq.' | ';
+ print ''.($objp->num_chq?$objp->num_chq:' ').' | ';
print ''.dolibarr_trunc($objp->emetteur,24).' | ';
print ''.dolibarr_trunc($objp->banque,24).' | ';
print ''.price($objp->amount).' | ';
diff --git a/htdocs/compta/paiement/cheque/pdf/pdf_blochet.class.php b/htdocs/compta/paiement/cheque/pdf/pdf_blochet.class.php
index 4d616cdf8cd..3df01404d19 100644
--- a/htdocs/compta/paiement/cheque/pdf/pdf_blochet.class.php
+++ b/htdocs/compta/paiement/cheque/pdf/pdf_blochet.class.php
@@ -179,7 +179,7 @@ class BordereauChequeBlochet
$pdf->MultiCell(8, $this->line_height, $j+1, 0, 'R', 0);
$pdf->SetXY (10, $this->tab_top + 10 + $yp);
- $pdf->MultiCell(20, $this->line_height, $this->lines[$j]->num_chq, 0, 'J', 0);
+ $pdf->MultiCell(20, $this->line_height, $this->lines[$j]->num_chq?$this->lines[$j]->num_chq:'', 0, 'J', 0);
$pdf->SetXY (30, $this->tab_top + 10 + $yp);
$pdf->MultiCell(70, $this->line_height, dolibarr_trunc($this->lines[$j]->bank_chq,44), 0, 'J', 0);
diff --git a/htdocs/compta/paiement/cheque/remisecheque.class.php b/htdocs/compta/paiement/cheque/remisecheque.class.php
index 5a5352e8037..8a07f84054f 100644
--- a/htdocs/compta/paiement/cheque/remisecheque.class.php
+++ b/htdocs/compta/paiement/cheque/remisecheque.class.php
@@ -336,10 +336,10 @@ class RemiseCheque
}
/**
- \brief Génère le fichier PDF
- \param model Nom du modele
- \return int, 0 en cas de succes
- \todo Finir la gestion multi modèle
+ \brief Génère le fichier PDF
+ \param model Nom du modele
+ \return int <0 si KO, 0 si OK
+ \todo Finir la gestion multi modèle
*/
function GeneratePdf($model='Blochet')
{
@@ -350,7 +350,7 @@ class RemiseCheque
$pdf = new BordereauChequeBlochet($db);
- $sql = "SELECT b.banque, b.emetteur, b.amount ";
+ $sql = "SELECT b.banque, b.emetteur, b.amount, b.num_chq ";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba ";
$sql.= " , ".MAIN_DB_PREFIX."bordereau_cheque as bc";
$sql.= " WHERE b.fk_account = ba.rowid AND b.fk_bordereau = bc.rowid";
@@ -364,9 +364,10 @@ class RemiseCheque
$i = 0;
while ( $objp = $this->db->fetch_object($result) )
{
- $pdf->lines[$i][0] = $objp->banque;
- $pdf->lines[$i][1] = $objp->emetteur;
- $pdf->lines[$i][2] = price($objp->amount);
+ $pdf->lines[$i]->bank_chq = $objp->banque;
+ $pdf->lines[$i]->emetteur_chq = $objp->emetteur;
+ $pdf->lines[$i]->amount_chq = $objp->amount;
+ $pdf->lines[$i]->num_chq = $objp->num_chq;
$i++;
}
}