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

(-)a/C4/Reserves.pm (-6 / +5 lines)
Lines 273-279 See CanItemBeReserved() for possible return values. Link Here
273
=cut
273
=cut
274
274
275
sub CanBookBeReserved{
275
sub CanBookBeReserved{
276
    my ($borrowernumber, $biblionumber, $branchcode) = @_;
276
    my ($borrowernumber, $biblionumber, $pickup_branchcode) = @_;
277
277
278
    my @itemnumbers = Koha::Items->search({ biblionumber => $biblionumber})->get_column("itemnumber");
278
    my @itemnumbers = Koha::Items->search({ biblionumber => $biblionumber})->get_column("itemnumber");
279
    #get items linked via host records
279
    #get items linked via host records
Lines 284-290 sub CanBookBeReserved{ Link Here
284
284
285
    my $canReserve;
285
    my $canReserve;
286
    foreach my $itemnumber (@itemnumbers) {
286
    foreach my $itemnumber (@itemnumbers) {
287
        $canReserve = CanItemBeReserved( $borrowernumber, $itemnumber, $branchcode );
287
        $canReserve = CanItemBeReserved( $borrowernumber, $itemnumber, $pickup_branchcode );
288
        return $canReserve if $canReserve->{status} eq 'OK';
288
        return $canReserve if $canReserve->{status} eq 'OK';
289
    }
289
    }
290
    return $canReserve;
290
    return $canReserve;
Lines 307-313 sub CanBookBeReserved{ Link Here
307
=cut
307
=cut
308
308
309
sub CanItemBeReserved {
309
sub CanItemBeReserved {
310
    my ( $borrowernumber, $itemnumber, $branchcode_to ) = @_;
310
    my ( $borrowernumber, $itemnumber, $pickup_branchcode ) = @_;
311
311
312
    my $dbh = C4::Context->dbh;
312
    my $dbh = C4::Context->dbh;
313
    my $ruleitemtype;    # itemtype of the matching issuing rule
313
    my $ruleitemtype;    # itemtype of the matching issuing rule
Lines 460-468 sub CanItemBeReserved { Link Here
460
        }
460
        }
461
    }
461
    }
462
462
463
    if ($branchcode_to) {
463
    if ($pickup_branchcode) {
464
        my $destination = Koha::Libraries->find({
464
        my $destination = Koha::Libraries->find({
465
            branchcode => $branchcode_to,
465
            branchcode => $pickup_branchcode,
466
        });
466
        });
467
        unless ($destination) {
467
        unless ($destination) {
468
            return { status => 'libraryNotFound' };
468
            return { status => 'libraryNotFound' };
469
- 

Return to bug 7534