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 $items = GetItemnumbersForBiblio($biblionumber);
278
    my $items = GetItemnumbersForBiblio($biblionumber);
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 $item (@$items) {
286
    foreach my $item (@$items) {
287
        $canReserve = CanItemBeReserved( $borrowernumber, $item, $branchcode );
287
        $canReserve = CanItemBeReserved( $borrowernumber, $item, $pickup_branchcode );
288
        return 'OK' if $canReserve eq 'OK';
288
        return 'OK' if $canReserve 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 437-445 sub CanItemBeReserved { Link Here
437
        }
437
        }
438
    }
438
    }
439
439
440
    if ($branchcode_to) {
440
    if ($pickup_branchcode) {
441
        my $destination = Koha::Libraries->find({
441
        my $destination = Koha::Libraries->find({
442
            branchcode => $branchcode_to,
442
            branchcode => $pickup_branchcode,
443
        });
443
        });
444
        unless ($destination) {
444
        unless ($destination) {
445
            return 'libraryNotFound';
445
            return 'libraryNotFound';
446
- 

Return to bug 7534