From b1ad4d858093d5b59a36e986652a35f6c8bbbca6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Oct 2022 13:40:50 +0200 Subject: [PATCH 1/3] Warning --- htdocs/user/home.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 96ca5428683..c93a22f5cfb 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -224,10 +224,10 @@ if ($canreadperms) { $sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec"; $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g"; - if (isModEnabled('multicompany') && $conf->entity == 1 && ($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ($user->admin && !$user->entity))) { + if (isModEnabled('multicompany') && $conf->entity == 1 && (getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') || ($user->admin && !$user->entity))) { $sql .= " WHERE g.entity IS NOT NULL"; } else { - $sql .= " WHERE g.entity IN (0,".$conf->entity.")"; + $sql .= " WHERE g.entity IN (0, ".$conf->entity.")"; } $sql .= $db->order("g.datec", "DESC"); $sql .= $db->plimit($max); From dfc4543be21076590d4ebfc9afd9c765f0a5f92f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Oct 2022 13:52:14 +0200 Subject: [PATCH 2/3] Fix warning --- htdocs/takepos/index.php | 4 +++- htdocs/ticket/index.php | 4 ++-- htdocs/user/group/list.php | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 2e4edc99da2..c43d0ec092f 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -397,7 +397,9 @@ function LoadProducts(position, issubcat) { function MoreProducts(moreorless) { console.log("MoreProducts"); - if ($('#search_pagination').val() != '') return Search2('', moreorless); + if ($('#search_pagination').val() != '') { + return Search2('', moreorless); + } var maxproduct = ; diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index 0128954989d..243084ec89f 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -109,8 +109,8 @@ if (in_array('DOLUSERCOOKIE_ticket_by_status', $autosetarray)) { } elseif (!empty($_COOKIE['DOLUSERCOOKIE_ticket_by_status'])) { $tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_ticket_by_status'], true); $endyear = $tmparray['year']; - $shownb = $tmparray['shownb']; - $showtot = $tmparray['showtot']; + $shownb = empty($tmparray['shownb']) ? 0 : $tmparray['shownb']; + $showtot = empty($tmparray['showtot']) ? 0 : $tmparray['showtot']; } if (empty($shownb) && empty($showtot)) { $showtot = 1; diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index ab49800a8e4..4c91bd041dd 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -129,7 +129,7 @@ $sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, g.tms as datem $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_rights as ugr ON ugr.fk_usergroup = g.rowid"; -if (isModEnabled('multicompany') && $conf->entity == 1 && ($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ($user->admin && !$user->entity))) { +if (isModEnabled('multicompany') && $conf->entity == 1 && (getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') || ($user->admin && !$user->entity))) { $sql .= " WHERE g.entity IS NOT NULL"; } else { $sql .= " WHERE g.entity IN (0,".$conf->entity.")"; From c0dac5d5dbc88c858e507077f3e771ad64a157ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Oct 2022 22:32:05 +0200 Subject: [PATCH 3/3] Fix RUM number if customer account not defined --- htdocs/compta/prelevement/class/bonprelevement.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index a1dcdba6f58..fd9575dd982 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1709,7 +1709,7 @@ class BonPrelevement extends CommonObject { global $langs; $pre = substr(dol_string_nospecial(dol_string_unaccent($langs->transnoentitiesnoconv('RUM'))), 0, 3); // Must always be on 3 char ('RUM' or 'UMR'. This is a protection against bad translation) - return $pre.'-'.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec); + return $pre.($row_code_client ? '-'.$row_code_client : '').'-'.$row_drum.'-'.date('U', $row_datec); } @@ -1823,8 +1823,8 @@ class BonPrelevement extends CommonObject $Rowing = sprintf("%010d", $row_idfac); // Define value for RUM - // Example: RUMCustomerCode-CustomerBankAccountId-01424448606 (note: Date is date of creation of CustomerBankAccountId) - $Rum = empty($row_rum) ? $this->buildRumNumber($row_code_client, $row_datec, $row_drum) : $row_rum; + // Example: RUM-CustomerCode-CustomerBankAccountId-01424448606 (note: Date is the timestamp of the date of creation of CustomerBankAccountId) + $Rum = (empty($row_rum) ? $this->buildRumNumber($row_code_client, $row_datec, $row_drum) : $row_rum); // Define date of RUM signature $DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d');