diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index 14bb45f0687..c70416fec6e 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -71,9 +71,9 @@ foreach ($linkedObjectBlock as $key => $objectlink) { print ''.$objectlink->ref_client.''; print ''.dol_print_date($objectlink->date, 'day').''; print ''; - if ($user->rights->facture->lire) { + if (!empty($objectlink) && $objectlink->element == 'facture' && $user->hasRight('facture', 'lire')) { $sign = 1; - if ($object->type == Facture::TYPE_CREDIT_NOTE) { + if ($objectlink->type == Facture::TYPE_CREDIT_NOTE) { $sign = -1; } if ($objectlink->statut != 3) { diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index b5dec9cbbe0..979782e61a5 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -217,7 +217,7 @@ class mailing_thirdparties_services_expired extends MailingTargets { global $langs; - $s .= ''; if (count($this->arrayofproducts)) { $s .= ''; } else { @@ -228,6 +228,7 @@ class mailing_thirdparties_services_expired extends MailingTargets } $s .= ''; $s .= ajax_combobox("filter_services_expired"); + return $s; }