From 645b0c563ec176ef0055950e4d56665204d30d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Tue, 14 Mar 2023 11:43:36 +0100 Subject: [PATCH 1/3] FIX: Add more context for selectForFormsListWhere Hook --- htdocs/core/class/html.form.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9c14bfeb866..c4ade09e00f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6782,7 +6782,13 @@ class Form } // Add where from hooks - $parameters = array(); + $parameters = [ + 'object' => $objecttmp, + 'htmlname' => $htmlname, + 'filter' => $filter, + 'searchkey' => $searchkey + ]; + $reshook = $hookmanager->executeHooks('selectForFormsListWhere', $parameters); // Note that $action and $object may have been modified by hook if (!empty($hookmanager->resPrint)) { $sql .= $hookmanager->resPrint; From 926c99f91344bf5efc5e5f50a1cf99e8efafdbd0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Mar 2023 02:35:31 +0100 Subject: [PATCH 2/3] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c4ade09e00f..36754934a0d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6782,12 +6782,12 @@ class Form } // Add where from hooks - $parameters = [ + $parameters = array( 'object' => $objecttmp, 'htmlname' => $htmlname, 'filter' => $filter, 'searchkey' => $searchkey - ]; + ); $reshook = $hookmanager->executeHooks('selectForFormsListWhere', $parameters); // Note that $action and $object may have been modified by hook if (!empty($hookmanager->resPrint)) { From 45b7a911d852f00f6888a45c46e91a422d0a1352 Mon Sep 17 00:00:00 2001 From: Thibault Fiacre <57494317+atm-thibaultf@users.noreply.github.com> Date: Wed, 22 Mar 2023 08:14:58 +0100 Subject: [PATCH 3/3] FIX invoices order on sells journal On sells journal, invoices are ordered by date (datef) but when several invoices have the same date, sometimes they are not ordered by reference. --- htdocs/accountancy/journal/sellsjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 84d4b616ec3..e33a13dad48 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -147,7 +147,7 @@ if ($in_bookkeeping == 'notyet') { $sql .= " AND f.rowid NOT IN (SELECT fk_doc FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')"; // $sql .= " AND fd.rowid NOT IN (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')"; // Useless, we save one line for all products with same account } -$sql .= " ORDER BY f.datef"; +$sql .= " ORDER BY f.datef, f.ref"; //print $sql; exit; dol_syslog('accountancy/journal/sellsjournal.php', LOG_DEBUG);