Revert "Fix: Disabled if customer is not subject to VAT"

This reverts commit 8f21abfc5a.
This commit is contained in:
Laurent Destailleur
2012-08-30 20:29:03 +02:00
parent cd9a6942ce
commit eea2840f15
2 changed files with 3 additions and 12 deletions

View File

@@ -3096,20 +3096,10 @@ class Form
$defaulttx = $this->cache_vatrates[$num-1]['txtva'];
}
// Disabled if customer is not subject to VAT
$disabled=false;
if (is_object($societe_acheteuse) && ! empty($societe_acheteuse->id)
&& $societe_acheteuse->tva_assuj == "0") {
$disabled=true;
}
if (! $options_only) $return.= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled?' disabled="disabled"':'').'>';
if (! $options_only) $return.= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
foreach ($this->cache_vatrates as $rate)
{
// Force 0 if customer is not subject to VAT
if ($disabled && $rate['txtva'] != 0) continue;
$return.= '<option value="'.$rate['txtva'];
$return.= $rate['nprtva'] ? '*': '';
$return.= '"';

View File

@@ -146,7 +146,8 @@ if (! empty($conf->margin->enabled)) {
<td align="right">
<?php
echo $form->load_tva('tva_tx', (GETPOST('tva_tx')?GETPOST('tva_tx'):-1), $seller, $buyer);
if ($buyer->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" value="0">0';
else echo $form->load_tva('tva_tx', (GETPOST('tva_tx')?GETPOST('tva_tx'):-1), $seller, $buyer);
?>
<input type="hidden" id="origin_tva_tx_cache" name="origin_tva_tx_cache" value="" />
</td>