Bug 17678: Use Koha::Checkouts instead of Koha::Issues
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 20 Dec 2016 13:45:33 +0000 (14:45 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 23 Dec 2016 11:46:21 +0000 (11:46 +0000)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/Circulation.pm

index 4325801..6e6f4c1 100644 (file)
@@ -43,6 +43,7 @@ use Koha::Account;
 use Koha::AuthorisedValues;
 use Koha::DateUtils;
 use Koha::Calendar;
+use Koha::Checkouts;
 use Koha::IssuingRules;
 use Koha::Items;
 use Koha::Patrons;
@@ -1066,7 +1067,7 @@ sub CanBookBeIssued {
         require C4::Serials;
         my $is_a_subscription = C4::Serials::CountSubscriptionFromBiblionumber($biblionumber);
         unless ($is_a_subscription) {
-            my $issues = Koha::Issues->search(
+            my $checkouts = Koha::Checkouts->search(
                 {
                     borrowernumber => $borrower->{borrowernumber},
                     biblionumber   => $biblionumber,
@@ -1077,7 +1078,7 @@ sub CanBookBeIssued {
             );
             # if we get here, we don't already have a loan on this item,
             # so if there are any loans on this bib, ask for confirmation
-            if ( $issues->count ) {
+            if ( $checkouts->count ) {
                 $needsconfirmation{BIBLIO_ALREADY_ISSUED} = 1;
             }
         }