Fix PHP 7.2

This commit is contained in:
Laurent Destailleur 2017-12-10 21:04:59 +01:00
parent 7d553f58f5
commit f7b663379a
3 changed files with 18 additions and 12 deletions

View File

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

View File

@ -1052,7 +1052,7 @@ class Paiement extends CommonObject
if ($mode == 'withlistofinvoices') if ($mode == 'withlistofinvoices')
{ {
$arraybill = $this->getBillsArray(); $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'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic=new Facture($this->db); $facturestatic=new Facture($this->db);

View File

@ -289,6 +289,8 @@ if ($resql)
{ {
$paymentstatic->fetch($links[$key]['url_id']); $paymentstatic->fetch($links[$key]['url_id']);
$tmparray=$paymentstatic->getBillsArray(''); $tmparray=$paymentstatic->getBillsArray('');
if (is_array($tmparray))
{
foreach($tmparray as $key => $val) foreach($tmparray as $key => $val)
{ {
$invoicestatic->fetch($val); $invoicestatic->fetch($val);
@ -296,10 +298,13 @@ if ($resql)
$accountelem.=$invoicestatic->ref; $accountelem.=$invoicestatic->ref;
} }
} }
}
elseif ($links[$key]['type']=='payment_supplier') elseif ($links[$key]['type']=='payment_supplier')
{ {
$paymentsupplierstatic->fetch($links[$key]['url_id']); $paymentsupplierstatic->fetch($links[$key]['url_id']);
$tmparray=$paymentsupplierstatic->getBillsArray(''); $tmparray=$paymentsupplierstatic->getBillsArray('');
if (is_array($tmparray))
{
foreach($tmparray as $key => $val) foreach($tmparray as $key => $val)
{ {
$invoicesupplierstatic->fetch($val); $invoicesupplierstatic->fetch($val);
@ -307,6 +312,7 @@ if ($resql)
$accountelem.=$invoicesupplierstatic->ref; $accountelem.=$invoicesupplierstatic->ref;
} }
} }
}
elseif ($links[$key]['type']=='payment_sc') elseif ($links[$key]['type']=='payment_sc')
{ {
$paymentsocialcontributionstatic->fetch($links[$key]['url_id']); $paymentsocialcontributionstatic->fetch($links[$key]['url_id']);