diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 15646307c91..95af5d1ff25 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -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.= ''; + if (! $options_only) $return.= ''; foreach ($this->cache_vatrates as $rate) { - // Force 0 if customer is not subject to VAT - if ($disabled && $rate['txtva'] != 0) continue; - $return.= ' @@ -35,7 +35,7 @@ trans('ReductionShort'); ?> margin->enabled)) { +if (! empty($conf->margin->enabled)) { ?> trans('BuyingPrice'); ?> margin->enabled)) { tva_assuj == "0") echo '0'; + if ($seller->tva_assuj == "0") echo '0'; else echo $form->load_tva('np_tva_tx', (isset($_POST["np_tva_tx"])?$_POST["np_tva_tx"]:-1), $seller, $buyer); ?> @@ -85,7 +85,7 @@ if (! empty($conf->margin->enabled)) { % margin->enabled)) { +if (! empty($conf->margin->enabled)) { ?> "> margin->enabled)) { -service->enabled && $dateSelector) { +service->enabled && $dateSelector) { if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10; else $colspan = 9; -if (! empty($conf->margin->enabled)) { +if (! empty($conf->margin->enabled)) { if($conf->global->DISPLAY_MARGIN_RATES) $colspan++; if($conf->global->DISPLAY_MARK_RATES) diff --git a/htdocs/core/tpl/objectline_add.tpl.php b/htdocs/core/tpl/objectline_add.tpl.php index 473b8589a58..817878ee3ba 100644 --- a/htdocs/core/tpl/objectline_add.tpl.php +++ b/htdocs/core/tpl/objectline_add.tpl.php @@ -146,7 +146,8 @@ if (! empty($conf->margin->enabled)) { load_tva('tva_tx', (GETPOST('tva_tx')?GETPOST('tva_tx'):-1), $seller, $buyer); + if ($buyer->tva_assuj == "0") echo '0'; + else echo $form->load_tva('tva_tx', (GETPOST('tva_tx')?GETPOST('tva_tx'):-1), $seller, $buyer); ?>