From 47af73d891d84a7750ea87165758fc0e4b36a61a Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Tue, 11 Mar 2025 17:19:09 +0100 Subject: [PATCH 1/2] FIX #33404 - to keep the method findNearest an agnostic method. --- htdocs/emailcollector/class/emailcollector.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index d1af564f527..1f30afa96c5 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -2612,6 +2612,7 @@ class EmailCollector extends CommonObject // Search into contacts of thirdparties to try to guess the thirdparty to use $resultContact = $contactstatic->findNearest(0, '', '', '', $emailtouseforthirdparty, '', 0); if ($resultContact > 0) { + $contactstatic->fetch($resultContact); $idtouseforthirdparty = $contactstatic->socid; $result = $thirdpartystatic->fetch($idtouseforthirdparty); if ($result > 0) { From 98a0dfa1b05a74a7c68e7836c908eef9b218f7f9 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Tue, 11 Mar 2025 17:25:18 +0100 Subject: [PATCH 2/2] FIX shipment dispatch origin line (#33415) --- htdocs/expedition/dispatch.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php index cef0e7f1deb..73aabfce094 100644 --- a/htdocs/expedition/dispatch.php +++ b/htdocs/expedition/dispatch.php @@ -780,8 +780,8 @@ if ($object->id > 0 || !empty($object->ref)) { $sql .= ", eb.batch, eb.eatby, eb.sellby"; $sql .= " FROM ".$db->prefix()."expeditiondet as ed"; $sql .= " LEFT JOIN ".$db->prefix()."expeditiondet_batch as eb on ed.rowid = eb.fk_expeditiondet"; - $sql .= " INNER JOIN ".$db->prefix()."commandedet as cd on ed.fk_origin_line = cd.rowid"; - $sql .= " WHERE ed.fk_origin_line = ".(int) $objp->rowid; + $sql .= " INNER JOIN ".$db->prefix()."commandedet as cd on ed.fk_elementdet = cd.rowid"; + $sql .= " WHERE ed.fk_elementdet = ".(int) $objp->rowid; $sql .= " AND ed.fk_expedition = ".(int) $object->id; $sql .= " ORDER BY ed.rowid, ed.fk_elementdet"; @@ -938,6 +938,10 @@ if ($object->id > 0 || !empty($object->ref)) { $numline++; } $suffix = "_".$j."_".$i; + } else { + $errorMsg = 'Shipment dispatch SQL error : '.$db->lasterror(); + setEventMessage($errorMsg, 'errors'); + dol_syslog($errorMsg, LOG_ERR); } if ($j == 0) {