the end accounting period should not be the fiscal month start but the month just before it

This commit is contained in:
Maximilien Rozniecki 2023-05-10 15:14:09 +02:00
parent a900a6c968
commit 507a1d3b16

View File

@ -55,10 +55,10 @@ if (($accountancyexport->getFormatCode($formatexportset) == 'fec' || $accountanc
$tmparray = dol_getdate($datetouseforfilename); $tmparray = dol_getdate($datetouseforfilename);
$fiscalmonth = empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START; $fiscalmonth = empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START;
// Define end of month to use // Define end of month to use
if ($tmparray['mon'] <= $fiscalmonth) { if ($tmparray['mon'] < $fiscalmonth || $fiscalmonth == 1) {
$tmparray['mon'] = $fiscalmonth; $tmparray['mon'] = $fiscalmonth == 1 ? 12 : $fiscalmonth - 1;
} else { } else {
$tmparray['mon'] = $fiscalmonth; $tmparray['mon'] = $fiscalmonth - 1;
$tmparray['year']++; $tmparray['year']++;
} }