On passe plutot l'objet facture et c'est dans le model qu'on recup la date. Cela permet des modules de numérotation capable d'exploiter n'importe quelle info de la facture plutot que seulement la date
This commit is contained in:
parent
04b9e29645
commit
0d66247612
@ -72,10 +72,12 @@ function info()
|
|||||||
return "FA0600001";
|
return "FA0600001";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief Renvoi prochaine valeur attribuée
|
/** \brief Renvoi prochaine valeur attribuée
|
||||||
* \return string Valeur
|
* \param objsoc Objet société
|
||||||
*/
|
* \param facture Objet facture
|
||||||
function getNextValue($date_creation = '')
|
* \return string Valeur
|
||||||
|
*/
|
||||||
|
function getNextValue($objsoc,$facture)
|
||||||
{
|
{
|
||||||
global $db,$conf;
|
global $db,$conf;
|
||||||
|
|
||||||
@ -83,9 +85,9 @@ function info()
|
|||||||
$prefix='FA';
|
$prefix='FA';
|
||||||
$current_month = date("n");
|
$current_month = date("n");
|
||||||
|
|
||||||
if ($date_creation != '')
|
if ($facture->date)
|
||||||
{
|
{
|
||||||
$create_month = strftime("%m",$date_creation);
|
$create_month = strftime("%m",$facture->date);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -144,7 +146,7 @@ function info()
|
|||||||
*/
|
*/
|
||||||
function getNumRef($objsoc=0,$facture)
|
function getNumRef($objsoc=0,$facture)
|
||||||
{
|
{
|
||||||
return $this->getNextValue($facture->date);
|
return $this->getNextValue($objsoc,$facture);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,10 +72,12 @@ function info()
|
|||||||
return "FA0600001";
|
return "FA0600001";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief Renvoi prochaine valeur attribuée
|
/** \brief Renvoi prochaine valeur attribuée
|
||||||
* \return string Valeur
|
* \param objsoc Objet société
|
||||||
*/
|
* \param facture Objet facture
|
||||||
function getNextValue($date_creation = '')
|
* \return string Valeur
|
||||||
|
*/
|
||||||
|
function getNextValue($objsoc,$facture)
|
||||||
{
|
{
|
||||||
global $db,$conf;
|
global $db,$conf;
|
||||||
|
|
||||||
@ -83,9 +85,9 @@ function info()
|
|||||||
$prefix='FA';
|
$prefix='FA';
|
||||||
$current_month = date("n");
|
$current_month = date("n");
|
||||||
|
|
||||||
if ($date_creation != '')
|
if ($facture->date)
|
||||||
{
|
{
|
||||||
$create_month = strftime("%m",$date_creation);
|
$create_month = strftime("%m",$facture->date);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -148,7 +150,7 @@ function info()
|
|||||||
*/
|
*/
|
||||||
function getNumRef($objsoc=0,$facture)
|
function getNumRef($objsoc=0,$facture)
|
||||||
{
|
{
|
||||||
return $this->getNextValue($facture->date);
|
return $this->getNextValue($objsoc,$facture);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user