diff --git a/html/ajax_misc.php b/html/ajax_misc.php
index bb3e672c7..a7da58929 100644
--- a/html/ajax_misc.php
+++ b/html/ajax_misc.php
@@ -632,6 +632,7 @@ EOF;
EOF;
break;
case 'label_tva':
+ $code=$http->request('code','string','x');
$cn =Dossier::connect();
$tva=Acc_Tva::build($cn, $id);
@@ -639,13 +640,13 @@ EOF;
$value = _('tva inconnue');
else
{
- $value=$tva->tva_label;
+ $value=htmlentities($tva->tva_label);
}
header('Content-type: text/xml; charset=UTF-8');
echo <<
-$id
+$code
$value
EOF;
diff --git a/html/js/noalyss_script.js b/html/js/noalyss_script.js
index bb584f94a..2265b3aa5 100644
--- a/html/js/noalyss_script.js
+++ b/html/js/noalyss_script.js
@@ -626,8 +626,10 @@ function popup_select_tva(obj, p_function_callback) {
function set_tva_label(obj) {
try {
var queryString = "gDossier=" + obj.gDossier + "&op=label_tva" + "&id=" + obj.value;
- if (obj.jcode)
+ if (obj.jcode )
queryString += '&code=' + obj.jcode;
+ else if ( obj.getAttribute("jcode") )
+ queryString += '&code=' + obj.getAttribute("jcode") ;
var action = new Ajax.Request(
"ajax_misc.php",
{
diff --git a/include/lib/itva_popup.class.php b/include/lib/itva_popup.class.php
index efcfce12b..13bb6b3bc 100644
--- a/include/lib/itva_popup.class.php
+++ b/include/lib/itva_popup.class.php
@@ -145,7 +145,7 @@ class ITva_Popup extends HtmlInput
list="dl_tva_%s" autocomplete="off">';
$r = sprintf($str, $this->name, $this->value, $this->id, _("C.TVA"),$this->js, $strAttribut,$this->id);
$r.=$code;
- $r.=$this->make_datalist();
+
if ($this->in_table)
$table = '