From 891fa1a2a9cedf893506223869df2f92c9390656 Mon Sep 17 00:00:00 2001 From: Dany wm Date: Thu, 4 Jul 2024 17:05:35 +0200 Subject: [PATCH] REPORT Put the amount in red if negative --- include/impress_rapport.inc.php | 5 +++-- include/template/dashboard.php | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/impress_rapport.inc.php b/include/impress_rapport.inc.php index b3a4acfda..fe3bd0cf2 100644 --- a/include/impress_rapport.inc.php +++ b/include/impress_rapport.inc.php @@ -322,10 +322,11 @@ function ShowReportResult($p_array) { $i++; $class= ( $i % 2 == 0 )?' class="odd"':' class="even"'; - + $style='style="text-align:right;"'; + if ($op['montant']<0) { $style='style="color:red;text-align:right;"';} echo "". "".h($op['desc'])."". - "".nbm($op['montant'])."". + "".nbm($op['montant'])."". ""; } echo ""; diff --git a/include/template/dashboard.php b/include/template/dashboard.php index cd32f25cd..558ccc9b3 100644 --- a/include/template/dashboard.php +++ b/include/template/dashboard.php @@ -74,8 +74,10 @@ if ( $report != 0 ) : ?> $class=($ix%2==0)?' class="even" ':' class="odd" '; echo ''; - echo ' '.$row['desc'].''. - ''.nbm($row['montant'])." €"; + echo ' '.$row['desc'].''; + $style='style="text-align:right;"'; + if ($row['montant']<0) { $style='style="color:red;text-align:right;"';} + echo "".nbm($row['montant']).""; echo ''; } echo '';