noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 148/162: New function findSide return D if nu


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 148/162: New function findSide return D if number is <0
Date: Sat, 11 Jul 2020 13:24:08 -0400 (EDT)

sparkyx pushed a commit to annotated tag E-4
in repository noalyss.

commit 7b488dfd3964fbf6877b95d222fb6a4876093e03
Author: Dany De Bontridder <dany@alchimerys.be>
AuthorDate: Tue Jan 8 17:53:22 2019 +0100

    New function findSide return D if number is  <0
---
 include/lib/ac_common.php | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php
index c57d20a..ca7d654 100644
--- a/include/lib/ac_common.php
+++ b/include/lib/ac_common.php
@@ -114,6 +114,22 @@ function nb($p_number)
 }
 
 /**
+ * return D if the number is smaller than 0 , C if bigger and an empty string 
if
+ * equal to 0. Used for displaying saldo D / C (debit / credit )
+ * @param float $p_number
+ */
+function findSide($p_number)
+{
+    $return ='';
+    if ( $p_number > 0 ) {
+        $return ='D';
+    }else {
+        $return =($p_number== 0)?"":"C";
+    }
+    return $return;
+}
+
+/**
  * format the number with a sep. for the thousand
  * @param $p_number number
  * @param $p_dec number of decimal to display



reply via email to

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