Merge branch '3.9' of git@github.com:Dolibarr/dolibarr.git into 3.9

Conflicts:
	htdocs/core/lib/functions.lib.php
This commit is contained in:
Laurent Destailleur 2016-10-24 02:11:49 +02:00
commit acf8874c6a

View File

@ -3336,7 +3336,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
$vatratecleaned = $vatrate; $vatratecleaned = $vatrate;
if (preg_match('/^(.*)\s*\((.*)\)$/', $vatrate, $reg)) // If vat is "xx (yy)" if (preg_match('/^(.*)\s*\((.*)\)$/', $vatrate, $reg)) // If vat is "xx (yy)"
{ {
$vatratecleaned = $reg[1]; $vatratecleaned = trim($reg[1]);
$vatratecode = $reg[2]; $vatratecode = $reg[2];
} }
@ -3350,7 +3350,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
{ {
if ($local == 1) if ($local == 1)
{ {
if (! $mysoc->localtax1_assuj || $tva=="0") return 0; if (! $mysoc->localtax1_assuj || (string) $vatratecleaned == "0") return 0;
if ($thirdparty_seller->id == $mysoc->id) if ($thirdparty_seller->id == $mysoc->id)
{ {
if (! $thirdparty_buyer->localtax1_assuj) return 0; if (! $thirdparty_buyer->localtax1_assuj) return 0;
@ -3363,7 +3363,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
if ($local == 2) if ($local == 2)
{ {
if (! $mysoc->localtax2_assuj || $tva=="0") return 0; if (! $mysoc->localtax2_assuj || (string) $vatratecleaned == "0") return 0;
if ($thirdparty_seller->id == $mysoc->id) if ($thirdparty_seller->id == $mysoc->id)
{ {
if (! $thirdparty_buyer->localtax2_assuj) return 0; if (! $thirdparty_buyer->localtax2_assuj) return 0;