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
{