diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index e32934d31a6..df2b999d830 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -64,7 +64,7 @@ print ''; $sql = "SELECT count(b.rowid)"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; -$sql.= " WHERE b.fk_type = 'CHQ'AND b.fk_bordereau = 0"; +$sql.= " WHERE b.fk_type = 'CHQ' AND b.fk_bordereau = 0"; $sql.= " AND b.amount > 0"; $resql = $db->query($sql); diff --git a/htdocs/compta/paiement/cheque/remisecheque.class.php b/htdocs/compta/paiement/cheque/remisecheque.class.php index 8a07f84054f..e14d6c044e3 100644 --- a/htdocs/compta/paiement/cheque/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/remisecheque.class.php @@ -335,6 +335,43 @@ class RemiseCheque return $this->errno; } + + /** + * \brief Charge indicateurs this->nbtodo et this->nbtodolate de tableau de bord + * \param user Objet user + * \return int <0 si ko, >0 si ok + */ + function load_board($user) + { + global $conf; + + if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe + + $this->nbtodo=$this->nbtodolate=0; + $sql = "SELECT b.rowid,".$this->db->pdate("b.datev")." as datefin"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql.= " WHERE b.fk_type = 'CHQ' AND b.fk_bordereau = 0"; + $sql.= " AND b.amount > 0"; + + $resql=$this->db->query($sql); + if ($resql) + { + while ($obj=$this->db->fetch_object($resql)) + { + $this->nbtodo++; + if ($obj->datefin < (time() - $conf->bank->cheque->warning_delay)) $this->nbtodolate++; + } + return 1; + } + else + { + dolibarr_print_error($this->db); + $this->error=$this->db->error(); + return -1; + } + } + + /** \brief Génère le fichier PDF \param model Nom du modele diff --git a/htdocs/index.php b/htdocs/index.php index 74d7904c3e7..8e341cf30e2 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -465,7 +465,7 @@ if ($conf->global->MAIN_SHOW_WORKBOARD == 1) $board->load_board($user); $var=!$var; - print ''.img_object($langs->trans("MenuChequeDeposits"),"payment").''.$langs->trans("MenuChequeDeposits").''; + print ''.img_object($langs->trans("BankChecksToReceipt"),"payment").''.$langs->trans("BankChecksToReceipt").''; print ''.$board->nbtodo.''; print ''; print ''; diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php index 16c18feaeee..d59a86b7d93 100644 --- a/htdocs/societe.class.php +++ b/htdocs/societe.class.php @@ -1098,7 +1098,7 @@ class Societe * \param option Sur quoi pointe le lien * \return string Chaine avec URL */ - function getNomUrl($withpicto=0,$option='') + function getNomUrl($withpicto=0,$option='',$maxlen=0) { global $langs; @@ -1127,7 +1127,7 @@ class Societe } if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany"),'company').$lienfin.' '); - $result.=$lien.$this->nom.$lienfin; + $result.=$lien.($maxlen?dolibarr_trunc($this->nom,$maxlen):$this->nom).$lienfin; return $result; }