Skip to content
Snippets Groups Projects
Commit 314069f1 authored by Juanjo Menent's avatar Juanjo Menent
Browse files

Qual: Remove unused function

parent cd6c6f64
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment