Qual: Remove unused function
This commit is contained in:
parent
cd6c6f64c5
commit
314069f1da
@ -345,7 +345,6 @@ class RemiseCheque extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
//$numref=$this->getNextNumber();
|
|
||||||
$numref = $this->getNextNumRef();
|
$numref = $this->getNextNumRef();
|
||||||
|
|
||||||
if ($this->errno == 0 && $numref)
|
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)
|
* Return next reference of cheque receipts not already used (or last reference)
|
||||||
* according to numbering module defined into constant FACTURE_ADDON
|
* according to numbering module defined into constant FACTURE_ADDON
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user