View | Details | Raw Unified | Return to bug 16870
Collapse All | Expand All

(-)a/Koha/Patron.pm (-9 / +8 lines)
Lines 24-30 use Carp; Link Here
24
24
25
use C4::Context;
25
use C4::Context;
26
use Koha::Database;
26
use Koha::Database;
27
use Koha::Issues;
27
use Koha::Checkouts;
28
use Koha::OldIssues;
28
use Koha::OldIssues;
29
use Koha::Patron::Categories;
29
use Koha::Patron::Categories;
30
use Koha::Patron::Images;
30
use Koha::Patron::Images;
Lines 153-171 sub do_check_for_previous_checkout { Link Here
153
        push @item_nos, $item->itemnumber;
153
        push @item_nos, $item->itemnumber;
154
    }
154
    }
155
155
156
    # Create (old)issues search criteria
156
    # Create (old)checkouts search criteria
157
    my $criteria = {
157
    my $criteria = {
158
        borrowernumber => $self->borrowernumber,
158
        borrowernumber => $self->borrowernumber,
159
        itemnumber => \@item_nos,
159
        itemnumber => \@item_nos,
160
    };
160
    };
161
161
162
    # Check current issues table
162
    # Check current checkouts table
163
    my $issues = Koha::Issues->search($criteria);
163
    my $checkouts = Koha::Checkouts->search($criteria);
164
    return 1 if $issues->count; # 0 || N
164
    return 1 if $checkouts->count; # 0 || N
165
165
166
    # Check old issues table
166
    # Check old checkouts table
167
    my $old_issues = Koha::OldIssues->search($criteria);
167
    my $old_checkouts = Koha::OldIssues->search($criteria);
168
    return $old_issues->count;  # 0 || N
168
    return $old_checkouts->count;  # 0 || N
169
}
169
}
170
170
171
=head3 type
171
=head3 type
172
- 

Return to bug 16870