noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 12/21: FIX P0TVA when no data


From: dwm
Subject: [Noalyss-commit] [noalyss] 12/21: FIX P0TVA when no data
Date: Sun, 15 Dec 2024 09:51:38 -0500 (EST)

sparkyx pushed a commit to branch unstable
in repository noalyss.

commit 7d15bc9d6a81fda17e43fa382dc8e04dc1c84af4
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sat Dec 7 18:19:49 2024 +0100

    FIX P0TVA when no data
---
 include/class/periode.class.php | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/include/class/periode.class.php b/include/class/periode.class.php
index dee39238e..77beb78b5 100644
--- a/include/class/periode.class.php
+++ b/include/class/periode.class.php
@@ -100,15 +100,21 @@ EOF;
     function is_closed()
     {
         if ($this->jrn_def_id!=0)
+        {
+
             $sql="select status from jrn_periode ".
-                    " where jrn_def_id=".$this->jrn_def_id.
-                    " and p_id =".$this->p_id;
+                    " where jrn_def_id=$2 ".
+                    " and p_id = $1";
+            $status=$this->cn->get_value($sql,[$this->p_id,$this->jrn_def_id]);
+        }
         else
+        {
             $sql="select p_closed as status from parm_periode ".
                     " where ".
-                    " p_id =".$this->p_id;
-        $res=$this->cn->exec_sql($sql);
-        $status=Database::fetch_result($res, 0, 0);
+                    " p_id = $1";
+            $status=$this->cn->get_value($sql,[$this->p_id]);
+
+        }
         if ($status=='CL'||$status=='t'||$status=='CE')
             return 1;
         return 0;



reply via email to

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