diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 062b8992e93..54ff2adf317 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -3194,6 +3194,7 @@ function get_default_npr($societe_vendeuse, $societe_acheteuse, $idprod) /** * Function that return localtax of a product line (according to seller, buyer and product vat rate) + * * @param societe_vendeuse Objet societe vendeuse * @param societe_acheteuse Objet societe acheteuse * @param local Localtax to process (1 or 2) @@ -3205,7 +3206,7 @@ function get_default_localtax($societe_vendeuse, $societe_acheteuse, $local, $id if (!is_object($societe_vendeuse)) return -1; if (!is_object($societe_acheteuse)) return -1; - if($societe_vendeuse->pays_id=='ES') + if ($societe_vendeuse->pays_id=='ES' || $societe_vendeuse->pays_code=='ES') { if ($local==1) //RE { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c71a286631c..1ccdaf0a0fb 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -477,7 +477,7 @@ class Societe extends CommonObject $sql.= ",ville = ".($this->town?"'".$this->db->escape($this->town)."'":"null"); $sql .= ",fk_departement = '" . ($this->state_id?$this->state_id:'0') ."'"; - $sql .= ",fk_pays = '" . ($this->pays_id?$this->pays_id:'0') ."'"; + $sql .= ",fk_pays = '" . ($this->country_id?$this->country_id:'0') ."'"; $sql .= ",tel = ".($this->tel?"'".$this->db->escape($this->tel)."'":"null"); $sql .= ",fax = ".($this->fax?"'".$this->db->escape($this->fax)."'":"null");