diff --git a/ChangeLog b/ChangeLog index e72f196d4e1..3ec8c385e9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -55,6 +55,7 @@ For users: - New: [ task #826 ] Optionnal increase stock when deleting an invoice already validated. - New: [ task #823 ] Shipping_validate email notification. - New: [ task #900 ] Review code of ficheinter.class.php +- Fix: [Bug #958] LocalTax2 for Spain fails on Suppliers For translators: - Update language files. diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8123feede72..1173c418d6a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2812,7 +2812,18 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") } } - if ($local == 2 && ! $thirdparty_buyer->localtax2_assuj) return 0; + if ($local == 2) + { + + if ($thirdparty_seller->id==$mysoc->id) + { + if (! $thirdparty_buyer->localtax2_assuj) return 0; + } + else + { + if (! $thirdparty_seller->localtax2_assuj) return 0; + } + } } else {