From 87f09a94a10c747de40ff3f716f00195813d7aef Mon Sep 17 00:00:00 2001 From: sparkyx Date: Mon, 1 May 2023 08:34:54 +0200 Subject: [PATCH] =?UTF-8?q?Bug=20#2259:=20MENU=20GESTION=20-=20op=C3=A9ati?= =?UTF-8?q?ons=20non=20prises=20en=20compte=20selon=20exercice=20s=C3=A9le?= =?UTF-8?q?ctionn=C3=A9=20dans=20=C2=ABPr=C3=A9f=C3=A9rences=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/balance_card.inc.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/include/balance_card.inc.php b/include/balance_card.inc.php index a00135478..11fa290d0 100644 --- a/include/balance_card.inc.php +++ b/include/balance_card.inc.php @@ -25,7 +25,7 @@ if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis'); $http=new HttpInput(); -global $g_user; +global $g_user,$cn; echo '
'; $exercice=new Exercice($cn); $old=''; @@ -42,10 +42,17 @@ else $array['from_periode']=$limit_periode[0]->first_day(); $array['to_periode']=$limit_periode[1]->last_day(); if (isset($_GET['ex'])) - { - $limit_periode=$per->get_limit($http->get('ex','number')); - $array['from_periode']=$limit_periode[0]->first_day(); - } + { + $ex=$http->get('ex','number'); + $limit_periode=$per->get_limit($ex); + + // if user's preference is greater $ex than I need operation until $ex otherwise since $ex + if ( $ex > $year) { + $array['to_periode']=$limit_periode[0]->last_day(); + } else { + $array['from_periode']=$limit_periode[0]->first_day(); + } + } /* * Add button to select another year