From f40c8ce5075047ef15f03791e32071542bf33bb6 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 11 Mar 2020 17:58:41 +0100 Subject: [PATCH 1/3] fix getentity on comm/card.php --- htdocs/comm/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index d31ed9cb080..fcd3823b0c2 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -751,7 +751,7 @@ if ($object->id > 0) $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; $sql .= " WHERE c.fk_soc = s.rowid "; $sql .= " AND s.rowid = ".$object->id; - $sql .= " AND c.entity = ".$conf->entity; + $sql .= " AND c.entity IN (".getEntity('commande').')'; $sql .= " ORDER BY c.date_commande DESC"; $resql = $db->query($sql); @@ -905,7 +905,7 @@ if ($object->id > 0) $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; $sql .= " WHERE c.fk_soc = s.rowid "; $sql .= " AND s.rowid = ".$object->id; - $sql .= " AND c.entity = ".$conf->entity; + $sql .= " AND c.entity IN (".getEntity('contract').")"; $sql .= " ORDER BY c.datec DESC"; $resql = $db->query($sql); @@ -975,7 +975,7 @@ if ($object->id > 0) $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f"; $sql .= " WHERE f.fk_soc = s.rowid"; $sql .= " AND s.rowid = ".$object->id; - $sql .= " AND f.entity = ".$conf->entity; + $sql .= " AND f.entity IN (".getEntity('intervention').")"; $sql .= " ORDER BY f.tms DESC"; $resql = $db->query($sql); @@ -1044,7 +1044,7 @@ if ($object->id > 0) $sql .= ', s.nom, s.rowid as socid'; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f"; $sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$object->id; - $sql .= " AND f.entity = ".$conf->entity; + $sql .= " AND f.entity IN (".getEntity('invoice').")"; $sql .= ' GROUP BY f.rowid, f.titre, f.amount, f.total, f.tva, f.total_ttc,'; $sql .= ' f.date_last_gen, f.datec, f.frequency, f.unit_frequency,'; $sql .= ' f.suspended, f.date_when,'; From 6edaa7ac1162aa988d5023a439cde6d7b09b1990 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 11 Mar 2020 18:00:35 +0100 Subject: [PATCH 2/3] fix getentity on comm/card.php --- htdocs/comm/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index fcd3823b0c2..969d7142139 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -836,7 +836,7 @@ if ($object->id > 0) $sql .= ', s.rowid as socid'; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."expedition as e"; $sql .= " WHERE e.fk_soc = s.rowid AND s.rowid = ".$object->id; - $sql .= " AND e.entity IN (".getEntity('expedition').")"; + $sql .= " AND e.entity IN (".getEntity('commande').")"; $sql .= ' GROUP BY e.rowid'; $sql .= ', e.ref'; $sql .= ', e.date_creation'; From ca269864f723fd2e15e98654967fd01210f015c3 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 13 Mar 2020 14:55:34 +0100 Subject: [PATCH 3/3] let keep it to expedition --- htdocs/comm/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 969d7142139..fcd3823b0c2 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -836,7 +836,7 @@ if ($object->id > 0) $sql .= ', s.rowid as socid'; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."expedition as e"; $sql .= " WHERE e.fk_soc = s.rowid AND s.rowid = ".$object->id; - $sql .= " AND e.entity IN (".getEntity('commande').")"; + $sql .= " AND e.entity IN (".getEntity('expedition').")"; $sql .= ' GROUP BY e.rowid'; $sql .= ', e.ref'; $sql .= ', e.date_creation';