From 231fc6ce707925f9ea5c9156b65287b98b44131d Mon Sep 17 00:00:00 2001 From: Florian Mortgat <50440633+atm-florianm@users.noreply.github.com> Date: Sun, 29 Sep 2024 15:27:24 +0200 Subject: [PATCH 1/3] FIX: if you call fetchLines several times, your $object->lines contains duplicates (#31167) --- htdocs/core/class/commonobject.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 547a6029e40..4182c05dde7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9297,6 +9297,7 @@ abstract class CommonObject if ($resql) { $num_rows = $this->db->num_rows($resql); $i = 0; + $this->lines = array(); while ($i < $num_rows) { $obj = $this->db->fetch_object($resql); if ($obj) { From 74b67eb6c6c1274d6e0a8385b3b3a3a375da4875 Mon Sep 17 00:00:00 2001 From: Florian Mortgat <50440633+atm-florianm@users.noreply.github.com> Date: Sun, 29 Sep 2024 15:57:05 +0200 Subject: [PATCH 2/3] FIX - use price() to display qty on a product's stats tab to avoid showing too many decimals when rounding errors are possible (#31165) --- htdocs/core/lib/product.lib.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index f54f39b20f3..003ab66ad2f 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -363,7 +363,7 @@ function show_stats_for_company($product, $socid) print ''; print $product->stats_propale['nb']; print ''; - print $product->stats_propale['qty']; + print price($product->stats_propale['qty'], 1, $langs, 0, 0); print ''; print ''; } @@ -381,7 +381,7 @@ function show_stats_for_company($product, $socid) print ''; print $product->stats_proposal_supplier['nb']; print ''; - print $product->stats_proposal_supplier['qty']; + print price($product->stats_proposal_supplier['qty'], 1, $langs, 0, 0); print ''; print ''; } @@ -399,7 +399,7 @@ function show_stats_for_company($product, $socid) print ''; print $product->stats_commande['nb']; print ''; - print $product->stats_commande['qty']; + print price($product->stats_commande['qty'], 1, $langs, 0, 0); print ''; print ''; } @@ -417,7 +417,7 @@ function show_stats_for_company($product, $socid) print ''; print $product->stats_commande_fournisseur['nb']; print ''; - print $product->stats_commande_fournisseur['qty']; + print price($product->stats_commande_fournisseur['qty'], 1, $langs, 0, 0); print ''; print ''; } @@ -435,7 +435,7 @@ function show_stats_for_company($product, $socid) print ''; print $product->stats_facture['nb']; print ''; - print $product->stats_facture['qty']; + print price($product->stats_facture['qty'], 1, $langs, 0, 0); print ''; print ''; } @@ -453,7 +453,7 @@ function show_stats_for_company($product, $socid) print ''; print $product->stats_facture_fournisseur['nb']; print ''; - print $product->stats_facture_fournisseur['qty']; + print price($product->stats_facture_fournisseur['qty'], 1, $langs, 0, 0); print ''; print ''; } @@ -472,7 +472,7 @@ function show_stats_for_company($product, $socid) print ''; print $product->stats_contrat['nb']; print ''; - print $product->stats_contrat['qty']; + print price($product->stats_contrat['qty'], 1, $langs, 0, 0); print ''; print ''; } From 385927fe069eace69544fef6fa0d8cb3b2395123 Mon Sep 17 00:00:00 2001 From: Florian Mortgat <50440633+atm-florianm@users.noreply.github.com> Date: Sun, 29 Sep 2024 22:18:18 +0200 Subject: [PATCH 3/3] FIX: box_actions.php still uses fk_user_done which no longer exists (#31190) Co-authored-by: FlorianMortgat <5845502+FlorianMortgat@users.noreply.github.com> --- htdocs/core/boxes/box_actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 64a2314560c..1d2f03b11b5 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -106,7 +106,7 @@ class box_actions extends ModeleBoxes $sql .= " AND s.rowid = ".((int) $user->socid); } if (!$user->rights->agenda->allactions->read) { - $sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id)." OR a.fk_user_done = ".((int) $user->id).")"; + $sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id).")"; } $sql .= " ORDER BY a.datec DESC"; $sql .= $this->db->plimit($max, 0);