Fix phpunit

This commit is contained in:
Laurent Destailleur 2023-02-17 16:52:00 +01:00
commit 1ac4e6f458
7 changed files with 23 additions and 7 deletions

View File

@ -5,7 +5,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2023 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2022 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2010-2022 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>

View File

@ -349,6 +349,9 @@ if ($modecompta == 'CREANCES-DETTES') {
//var_dump($result); //var_dump($result);
//$r = $AccCat->calculate($result); //$r = $AccCat->calculate($result);
$r = dol_eval($result, 1, 1, '1'); $r = dol_eval($result, 1, 1, '1');
if (is_nan($r)) {
$r = 0;
}
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>'; print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
} }
@ -373,6 +376,9 @@ if ($modecompta == 'CREANCES-DETTES') {
//$r = $AccCat->calculate($result); //$r = $AccCat->calculate($result);
$r = dol_eval($result, 1, 1, '1'); $r = dol_eval($result, 1, 1, '1');
if (is_nan($r)) {
$r = 0;
}
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>'; print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
if (empty($sommes[$code]['N'])) { if (empty($sommes[$code]['N'])) {
@ -392,6 +398,9 @@ if ($modecompta == 'CREANCES-DETTES') {
//$r = $AccCat->calculate($result); //$r = $AccCat->calculate($result);
$r = dol_eval($result, 1, 1, '1'); $r = dol_eval($result, 1, 1, '1');
if (is_nan($r)) {
$r = 0;
}
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>'; print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
if (empty($sommes[$code]['M'][$k])) { if (empty($sommes[$code]['M'][$k])) {
@ -412,6 +421,9 @@ if ($modecompta == 'CREANCES-DETTES') {
//$r = $AccCat->calculate($result); //$r = $AccCat->calculate($result);
$r = dol_eval($result, 1, 1, '1'); $r = dol_eval($result, 1, 1, '1');
if (is_nan($r)) {
$r = 0;
}
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>'; print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
if (empty($sommes[$code]['M'][$k])) { if (empty($sommes[$code]['M'][$k])) {

View File

@ -65,6 +65,7 @@ class CMailFile
public $atleastonefile; public $atleastonefile;
public $msg;
public $eol; public $eol;
public $eol2; public $eol2;

View File

@ -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($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"; $sql .= ", sum(".$db->ifsql("f.date_lim_reglement > '".date_format($datenowadd30, 'Y-m-d')."'", 1, 0).") as nbnotlate30";
if ($mode == 'customers') { if ($mode == 'customers') {
$element = 'invoice';
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
} elseif ($mode == 'fourn' || $mode == 'suppliers') { } elseif ($mode == 'fourn' || $mode == 'suppliers') {
$element = 'supplier_invoice';
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
} else { } else {
return ''; return '';
} }
$sql .= " WHERE f.type <> 2"; $sql .= " WHERE f.entity IN (".getEntity($element).")";
$sql .= " AND f.type <> 2";
$sql .= " AND f.fk_statut = 1"; $sql .= " AND f.fk_statut = 1";
if (isset($user->socid) && $user->socid > 0) { if (isset($user->socid) && $user->socid > 0) {
$sql .= " AND f.fk_soc = ".((int) $user->socid); $sql .= " AND f.fk_soc = ".((int) $user->socid);

View File

@ -150,7 +150,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1)
// For multicompany // For multicompany
if (!empty($out) && isModEnabled('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; return $out;

View File

@ -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 * \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'; require_once '../main.inc.php';
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ');
$entityid = GETPOST('entity', 'int'); $entityid = GETPOST('entity', 'int');
$backtourl = GETPOST('backtourl'); $backtourl = GETPOST('backtourl');
if (empty($backtourl)) { if (empty($backtourl)) {
@ -63,7 +63,7 @@ $left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
* Actions * Actions
*/ */
if (GETPOST('acction', 'aZ') == 'switchentity') { if ($action == 'switchentity') {
if (is_object($mc)) { if (is_object($mc)) {
$mc->switchEntity($entityid); $mc->switchEntity($entityid);
} }

View File

@ -379,7 +379,7 @@ if ($search_login) {
$sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_login); $sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_login);
} }
if ($search_montant_ht) { 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 != '') { if ($search_montant_vat != '') {
$sql .= natural_search("sp.total_tva", $search_montant_vat, 1); $sql .= natural_search("sp.total_tva", $search_montant_vat, 1);