diff --git a/application/modules/opac/views/scripts/abonne/prets.phtml b/application/modules/opac/views/scripts/abonne/prets.phtml
index 4075e9012f6f4023eb088e67801a6f6a7455a6f4..004813a475cb14c651d9519a8ea8a41668e8eba0 100644
--- a/application/modules/opac/views/scripts/abonne/prets.phtml
+++ b/application/modules/opac/views/scripts/abonne/prets.phtml
@@ -2,6 +2,17 @@
 <div class="abonneTitre"><?php echo $this->fiche['nom_aff'];?></div>
 <?php
 
+$loans = $this->user->getLoansWithOutPNB();
+
+$renewable_loan = [];
+
+foreach ($loans as $loan) {
+  if ($loan->isRenewable())
+    $renewable_loan[] = $loan->getId();
+}
+
+$loans_ids = implode(';', $renewable_loan);
+
 $extend_all = $this->tagAnchor(['action' => 'prolongerPret',
                                  'id_pret' => $loans_ids],
                                 $this->_('Tout prolonger'),
@@ -19,18 +30,8 @@ if ($emprunts = $this->user->getEmprunts()) {
   echo $this->abonne_LoanExport();
 }
 
-$loans = $this->user->getLoansWithOutPNB();
-
 echo $this->abonne_Loans($loans);
 
-$renewable_loan = [];
-foreach ($loans as $loan) {
-  if ($loan->isRenewable())
-    $renewable_loan[] = $loan->getId();
-}
-
-$loans_ids = implode(';', $renewable_loan);
-
 echo $extend_all;
 
 if($this->user->hasPNB()) {