diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 11955d4ae4f..a1a98199a4c 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -79,7 +79,7 @@ if ($action == 'add') { $sql = "SELECT fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."user_param"; $sql .= " WHERE param = 'MAIN_BOXES_".$db->escape($pos)."' AND value = '1'"; - $sql .= " AND entity = ".$conf->entity; + $sql .= " AND entity = ".((int) $conf->entity); dol_syslog("boxes.php search fk_user to activate box for", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 45d89b59854..c20aa54c826 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -233,7 +233,8 @@ if ($socid > 0) { print '
'; - $sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client,"; + // TODO Remove the DISTINCT + $sql = "SELECT DISTINCT s.nom, s.rowid as socid, s.code_client,"; $sql .= " f.rowid as facid, f.ref, f.total_ht,"; $sql .= " f.datef, f.paye, f.fk_statut as statut, f.type,"; $sql .= " sum(d.total_ht) as selling_price,"; // may be negative or positive