This commit is contained in:
Laurent Destailleur 2016-11-22 19:45:06 +01:00
parent 1c17335d34
commit f9f1f92d86

View File

@ -2288,10 +2288,10 @@ class CommandeFournisseur extends CommonOrder
// Clean vat code
$vat_src_code='';
if (preg_match('/\((.*)\)/', $vatrate, $reg))
if (preg_match('/\((.*)\)/', $txtva, $reg))
{
$vat_src_code = $reg[1];
$vatrate = preg_replace('/\s*\(.*\)/', '', $vatrate); // Remove code into vatrate.
$vatrate = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
}
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $this->thirdparty, $localtaxes_type, 100, $this->multicurrency_tx);