From f551e5852ab7c73e763b25efecbb462070e9ed97 Mon Sep 17 00:00:00 2001
From: Josef Moravec <josef.moravec@gmail.com>
Date: Fri, 6 Oct 2017 08:04:34 +0000
Subject: [PATCH] Bug 14919: Add Koha::Patron->old_holds subroutine

Test plan:
Run t/db_dependent/Koha/Patrons.t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
---
 Koha/Patron.pm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/Koha/Patron.pm b/Koha/Patron.pm
index daa972c85b..a5fa103b59 100644
--- a/Koha/Patron.pm
+++ b/Koha/Patron.pm
@@ -593,6 +593,20 @@ sub holds {
     return Koha::Holds->_new_from_dbic($holds_rs);
 }
 
+=head3 old_holds
+
+my $old_holds = $patron->old_holds
+
+Returnn all the historical holds for this patron
+
+=cut
+
+sub old_holds {
+    my ($self) = @_;
+    my $old_holds_rs = $self->_result->old_reserves->search( {}, { order_by => 'reservedate' } );
+    return Koha::Old::Holds->_new_from_dbic($old_holds_rs);
+}
+
 =head3 first_valid_email_address
 
 =cut
-- 
2.11.0