mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-05 16:42:53 +01:00
Fix: on vrifie si il exsite une anne prcdente sinon le delta sera appliqu de nouveau sur la nouvelle anne
This commit is contained in:
@@ -108,7 +108,17 @@ class mod_commande_diamant extends ModeleNumRefCommandes
|
||||
|
||||
//on v<>rifie si il y a une ann<6E>e pr<70>c<EFBFBD>dente
|
||||
//sinon le delta sera appliqu<71> de nouveau sur la nouvelle ann<6E>e
|
||||
$pryy = 'PR'.strftime("%y",mktime(0,0,0,date("m"),date("d"),date("Y")-1));
|
||||
$lastyy = 'C'.strftime("%y",mktime(0,0,0,date("m"),date("d"),date("Y")-1));
|
||||
$sql = "SELECT MAX(ref)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande";
|
||||
$sql.= " WHERE ref like '${lastyy}%'";
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
$lastyy='';
|
||||
if ($row) $lastyy = substr($row[0],0,4);
|
||||
}
|
||||
|
||||
// Si au moins un champ respectant le mod<6F>le a <20>t<EFBFBD> trouv<75>e
|
||||
if (eregi('C[0-9][0-9]',$cyy))
|
||||
@@ -125,7 +135,7 @@ class mod_commande_diamant extends ModeleNumRefCommandes
|
||||
$max = $row[0];
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (!eregi('C[0-9][0-9]',$lastyy))
|
||||
{
|
||||
$max=$conf->global->COMMANDE_DIAMANT_DELTA?$conf->global->COMMANDE_DIAMANT_DELTA:0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user