diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index d11bf26d7c4..7db437150ca 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1026,7 +1026,7 @@ class Form
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
$sql.= " re.description, re.fk_facture_source";
$sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re";
- $sql.= " WHERE fk_soc = ".$socid;
+ $sql.= " WHERE fk_soc = ".(int) $socid;
if ($filter) $sql.= " AND ".$filter;
$sql.= " ORDER BY re.description ASC";