Merge pull request #801 from simnandez/3.3

Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated
This commit is contained in:
Laurent Destailleur 2013-04-05 13:47:43 -07:00
commit 5736cf0144
2 changed files with 20 additions and 1 deletions

View File

@ -4,6 +4,14 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.3.2 compared to 3.3.1 *****
-Fix: Ducth (nl_NL) translation
-Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated
-Generalize fix: file with a specific mask not found, again
***** ChangeLog for 3.3.1 compared to 3.3 *****
- Fix: [ bug #733 ] Mass emailing tools do not support <style HTML tag

View File

@ -2689,7 +2689,18 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
// Some test to guess with no need to make database access
if ($mysoc->country_code == 'ES') // For spain localtaxes 1 and 2, tax is qualified if buyer use local taxe
{
if ($local == 1 && ! $thirdparty_buyer->localtax1_assuj) return 0;
if ($local == 1)
{
if ($thirdparty_seller->id==$mysoc->id)
{
if (! $thirdparty_buyer->localtax1_assuj) return 0;
}
else
{
if (! $thirdparty_seller->localtax1_assuj) return 0;
}
}
if ($local == 2 && ! $thirdparty_buyer->localtax2_assuj) return 0;
}
else