[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 02/04: Task #1269 - changement de période po
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 02/04: Task #1269 - changement de période pour /PRINTBAL et PRINTBILAN #1269 : by default last day of exercice |
Date: |
Mon, 29 Feb 2016 12:01:24 +0000 |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 06e998af4d81b8988c18e54eb1cd54545cdf74e0
Author: Dany De Bontridder <address@hidden>
Date: Mon Feb 29 12:33:11 2016 +0100
Task #1269 - changement de période pour /PRINTBAL et PRINTBILAN
#1269 : by default last day of exercice
---
include/balance.inc.php | 6 ++++++
include/impress_bilan.inc.php | 7 +++++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/include/balance.inc.php b/include/balance.inc.php
index dde3f32..310c4db 100644
--- a/include/balance.inc.php
+++ b/include/balance.inc.php
@@ -75,6 +75,12 @@ $input_from->user=$g_user;
echo _('Depuis').' :'.$input_from->input();
// filter on the current year
$to=HtmlInput::default_value_get("to_periode", "");
+
+if( $to == "") {
+ $t_periode=new Periode($cn);
+ list($per_max,$per_min)=$t_periode->get_limit($exercice);
+ $to=$per_min->p_id;
+}
$input_to=new IPeriod("to_periode",$to,$exercice);
$input_to->show_start_date=false;
$input_to->filter_year=true;
diff --git a/include/impress_bilan.inc.php b/include/impress_bilan.inc.php
index 0a946ee..ebed1b7 100644
--- a/include/impress_bilan.inc.php
+++ b/include/impress_bilan.inc.php
@@ -61,6 +61,13 @@ $filter_year=" where p_exercice='".sql_string($exercice)."'";
echo '<FORM METHOD="GET">';
echo HtmlInput::hidden('type','bilan');
echo dossier::hidden();
+
+// By default , show last day of exercice
+if ($bilan->to == -1 ){
+ $t_periode=new Periode($cn);
+ list($per_max,$per_min)=$t_periode->get_limit($exercice);
+ $bilan->to=$per_min->p_id;
+}
echo $bilan->display_form ($filter_year);
echo '<span class="notice"> '._('Attention : si le bilan n\'est pas
équilibré.<br> Vérifiez <ul>
<li>L\'affectation du résultat est fait</li>