Fix: Maxi bug. Value for date used in object numbering module was current date instead of date of object.

This commit is contained in:
Laurent Destailleur
2008-07-05 14:20:03 +00:00
parent 2ec5ffee48
commit 6d8755edd4
22 changed files with 769 additions and 641 deletions

View File

@@ -88,9 +88,9 @@ class mod_commande_marbre extends ModeleNumRefCommandes
* \param commande Object order
* \return string Value if OK, 0 if KO
*/
function getNextValue($objsoc=0,$commande)
function getNextValue($objsoc,$commande)
{
global $db;
global $db;
// D'abord on r<>cup<75>re la valeur max (r<>ponse imm<6D>diate car champ ind<6E>x<EFBFBD>)
$coyymm='';
@@ -129,22 +129,25 @@ class mod_commande_marbre extends ModeleNumRefCommandes
{
$max=0;
}
$yymm = strftime("%y%m",time());
//$date=time();
$date=$commande->date;
$yymm = strftime("%y%m",$date);
$num = sprintf("%04s",$max+1);
dolibarr_syslog("mod_commande_marbre::getNextValue return ".$this->prefix."$yymm-$num");
return $this->prefix."$yymm-$num";
dolibarr_syslog("mod_commande_marbre::getNextValue return ".$this->prefix.$yymm."-".$num);
return $this->prefix.$yymm."-".$num;
}
/** \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)
/** \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);
return $this->getNextValue($objsoc,$objforref);
}
}
?>