diff --git a/htdocs/includes/modules/facture/titan/titan.modules.php b/htdocs/includes/modules/facture/titan/titan.modules.php index b9a767a3e27..ac90c44a3b0 100644 --- a/htdocs/includes/modules/facture/titan/titan.modules.php +++ b/htdocs/includes/modules/facture/titan/titan.modules.php @@ -88,11 +88,17 @@ function info() } $num = $num + 1; - $current_month = date("n"); - if($current_month >= $conf->global->FISCAL_MONTH_START) - $y = strftime("%y",mktime(0,0,0,date("m"),date("d"),date("Y")+1)); - else - $y = strftime("%y",time()); + $current_month = date("n"); + + if($conf->global->SOCIETE_FISCAL_MONTH_START && $current_month >= $conf->global->FISCAL_MONTH_START) + { + $y = strftime("%y",mktime(0,0,0,date("m"),date("d"),date("Y")+1)); + } + else + { + $y = strftime("%y",time()); + } + return "FA" . "$y" . substr("0000".$num, strlen("0000".$num)-5,5); } diff --git a/htdocs/includes/modules/propale/mod_propale_emeraude.php b/htdocs/includes/modules/propale/mod_propale_emeraude.php index 1e31de55b05..c5ed1252f9f 100644 --- a/htdocs/includes/modules/propale/mod_propale_emeraude.php +++ b/htdocs/includes/modules/propale/mod_propale_emeraude.php @@ -88,12 +88,19 @@ class mod_propale_emeraude extends ModeleNumRefPropales $num = $row[0]; } - $current_month = date("n"); - if($current_month >= $conf->global->FISCAL_MONTH_START) + + $current_month = date("n"); + + if($conf->global->SOCIETE_FISCAL_MONTH_START && $current_month >= $conf->global->FISCAL_MONTH_START) + { $y = strftime("%y",mktime(0,0,0,date("m"),date("d"),date("Y")+1)); - else - $y = strftime("%y",time()); - $num = $num + 1; + } + else + { + $y = strftime("%y",time()); + } + + $num = $num + 1; return "PR" . "$y" . substr("0000".$num, strlen("0000".$num)-5,5); }