2
0
forked from Wavyzz/dolibarr

Fix: Local taxes. If buyer not subject to localtax no need make database

access
This commit is contained in:
simnandez
2012-11-16 12:13:29 +01:00
parent 5f9cf28e45
commit b7f38def61

View File

@@ -2700,8 +2700,8 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
dol_syslog("get_localtax tva=".$tva." local=".$local." thirdparty_buyer=".(is_object($thirdparty_buyer)?$thirdparty_buyer->id:'')." thirdparty_seller=".$thirdparty_seller->id);
// Some test to guess with no need to make database access
if ($local == 1 && ! $thirdparty_seller->localtax1_assuj) return 0;
if ($local == 2 && ! $thirdparty_seller->localtax2_assuj) return 0;
if ($local == 1 && (! $thirdparty_seller->localtax1_assuj || ! $thirdparty_buyer->localtax1_assuj)) return 0;
if ($local == 2 && (! $thirdparty_seller->localtax2_assuj || ! $thirdparty_buyer->localtax2_assuj)) return 0;
//if ($local == 0 && ! $thirdparty_seller->localtax1_assuj && ! $thirdparty_seller->localtax2_assuj) return array('localtax1'=>0,'localtax2'=>0);
$code_country=$thirdparty_seller->country_code;