Fix: problème de numérotation lorsque le compteur ne se remet pas à zero en début d'année fiscale
This commit is contained in:
parent
0dfcb46182
commit
a732a83244
@ -197,14 +197,21 @@ function info()
|
|||||||
$searchyy='';
|
$searchyy='';
|
||||||
$sql = "SELECT MAX(facnumber)";
|
$sql = "SELECT MAX(facnumber)";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||||
if ($conf->global->FACTURE_NUM_RESTART_BEGIN_YEAR) $sql.= " WHERE facnumber like '".$this->searchLast."%'";
|
if ($conf->global->FACTURE_NUM_RESTART_BEGIN_YEAR)
|
||||||
|
{
|
||||||
|
$sql.= " WHERE facnumber like '".$this->searchLast."%'";
|
||||||
|
}
|
||||||
|
else if ($facture->type == 2)
|
||||||
|
{
|
||||||
|
$sql.= " WHERE type = 2";
|
||||||
|
}
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
if ($row) $searchyy = substr($row[0],0,-$posindice);
|
if ($row) $searchyy = substr($row[0],0,-$posindice);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->global->FACTURE_NUM_DELTA || $conf->global->AVOIR_NUM_DELTA)
|
if ($conf->global->FACTURE_NUM_DELTA || $conf->global->AVOIR_NUM_DELTA)
|
||||||
{
|
{
|
||||||
//on vérifie si il y a une année précédente
|
//on vérifie si il y a une année précédente
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user