Fix: bug #33123
This commit is contained in:
parent
91432e8d63
commit
b1bcd94b3b
@ -35,7 +35,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php");
|
|||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = isset($_REQUEST["socid"])?$_REQUEST["socid"]:'';
|
$socid = GETPOST("socid");
|
||||||
if ($user->societe_id > 0) $socid = $user->societe_id;
|
if ($user->societe_id > 0) $socid = $user->societe_id;
|
||||||
if (!$user->rights->compta->resultat->lire && !$user->rights->accounting->comptarapport->lire)
|
if (!$user->rights->compta->resultat->lire && !$user->rights->accounting->comptarapport->lire)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
@ -63,6 +63,8 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
|||||||
// We define date_start and date_end
|
// We define date_start and date_end
|
||||||
$year_end=$year_start;
|
$year_end=$year_start;
|
||||||
$month_start=GETPOST("month")?GETPOST("month"):($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
|
$month_start=GETPOST("month")?GETPOST("month"):($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
|
||||||
|
if (! GETPOST('month'))
|
||||||
|
{
|
||||||
if ($month_start > $month_current)
|
if ($month_start > $month_current)
|
||||||
{
|
{
|
||||||
$year_start--;
|
$year_start--;
|
||||||
@ -71,6 +73,8 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
|||||||
$month_end=$month_start-1;
|
$month_end=$month_start-1;
|
||||||
if ($month_end < 1) $month_end=12;
|
if ($month_end < 1) $month_end=12;
|
||||||
else $year_end++;
|
else $year_end++;
|
||||||
|
}
|
||||||
|
else $month_end=$month_start;
|
||||||
$date_start=dol_get_first_day($year_start,$month_start,false); $date_end=dol_get_last_day($year_end,$month_end,false);
|
$date_start=dol_get_first_day($year_start,$month_start,false); $date_end=dol_get_last_day($year_end,$month_end,false);
|
||||||
}
|
}
|
||||||
if ($q==1) { $date_start=dol_get_first_day($year_start,1,false); $date_end=dol_get_last_day($year_start,3,false); }
|
if ($q==1) { $date_start=dol_get_first_day($year_start,1,false); $date_end=dol_get_last_day($year_start,3,false); }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user