From 778534883d0cd35f295dedf838abc7ed195ddeeb Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 4 Sep 2006 13:44:22 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20bug=20sur=20le=20module=20de=20num=E9rot?= =?UTF-8?q?ation=20orion.=20Modif:=20gestion=20de=20la=20date=20de=20cr=E9?= =?UTF-8?q?ation=20sur=20le=20module=20de=20num=E9rotation=20titan,=20ce?= =?UTF-8?q?=20dernier=20g=E8re=20correctement=20la=20date=20de=20cr=E9atio?= =?UTF-8?q?n=20car=20il=20se=20remet=20=E0=20z=E9ro=20en=20d=E9but=20d'ann?= =?UTF-8?q?=E9e=20fiscale.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/facture/orion/orion.modules.php | 14 ++++++++++--- .../modules/facture/titan/titan.modules.php | 20 ++++++++++++++----- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/htdocs/includes/modules/facture/orion/orion.modules.php b/htdocs/includes/modules/facture/orion/orion.modules.php index a0364b85074..33a91899623 100644 --- a/htdocs/includes/modules/facture/orion/orion.modules.php +++ b/htdocs/includes/modules/facture/orion/orion.modules.php @@ -75,14 +75,22 @@ function info() /** \brief Renvoi prochaine valeur attribuée * \return string Valeur */ - function getNextValue($date_creation) + function getNextValue($date_creation = '') { global $db,$conf; // On défini l'année fiscale $prefix='FA'; $current_month = date("n"); - $create_month = strftime("%m",$date_creation); + + if ($date_creation != '') + { + $create_month = strftime("%m",$date_creation); + } + else + { + $create_month = $current_month; + } if($conf->global->SOCIETE_FISCAL_MONTH_START && $current_month >= $conf->global->SOCIETE_FISCAL_MONTH_START && $create_month >= $conf->global->SOCIETE_FISCAL_MONTH_START) { @@ -133,7 +141,7 @@ function info() * \param objsoc Objet société * \return string Texte descripif */ - function getNumRef($objsoc=0,$date_creation) + function getNumRef($objsoc=0,$date_creation = '') { return $this->getNextValue($date_creation); } diff --git a/htdocs/includes/modules/facture/titan/titan.modules.php b/htdocs/includes/modules/facture/titan/titan.modules.php index 561e7c956d9..75faebee4fd 100644 --- a/htdocs/includes/modules/facture/titan/titan.modules.php +++ b/htdocs/includes/modules/facture/titan/titan.modules.php @@ -75,14 +75,24 @@ function info() /** \brief Renvoi prochaine valeur attribuée * \return string Valeur */ - function getNextValue() + function getNextValue($date_creation = '') { global $db,$conf; - // D'abord on défini l'année fiscale + // On défini l'année fiscale $prefix='FA'; $current_month = date("n"); - if($conf->global->SOCIETE_FISCAL_MONTH_START && $current_month >= $conf->global->SOCIETE_FISCAL_MONTH_START) + + if ($date_creation != '') + { + $create_month = strftime("%m",$date_creation); + } + else + { + $create_month = $current_month; + } + + if($conf->global->SOCIETE_FISCAL_MONTH_START && $current_month >= $conf->global->SOCIETE_FISCAL_MONTH_START && $create_month >= $conf->global->SOCIETE_FISCAL_MONTH_START) { $yy = strftime("%y",mktime(0,0,0,date("m"),date("d"),date("Y")+1)); } @@ -135,9 +145,9 @@ function info() * \param objsoc Objet société * \return string Texte descripif */ - function getNumRef($objsoc=0) + function getNumRef($objsoc=0,$date_creation = '') { - return $this->getNextValue(); + return $this->getNextValue($date_creation); } }