mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-13 19:25:22 +01:00
Fix: Maxi bug. Value for date used in object numbering module was current date instead of date of object.
This commit is contained in:
@@ -64,11 +64,13 @@ class mod_commande_opale extends ModeleNumRefCommandes
|
||||
}
|
||||
|
||||
|
||||
/** \brief Renvoi prochaine valeur attribu<62>e
|
||||
* \return string Valeur
|
||||
*/
|
||||
function getNextValue()
|
||||
{
|
||||
/** \brief Return next value
|
||||
* \param objsoc Objet third party
|
||||
* \param commande Object order
|
||||
* \return string Value if OK, 0 if KO
|
||||
*/
|
||||
function getNextValue($objsoc,$commande)
|
||||
{
|
||||
global $db;
|
||||
|
||||
// D'abord on r<>cup<75>re la valeur max (r<>ponse imm<6D>diate car champ ind<6E>x<EFBFBD>)
|
||||
@@ -90,20 +92,24 @@ class mod_commande_opale extends ModeleNumRefCommandes
|
||||
{
|
||||
$max=0;
|
||||
}
|
||||
$yy = strftime("%y",time());
|
||||
//$date=time();
|
||||
$date=$commande->date;
|
||||
$yy = strftime("%y",$date);
|
||||
$hex = strtoupper(dechex($max+1));
|
||||
$ref = substr("000000".($hex),-6);
|
||||
|
||||
return 'COM-'.substr($ref,0,3)."-".substr($ref,3,3);
|
||||
}
|
||||
|
||||
/** \brief Renvoie la r<>f<EFBFBD>rence de commande suivante non utilis<69>e
|
||||
* \param objsoc Objet soci<EFBFBD>t<EFBFBD>
|
||||
* \return string Texte descripif
|
||||
*/
|
||||
function commande_get_num($objsoc=0)
|
||||
{
|
||||
return $this->getNextValue();
|
||||
}
|
||||
/** \brief Return next free value
|
||||
* \param objsoc Object third party
|
||||
* \param objforref Object for number to search
|
||||
* \return string Next free value
|
||||
*/
|
||||
function commande_get_num($objsoc,$objforref)
|
||||
{
|
||||
return $this->getNextValue($objsoc,$objforref);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user