diff --git a/htdocs/paiement.class.php b/htdocs/paiement.class.php
index 6825f10bf6288530c5c44d35df925de68a619272..7aa2332f52ba39508195e3f108af980832c6dd1d 100644
--- a/htdocs/paiement.class.php
+++ b/htdocs/paiement.class.php
@@ -68,7 +68,7 @@ class Paiement
     /**
      *    \brief      R�cup�re l'objet paiement
      *    \param      id      id du paiement a r�cup�rer
-     *    \return     int     <0 si ko, >0 si ok
+     *    \return     int     <0 si ko, 0 si non trouv�, >0 si ok
      */
     function fetch($id)
 	{
@@ -80,6 +80,7 @@ class Paiement
 		$sql.= ' WHERE p.fk_paiement = c.id';
 		$sql.= ' AND p.rowid = '.$id;
 
+		dolibarr_syslog("Paiement::fetch sql=".$sql);
 		$result = $this->db->query($sql);
 		
 		if ($result)
@@ -98,13 +99,15 @@ class Paiement
 				$this->type_libelle   = $obj->type_libelle;
 				$this->type_code      = $obj->type_code;
 				$this->statut         = $obj->statut;
+
+				$this->db->free($result);
 				return 1;
 			}
 			else
 			{
-				return -2;
+				$this->db->free($result);
+				return 0;
 			}
-			$this->db->free($result);
 		}
 		else
 		{