From 24aee0a27424f23e1427715124105f1bc00810a0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 12 Apr 2023 15:44:56 +0200 Subject: [PATCH 1/3] FIX missing entity field in unique index --- htdocs/install/mysql/migration/15.0.0-16.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_overwrite_trans.key.sql | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index f4b7689d6df..ac8fdab8c97 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -738,6 +738,8 @@ ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0; ALTER TABLE llx_loan_schedule ADD UNIQUE INDEX uk_loan_schedule_ref (fk_loan, datep); +ALTER TABLE llx_overwrite_trans DROP INDEX uk_overwrite_trans; +ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(lang, transkey, entity); -- Bank Thirdparty diff --git a/htdocs/install/mysql/tables/llx_overwrite_trans.key.sql b/htdocs/install/mysql/tables/llx_overwrite_trans.key.sql index 617036e66ee..41493d43f9e 100644 --- a/htdocs/install/mysql/tables/llx_overwrite_trans.key.sql +++ b/htdocs/install/mysql/tables/llx_overwrite_trans.key.sql @@ -17,5 +17,5 @@ -- =========================================================================== -ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(lang, transkey); +ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(lang, transkey, entity); From 0a4d37dbcb3d09b5d524db88772c5ce88eda1d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Tue, 18 Apr 2023 16:49:07 +0200 Subject: [PATCH 2/3] FIX: Use max parameters of widget graph product distribution --- htdocs/core/boxes/box_graph_product_distribution.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 44f94fd48d1..1a1ec5cb311 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -161,7 +161,7 @@ class box_graph_product_distribution extends ModeleBoxes $showpointvalue = 1; $nocolor = 0; $stats_proposal = new PropaleStats($this->db, $socid, ($userid > 0 ? $userid : 0)); - $data2 = $stats_proposal->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), 5); + $data2 = $stats_proposal->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), $max); if (empty($data2)) { $showpointvalue = 0; $nocolor = 1; @@ -224,7 +224,7 @@ class box_graph_product_distribution extends ModeleBoxes $nocolor = 0; $mode = 'customer'; $stats_order = new CommandeStats($this->db, $socid, $mode, ($userid > 0 ? $userid : 0)); - $data3 = $stats_order->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), 5); + $data3 = $stats_order->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), $max); if (empty($data3)) { $showpointvalue = 0; $nocolor = 1; @@ -288,7 +288,7 @@ class box_graph_product_distribution extends ModeleBoxes $nocolor = 0; $mode = 'customer'; $stats_invoice = new FactureStats($this->db, $socid, $mode, ($userid > 0 ? $userid : 0)); - $data1 = $stats_invoice->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), 5); + $data1 = $stats_invoice->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), $max); if (empty($data1)) { $showpointvalue = 0; From a65bbaf109a90d6843a1fad803e4cd1edca524e2 Mon Sep 17 00:00:00 2001 From: Randall Mora <50120822+randallmoraes@users.noreply.github.com> Date: Fri, 21 Apr 2023 08:27:34 -0600 Subject: [PATCH 3/3] Fix getnomurl function Fix the assignment of the period for the execution of the getnomurl function, executing the previous lookup of the period id --- htdocs/accountancy/admin/fiscalyear.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 2eb77815b60..a4020d91e52 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -143,7 +143,7 @@ if ($result) { while ($i < $num && $i < $max) { $obj = $db->fetch_object($result); - $fiscalyearstatic->id = $obj->rowid; + $fiscalyearstatic->fetch($obj->rowid); print ''; print '';