noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 22/33: REPORT Put the amount in red if negati


From: dwm
Subject: [Noalyss-commit] [noalyss] 22/33: REPORT Put the amount in red if negative
Date: Thu, 18 Jul 2024 12:24:48 -0400 (EDT)

sparkyx pushed a commit to branch unstable
in repository noalyss.

commit 891fa1a2a9cedf893506223869df2f92c9390656
Author: Dany wm <danydb@noalyss.eu>
AuthorDate: Thu Jul 4 17:05:35 2024 +0200

    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 "<TR $class>".
         "<TD>".h($op['desc'])."</TD>".
-        "<TD align=\"right\">".nbm($op['montant'])."</TD>".
+        "<TD $style>".nbm($op['montant'])."</TD>".
         "</TR>";
     }
     echo "</table>";
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 '<tr '.$class.'>';
 
-          echo '<td> '.$row['desc'].'</td>'.
-            '<td style="text-align:right">'.nbm($row['montant'])." 
&euro;</td>";
+          echo '<td> '.$row['desc'].'</td>';
+            $style='style="text-align:right;"';
+            if ($row['montant']<0) { 
$style='style="color:red;text-align:right;"';}
+            echo  "<td $style>".nbm($row['montant'])."</td>";
           echo '</tr>';
         }
         echo '</table>';



reply via email to

[Prev in Thread] Current Thread [Next in Thread]