From 670ae506e3f940ee42d21f1e51f86adb0c038945 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Wed, 15 Feb 2023 10:47:25 +0100 Subject: [PATCH 1/5] Fix: Bad assignation for external users access --- htdocs/comm/propal/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3a037d4b4a2..b36415f5b15 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2016 Juanjo Menent + * Copyright (C) 2010-2023 Juanjo Menent * Copyright (C) 2010-2021 Philippe Grand * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012 Cedric Salvador @@ -131,7 +131,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 f24ffe5b91da2b2a3187cf4a98a8ad4ac41645b6 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 16 Feb 2023 10:20:37 +0100 Subject: [PATCH 2/5] Supplier proposal - List - SQL error on total_ht --- htdocs/supplier_proposal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index ba68fb82a77..c179b44146e 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -344,7 +344,7 @@ if ($search_login) { $sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_login); } if ($search_montant_ht) { - $sql .= natural_search('sp.total_ht=', $search_montant_ht, 1); + $sql .= natural_search('sp.total_ht', $search_montant_ht, 1); } if ($search_montant_vat != '') { $sql .= natural_search("sp.total_tva", $search_montant_vat, 1); From 9e1b8bcd4ca7aa6e53730a9e9147a2ae6cc2e004 Mon Sep 17 00:00:00 2001 From: GregM Date: Thu, 16 Feb 2023 11:33:43 +0100 Subject: [PATCH 3/5] FIX parse error and NAN --- htdocs/compta/resultat/result.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index bf7eee28609..4d2aa61673f 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -333,6 +333,9 @@ if ($modecompta == 'CREANCES-DETTES') { // Previous Fiscal year (N-1) foreach ($sommes as $code => $det) { + if (is_null($det['NP'])){ + $det['NP'] = 0; + } $vars[$code] = $det['NP']; } @@ -340,8 +343,11 @@ if ($modecompta == 'CREANCES-DETTES') { //var_dump($result); //$r = $AccCat->calculate($result); + $r = dol_eval($result, 1, 1, '1'); - //var_dump($r); + if (is_nan($r)){ + $r = 0; + } print ''.price($r).''; @@ -360,6 +366,9 @@ if ($modecompta == 'CREANCES-DETTES') { //$r = $AccCat->calculate($result); $r = dol_eval($result, 1, 1, 1); + if (is_nan($r)){ + $r = 0; + } print ''.price($r).''; $sommes[$code]['N'] += $r; @@ -374,6 +383,9 @@ if ($modecompta == 'CREANCES-DETTES') { //$r = $AccCat->calculate($result); $r = dol_eval($result, 1, 1, 1); + if (is_nan($r)){ + $r = 0; + } print ''.price($r).''; $sommes[$code]['M'][$k] += $r; @@ -388,6 +400,9 @@ if ($modecompta == 'CREANCES-DETTES') { //$r = $AccCat->calculate($result); $r = dol_eval($result, 1, 1, 1); + if (is_nan($r)){ + $r = 0; + } print ''.price($r).''; $sommes[$code]['M'][$k] += $r; @@ -416,8 +431,10 @@ if ($modecompta == 'CREANCES-DETTES') { $arrayofaccountforfilter = array(); - foreach ($cpts as $i => $cpt) { // Loop on each account. - $arrayofaccountforfilter[] = $cpt['account_number']; + foreach ($cpts as $i => $cpt) {// Loop on each account. + if (!empty($cpt['account_number'])){ + $arrayofaccountforfilter[] = $cpt['account_number']; + } } // N-1 From 390e7c83b2ae12861b3c43d90da8c8b97174e0a9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 16 Feb 2023 10:48:41 +0000 Subject: [PATCH 4/5] Fixing style errors. --- htdocs/compta/resultat/result.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 4d2aa61673f..1a31c3d7eb1 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -333,7 +333,7 @@ if ($modecompta == 'CREANCES-DETTES') { // Previous Fiscal year (N-1) foreach ($sommes as $code => $det) { - if (is_null($det['NP'])){ + if (is_null($det['NP'])) { $det['NP'] = 0; } $vars[$code] = $det['NP']; @@ -345,7 +345,7 @@ if ($modecompta == 'CREANCES-DETTES') { //$r = $AccCat->calculate($result); $r = dol_eval($result, 1, 1, '1'); - if (is_nan($r)){ + if (is_nan($r)) { $r = 0; } @@ -366,7 +366,7 @@ if ($modecompta == 'CREANCES-DETTES') { //$r = $AccCat->calculate($result); $r = dol_eval($result, 1, 1, 1); - if (is_nan($r)){ + if (is_nan($r)) { $r = 0; } @@ -383,7 +383,7 @@ if ($modecompta == 'CREANCES-DETTES') { //$r = $AccCat->calculate($result); $r = dol_eval($result, 1, 1, 1); - if (is_nan($r)){ + if (is_nan($r)) { $r = 0; } @@ -400,7 +400,7 @@ if ($modecompta == 'CREANCES-DETTES') { //$r = $AccCat->calculate($result); $r = dol_eval($result, 1, 1, 1); - if (is_nan($r)){ + if (is_nan($r)) { $r = 0; } @@ -432,7 +432,7 @@ if ($modecompta == 'CREANCES-DETTES') { $arrayofaccountforfilter = array(); foreach ($cpts as $i => $cpt) {// Loop on each account. - if (!empty($cpt['account_number'])){ + if (!empty($cpt['account_number'])) { $arrayofaccountforfilter[] = $cpt['account_number']; } } From bf9a44ac6faab0ef0abeda1d329011c14236b0fe Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 16 Feb 2023 21:48:55 +0100 Subject: [PATCH 5/5] msg is not defined --- htdocs/core/class/CMailFile.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 67c3387fbc8..f16bfb856b1 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -60,6 +60,7 @@ class CMailFile public $atleastonefile; + public $msg; public $eol; public $eol2;