26 if (empty($conf->global->SOCIETE_FISCAL_MONTH_START)) {
27 $conf->global->SOCIETE_FISCAL_MONTH_START = 1;
33 $year_current = $current_date[
'year'];
34 $year_start = $year_current;
36 $year_current = $year;
42 if (empty($date_start) || empty($date_end)) {
49 if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) {
50 $date_start =
dol_time_plus_duree(
dol_get_first_day($year_start, $current_date[
'mon'],
false), -3 - (($current_date[
'mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3),
'm');
52 } elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) {
53 if ($current_date[
'mon'] < $conf->global->SOCIETE_FISCAL_MONTH_START) {
54 if (($conf->global->SOCIETE_FISCAL_MONTH_START - $current_date[
'mon']) > 6) {
58 if (($current_date[
'mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) < 6) {
62 $date_start =
dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START,
'tzserver');
64 } elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) {
92 $date_start_day = $tmp[
'mday'];
93 $date_start_month = $tmp[
'mon'];
94 $date_start_year = $tmp[
'year'];
96 $date_end_day = $tmp[
'mday'];
97 $date_end_month = $tmp[
'mon'];
98 $date_end_year = $tmp[
'year'];