diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 95af5d1ff25..038b456291b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3096,10 +3096,20 @@ class Form $defaulttx = $this->cache_vatrates[$num-1]['txtva']; } - if (! $options_only) $return.= ''; + // Disabled if $mysoc is not subject to VAT + $disabled=false; $title=''; + if (is_object($societe_vendeuse) && $societe_vendeuse->id == $mysoc->id && $societe_vendeuse->tva_assuj == "0") { + $title=' title="'.$langs->trans('VATIsNotUsed').'"'; + $disabled=true; + } + + if (! $options_only) $return.= ''; foreach ($this->cache_vatrates as $rate) { + // Force 0 if $mysoc is not subject to VAT + if ($disabled && $rate['txtva'] != 0) continue; + $return.= 'margin->enabled)) { - tva_assuj == "0") echo '0'; - else echo $form->load_tva('tva_tx', (GETPOST('tva_tx')?GETPOST('tva_tx'):-1), $seller, $buyer); - ?> - + load_tva('tva_tx', (GETPOST('tva_tx')?GETPOST('tva_tx'):-1), $seller, $buyer); ?> +