Browse Source

Fix PHP 7.2

Laurent Destailleur 7 years ago
parent
commit
f7b663379a

+ 2 - 2
htdocs/compta/bank/releve.php

@@ -223,7 +223,7 @@ if ($action=="dl" && $numref > 0)
                         $payment = new Paiement($db);
                         $payment->fetch($val['url_id']);
                         $arraybill = $payment->getBillsArray();
-                        if (count($arraybill) > 0)
+                        if (is_array($arraybill) && count($arraybill) > 0)
                         {
                             foreach ($arraybill as $billid)
                             {
@@ -260,7 +260,7 @@ if ($action=="dl" && $numref > 0)
                         $payment = new PaiementFourn($db);
                         $payment->fetch($val['url_id']);
                         $arraybill = $payment->getBillsArray();
-                        if (count($arraybill) > 0)
+                        if (is_array($arraybill) && count($arraybill) > 0)
                         {
                             foreach ($arraybill as $billid)
                             {

+ 1 - 1
htdocs/compta/paiement/class/paiement.class.php

@@ -1052,7 +1052,7 @@ class Paiement extends CommonObject
         if ($mode == 'withlistofinvoices')
         {
             $arraybill = $this->getBillsArray();
-            if (count($arraybill) > 0)
+            if (is_array($arraybill) && count($arraybill) > 0)
             {
             	require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
             	$facturestatic=new Facture($this->db);

+ 15 - 9
scripts/bank/export-bank-receipts.php

@@ -262,7 +262,7 @@ if ($resql)
 		$totalbefore = $total;
 		$total = $total + $objp->amount;
 
-		
+
 
 		// Date operation
 		$dateop=$db->jdate($objp->do);
@@ -289,22 +289,28 @@ if ($resql)
 			{
 				$paymentstatic->fetch($links[$key]['url_id']);
 				$tmparray=$paymentstatic->getBillsArray('');
-				foreach($tmparray as $key => $val)
+				if (is_array($tmparray))
 				{
-					$invoicestatic->fetch($val);
-					if ($accountelem) $accountelem.= ', ';
-					$accountelem.=$invoicestatic->ref;
+					foreach($tmparray as $key => $val)
+					{
+						$invoicestatic->fetch($val);
+						if ($accountelem) $accountelem.= ', ';
+						$accountelem.=$invoicestatic->ref;
+					}
 				}
 			}
 			elseif ($links[$key]['type']=='payment_supplier')
 			{
 				$paymentsupplierstatic->fetch($links[$key]['url_id']);
 				$tmparray=$paymentsupplierstatic->getBillsArray('');
-				foreach($tmparray as $key => $val)
+				if (is_array($tmparray))
 				{
-					$invoicesupplierstatic->fetch($val);
-					if ($accountelem) $accountelem.= ', ';
-					$accountelem.=$invoicesupplierstatic->ref;
+					foreach($tmparray as $key => $val)
+					{
+						$invoicesupplierstatic->fetch($val);
+						if ($accountelem) $accountelem.= ', ';
+						$accountelem.=$invoicesupplierstatic->ref;
+					}
 				}
 			}
 			elseif ($links[$key]['type']=='payment_sc')