From 2e7371eee649798adbab3d73dcbb54773ba73bde Mon Sep 17 00:00:00 2001 From: Guenter Lukas Date: Mon, 6 Feb 2023 08:45:44 +0100 Subject: [PATCH 1/4] Fix #23795 --- htdocs/comm/propal/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index eb8ac018979..c702cf66434 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -132,7 +132,6 @@ $permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown // Security check if (!empty($user->socid)) { $socid = $user->socid; - $object->id = $user->socid; } restrictedArea($user, 'propal', $object->id); From 89a2f7a0c10054de042ec5fe33be3a4004c67c5a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 14 Feb 2023 10:53:59 +0100 Subject: [PATCH 2/4] FIX multicompany compatibility --- htdocs/core/lib/signature.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index c59acbea209..600f3878a0a 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -120,7 +120,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) // For multicompany if (!empty($out) && !empty($conf->multicompany->enabled)) { - $out .= "&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities + $out .= "&entity=".$object->entity; // Check the entity because we may have the same reference in several entities } return $out; From 7653a7126b0280982664922ed1002284f1d8831a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 15 Feb 2023 13:47:55 +0100 Subject: [PATCH 3/4] FIX wrong url param name action --- htdocs/core/multicompany_page.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/multicompany_page.php b/htdocs/core/multicompany_page.php index 4a3bcba51fb..1161b7f07c9 100644 --- a/htdocs/core/multicompany_page.php +++ b/htdocs/core/multicompany_page.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/multicompany_page.php + * \file htdocs/core/multicompany_page.php * \brief File to return a page with the list of all entities user can switch to */ @@ -41,7 +41,7 @@ if (!defined('NOREQUIREMENU')) { require_once '../main.inc.php'; -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'aZ'); $entityid = GETPOST('entity', 'int'); $backtourl = GETPOST('backtourl'); if (empty($backtourl)) { @@ -63,7 +63,7 @@ $left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left'); * Actions */ -if (GETPOST('acction', 'aZ') == 'switchentity') { +if ($action == 'switchentity') { if (is_object($mc)) { $mc->switchEntity($entityid); } From 33e345a280ea993804ca0532776a547df6667d5a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 16 Feb 2023 15:51:55 +0100 Subject: [PATCH 4/4] FIX missing getEntity filter --- htdocs/core/lib/invoice.lib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 43e4879e62f..b532b9db108 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -281,13 +281,16 @@ function getNumberInvoicesPieChart($mode) $sql .= ", sum(".$db->ifsql("f.date_lim_reglement > '".date_format($datenowadd15, 'Y-m-d')."'", 1, 0).") as nbnotlate15"; $sql .= ", sum(".$db->ifsql("f.date_lim_reglement > '".date_format($datenowadd30, 'Y-m-d')."'", 1, 0).") as nbnotlate30"; if ($mode == 'customers') { + $element = 'invoice'; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; } elseif ($mode == 'fourn' || $mode == 'suppliers') { + $element = 'supplier_invoice'; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; } else { return ''; } - $sql .= " WHERE f.type <> 2"; + $sql .= " WHERE f.entity IN (".getEntity($element).")"; + $sql .= " AND f.type <> 2"; $sql .= " AND f.fk_statut = 1"; if (isset($user->socid) && $user->socid > 0) { $sql .= " AND f.fk_soc = ".((int) $user->socid);