diff --git a/htdocs/compta/paiement/cheque/remisecheque.class.php b/htdocs/compta/paiement/cheque/remisecheque.class.php index fa9ef40c22b5a899554379fa4a2e8f8726ba11f0..ecdd27068a047cee83a1e790cd52d8f08002431f 100644 --- a/htdocs/compta/paiement/cheque/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/remisecheque.class.php @@ -46,7 +46,7 @@ class RemiseCheque extends CommonObject /** * \brief Constructeur de la classe - * \param DB handler acc�s base de donn�es + * \param DB handler acc�s base de donn�es * \param id id compte (0 par defaut) */ function RemiseCheque($DB) @@ -157,7 +157,7 @@ class RemiseCheque extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= " WHERE b.fk_type = 'CHQ' AND b.amount > 0"; $sql.= " AND b.fk_bordereau = 0 AND b.fk_account='".$account_id."'"; - $sql.= " LIMIT 40"; // On limite a 40 pour ne g�n�rer des PDF que d'une page + $sql.= " LIMIT 40"; // On limite a 40 pour ne g�n�rer des PDF que d'une page dolibarr_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); @@ -282,6 +282,8 @@ class RemiseCheque extends CommonObject */ function Validate($user) { + global $langs; + $this->errno = 0; $this->db->begin(); @@ -317,11 +319,6 @@ class RemiseCheque extends CommonObject } } - if ($this->errno == 0) - { - $result=$this->GeneratePdf(); - } - // Commit/Rollback if ($this->errno == 0) { @@ -413,6 +410,8 @@ class RemiseCheque extends CommonObject { global $langs; + if (empty($model)) $model='blochet'; + dolibarr_syslog("RemiseCheque::GeneratePdf model=".$model, LOG_DEBUG); $dir=DOL_DOCUMENT_ROOT ."/includes/modules/cheque/pdf/"; @@ -538,7 +537,7 @@ class RemiseCheque extends CommonObject } /** - \brief Ins�re la remise en base + \brief Ins�re la remise en base \param user utilisateur qui effectue l'operation \param account_id Compte bancaire concerne */ @@ -565,7 +564,7 @@ class RemiseCheque extends CommonObject return 0; } /** - \brief Charge les propri�t�s ref_previous et ref_next + \brief Charge les propri�t�s ref_previous et ref_next \return int <0 si ko, 0 si ok */ function load_previous_next_id() @@ -607,7 +606,7 @@ class RemiseCheque extends CommonObject */ function getNomUrl($withpicto=0,$option='') { - global $langs; // TODO Renvoyer le libell� anglais et faire traduction a affichage + global $langs; // TODO Renvoyer le libell� anglais et faire traduction a affichage $result=''; @@ -623,8 +622,8 @@ class RemiseCheque extends CommonObject } /** - * \brief Retourne le libell� du statut d'une facture (brouillon, valid�e, abandonn�e, pay�e) - * \param mode 0=libell� long, 1=libell� court, 2=Picto + Libell� court, 3=Picto, 4=Picto + Libell� long, 5=Libell� court + Picto + * \brief Retourne le libell� du statut d'une facture (brouillon, valid�e, abandonn�e, pay�e) + * \param mode 0=libell� long, 1=libell� court, 2=Picto + Libell� court, 3=Picto, 4=Picto + Libell� long, 5=Libell� court + Picto * \return string Libelle */ function getLibStatut($mode=0) @@ -633,14 +632,14 @@ class RemiseCheque extends CommonObject } /** - * \brief Renvoi le libell� d'un statut donne + * \brief Renvoi le libell� d'un statut donne * \param status Statut - * \param mode 0=libell� long, 1=libell� court, 2=Picto + Libell� court, 3=Picto, 4=Picto + Libell� long, 5=Libell� court + Picto - * \return string Libell� du statut + * \param mode 0=libell� long, 1=libell� court, 2=Picto + Libell� court, 3=Picto, 4=Picto + Libell� long, 5=Libell� court + Picto + * \return string Libell� du statut */ function LibStatut($status,$mode=0) { - global $langs; // TODO Renvoyer le libell� anglais et faire traduction a affichage + global $langs; // TODO Renvoyer le libell� anglais et faire traduction a affichage $langs->load('compta'); if ($mode == 0) {