diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index eb8ac018979..4ee551fe24c 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 @@ -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); diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 540009ebd95..172028a1f76 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -334,6 +334,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']; } @@ -341,8 +344,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).''; @@ -361,6 +367,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; @@ -375,6 +384,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; @@ -389,6 +401,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; @@ -417,8 +432,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 diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 94fb05d5346..278220a0507 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -63,6 +63,7 @@ class CMailFile public $atleastonefile; + public $msg; public $eol; public $eol2; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 4f68d7cc173..221920518c5 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -367,7 +367,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);