From 0d66247612ce180aef8b46c849209cf9ec05fa04 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Sep 2006 19:47:30 +0000 Subject: [PATCH] =?UTF-8?q?On=20passe=20plutot=20l'objet=20facture=20et=20?= =?UTF-8?q?c'est=20dans=20le=20model=20qu'on=20recup=20la=20date.=20Cela?= =?UTF-8?q?=20permet=20des=20modules=20de=20num=E9rotation=20capable=20d'e?= =?UTF-8?q?xploiter=20n'importe=20quelle=20info=20de=20la=20facture=20plut?= =?UTF-8?q?ot=20que=20seulement=20la=20date?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/facture/orion/orion.modules.php | 16 +++++++++------- .../modules/facture/titan/titan.modules.php | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/htdocs/includes/modules/facture/orion/orion.modules.php b/htdocs/includes/modules/facture/orion/orion.modules.php index ae06feba976..56f728f13e1 100644 --- a/htdocs/includes/modules/facture/orion/orion.modules.php +++ b/htdocs/includes/modules/facture/orion/orion.modules.php @@ -72,10 +72,12 @@ function info() return "FA0600001"; } - /** \brief Renvoi prochaine valeur attribuée - * \return string Valeur - */ - function getNextValue($date_creation = '') + /** \brief Renvoi prochaine valeur attribuée + * \param objsoc Objet société + * \param facture Objet facture + * \return string Valeur + */ + function getNextValue($objsoc,$facture) { global $db,$conf; @@ -83,9 +85,9 @@ function info() $prefix='FA'; $current_month = date("n"); - if ($date_creation != '') + if ($facture->date) { - $create_month = strftime("%m",$date_creation); + $create_month = strftime("%m",$facture->date); } else { @@ -144,7 +146,7 @@ function info() */ function getNumRef($objsoc=0,$facture) { - return $this->getNextValue($facture->date); + return $this->getNextValue($objsoc,$facture); } } diff --git a/htdocs/includes/modules/facture/titan/titan.modules.php b/htdocs/includes/modules/facture/titan/titan.modules.php index d56e53f2562..d9a86f8b37f 100644 --- a/htdocs/includes/modules/facture/titan/titan.modules.php +++ b/htdocs/includes/modules/facture/titan/titan.modules.php @@ -72,10 +72,12 @@ function info() return "FA0600001"; } - /** \brief Renvoi prochaine valeur attribuée - * \return string Valeur - */ - function getNextValue($date_creation = '') + /** \brief Renvoi prochaine valeur attribuée + * \param objsoc Objet société + * \param facture Objet facture + * \return string Valeur + */ + function getNextValue($objsoc,$facture) { global $db,$conf; @@ -83,9 +85,9 @@ function info() $prefix='FA'; $current_month = date("n"); - if ($date_creation != '') + if ($facture->date) { - $create_month = strftime("%m",$date_creation); + $create_month = strftime("%m",$facture->date); } else { @@ -148,7 +150,7 @@ function info() */ function getNumRef($objsoc=0,$facture) { - return $this->getNextValue($facture->date); + return $this->getNextValue($objsoc,$facture); } }