diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index d70f11106c6..f2c549f91f7 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-2022 Philippe Grand * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012 Cedric Salvador diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 94a957a5c40..ee0ec817918 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -349,6 +349,9 @@ if ($modecompta == 'CREANCES-DETTES') { //var_dump($result); //$r = $AccCat->calculate($result); $r = dol_eval($result, 1, 1, '1'); + if (is_nan($r)) { + $r = 0; + } print ''.price($r).''; } @@ -373,6 +376,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).''; if (empty($sommes[$code]['N'])) { @@ -392,6 +398,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).''; if (empty($sommes[$code]['M'][$k])) { @@ -412,6 +421,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).''; if (empty($sommes[$code]['M'][$k])) { diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index f6611669556..46de8d8e7af 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -65,6 +65,7 @@ class CMailFile public $atleastonefile; + public $msg; public $eol; public $eol2; diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index dfe6f78092c..cf02832606a 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -306,13 +306,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); diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index d26b20219ff..e88d8dd3635 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -150,7 +150,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) // For multicompany if (!empty($out) && isModEnabled('multicompany')) { - $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; diff --git a/htdocs/core/multicompany_page.php b/htdocs/core/multicompany_page.php index 690c971fd23..dbd937a83cd 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); } diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index add084e91ab..09b59d625f3 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -379,7 +379,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);