From 8f21abfc5a5e1f08b1fbc432b221796f39eb27fe Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 30 Aug 2012 19:01:48 +0200 Subject: [PATCH] Fix: Disabled if customer is not subject to VAT --- htdocs/core/class/html.form.class.php | 12 +++++++++++- htdocs/core/tpl/objectline_add.tpl.php | 3 +-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 95af5d1ff25..15646307c91 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.= ''; foreach ($this->cache_vatrates as $rate) { + // Force 0 if customer is not subject to VAT + if ($disabled && $rate['txtva'] != 0) continue; + $return.= '