Fix count on no countable object
This commit is contained in:
parent
40f89d138f
commit
92686100b2
@ -3250,8 +3250,7 @@ if ($action == 'create')
|
||||
print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1);
|
||||
// We check if Origin document (id and type is known) has already at least one invoice attached to it
|
||||
$objectsrc->fetchObjectLinked($originid,$origin,'','facture');
|
||||
$cntinvoice=count($objectsrc->linkedObjects['facture']);
|
||||
if ($cntinvoice>=1)
|
||||
if(!empty($objectsrc->linkedObjects['facture']) && is_array($objectsrc->linkedObjects['facture']))
|
||||
{
|
||||
setEventMessages('WarningBillExist', null, 'warnings');
|
||||
echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user