From 314069f1da1fbf9c33953e18a5bb0aed7b379346 Mon Sep 17 00:00:00 2001 From: Juanjo Menent <jmenent@2byte.es> Date: Sun, 3 Apr 2016 15:47:07 +0200 Subject: [PATCH] Qual: Remove unused function --- .../cheque/class/remisecheque.class.php | 43 +------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 4f43a87f8e7..6ab43a277c0 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -344,8 +344,7 @@ class RemiseCheque extends CommonObject $this->errno = 0; $this->db->begin(); - - //$numref=$this->getNextNumber(); + $numref = $this->getNextNumRef(); if ($this->errno == 0 && $numref) @@ -394,46 +393,6 @@ class RemiseCheque extends CommonObject } } - - /** - * Old module for cheque receipt numbering - * - * @return int Next ref of cheque - */ - function getNextNumber() - { - global $conf; - - $num=0; - - // We use +0 to convert varchar to ref for mysql, use ::integer for postgres. - // We must found a generic solution (Use a $db->toint function ?) - $sql = "SELECT "; - if ($this->db->type == 'pgsql') $sql.="MAX(ref::integer)"; - else $sql.="MAX(ref+0)"; - $sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque"; - $sql.= " WHERE entity = ".$conf->entity; - $sql.= " AND ref not like '(%'"; - - dol_syslog("Remisecheque::getNextNumber", LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) - { - $row = $this->db->fetch_row($resql); - $num = $row[0]; - $this->db->free($resql); - } - else - { - $this->errno = -1034; - dol_syslog("Remisecheque::Validate Erreur SELECT ($this->errno)", LOG_ERR); - } - - $num++; - - return $num; - } - /** * Return next reference of cheque receipts not already used (or last reference) * according to numbering module defined into constant FACTURE_ADDON -- GitLab