From 507a1d3b160903066cab8e96ef499cdd80c3c6e6 Mon Sep 17 00:00:00 2001 From: Maximilien Rozniecki Date: Wed, 10 May 2023 15:14:09 +0200 Subject: [PATCH] the end accounting period should not be the fiscal month start but the month just before it --- htdocs/accountancy/tpl/export_journal.tpl.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php index 767f95cb252..ca375d1c4cc 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -55,10 +55,10 @@ if (($accountancyexport->getFormatCode($formatexportset) == 'fec' || $accountanc $tmparray = dol_getdate($datetouseforfilename); $fiscalmonth = empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START; // Define end of month to use - if ($tmparray['mon'] <= $fiscalmonth) { - $tmparray['mon'] = $fiscalmonth; + if ($tmparray['mon'] < $fiscalmonth || $fiscalmonth == 1) { + $tmparray['mon'] = $fiscalmonth == 1 ? 12 : $fiscalmonth - 1; } else { - $tmparray['mon'] = $fiscalmonth; + $tmparray['mon'] = $fiscalmonth - 1; $tmparray['year']++; }