浏览代码

Fix phpunit

Laurent Destailleur 2 年之前
父节点
当前提交
1ac4e6f458

+ 1 - 1
htdocs/comm/propal/card.php

@@ -5,7 +5,7 @@
  * Copyright (C) 2005      Marc Barilley / Ocebo <marc@ocebo.com>
  * Copyright (C) 2005-2012 Regis Houssin         <regis.houssin@inodbox.com>
  * 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) 2012-2013 Christophe Battarel   <christophe.battarel@altairis.fr>
  * Copyright (C) 2012      Cedric Salvador       <csalvador@gpcsolutions.fr>

+ 12 - 0
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 '<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 = 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>';
 				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 '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
 						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 '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
 						if (empty($sommes[$code]['M'][$k])) {

+ 1 - 0
htdocs/core/class/CMailFile.class.php

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

+ 4 - 1
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);

+ 1 - 1
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;

+ 3 - 3
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);
 	}

+ 1 - 1
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);