From f12536f570ca54fe0787e1a363e27d0de6b4a340 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Fri, 26 Oct 2018 15:19:36 -0300
Subject: [PATCH] Bug 21681: Improve the account lines fetch

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
---
 C4/ILSDI/Services.pm | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm
index 53465caa9d..689973ea3e 100644
--- a/C4/ILSDI/Services.pm
+++ b/C4/ILSDI/Services.pm
@@ -425,11 +425,7 @@ sub GetPatronInfo {
 
     # Fines management
     if ( $cgi->param('show_fines') && $cgi->param('show_fines') eq "1" ) {
-
-        my $account_lines = $patron->account->lines;
-        while (my $line = $account_lines->next ) {
-            push @{ $borrower->{fines}{fine} }, $line->unblessed;
-        }
+        $borrower->{fines}{fine} = $patron->account->lines->unblessed;
     }
 
     # Reserves management
-- 
2.19.1