noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 10/11: Fix : retrieve label from tva_code


From: dwm
Subject: [Noalyss-commit] [noalyss] 10/11: Fix : retrieve label from tva_code
Date: Thu, 8 Aug 2024 14:52:17 -0400 (EDT)

sparkyx pushed a commit to branch unstable
in repository noalyss.

commit fc7a474c192ecda8023ecc818a9b0dbdbf9f1d51
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Thu Aug 8 20:51:45 2024 +0200

    Fix : retrieve label from tva_code
---
 html/ajax_misc.php | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/html/ajax_misc.php b/html/ajax_misc.php
index 888f171eb..bb3e672c7 100644
--- a/html/ajax_misc.php
+++ b/html/ajax_misc.php
@@ -633,21 +633,19 @@ EOF;
                break;
        case 'label_tva':
                $cn =Dossier::connect();
-               if (isNumber($id) == 0)
+        $tva=Acc_Tva::build($cn, $id);
+
+        if ($tva->tva_id == -1 )
                        $value = _('tva inconnue');
                else
                {
-                       $Res = $cn->get_array("select * from tva_rate where 
tva_id = $1", array($id));
-                       if (count($Res) == 0)
-                               $value = _('tva inconnue');
-                       else
-                               $value = $Res[0]['tva_label'];
+           $value=$tva->tva_label;
                }
                header('Content-type: text/xml; charset=UTF-8');
                echo <<<EOF
 <?xml version="1.0" encoding="UTF-8"?>
 <data>
-<code>$code</code>
+<code>$id</code>
 <value>$value</value>
 </data>
 EOF;



reply via email to

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