From c43970f11617c8bb89705adc9e73ee381cc6670e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Feb 2010 14:04:44 +0000 Subject: [PATCH] If VAT intra is defined we use it to know vat amount to use --- htdocs/html.form.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 94b167ec0cd..58fd299dab9 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -2169,7 +2169,15 @@ class Form if (is_object($societe_vendeuse)) { - $code_pays=$societe_vendeuse->pays_code; + if ($societe_vendeuse->isInEEC() && (! empty($societe_vendeuse->tva_intra)) + && preg_match('/^([A-Z][A-Z])/',$societe_vendeuse->tva_intra,$reg)) + { + $code_pays=$reg[1]; + } + else + { + $code_pays=$societe_vendeuse->pays_code; + } } else {