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

(-)a/C4/ILSDI/Services.pm (-3 / +16 lines)
Lines 570-575 sub RenewLoan { Link Here
570
    return $out;
570
    return $out;
571
}
571
}
572
572
573
sub _get_reserve_next_rank {
574
    my ($biblionumber) = @_;
575
576
    my ( $count, $reserves ) = GetReservesFromBiblionumber($biblionumber,1);
577
    foreach my $res (@$reserves) {
578
        $count-- if (defined $res->{found} and $res->{found} eq 'W');
579
    }
580
    my $rank = $count + 1;
581
582
    return $rank;
583
}
584
573
=head2 HoldTitle
585
=head2 HoldTitle
574
586
575
Creates, for a borrower, a biblio-level hold reserve.
587
Creates, for a borrower, a biblio-level hold reserve.
Lines 620-628 sub HoldTitle { Link Here
620
        $branch = $$borrower{branchcode};
632
        $branch = $$borrower{branchcode};
621
    }
633
    }
622
634
635
    my $rank = _get_reserve_next_rank($biblionumber);
636
623
    # Add the reserve
637
    # Add the reserve
624
    #          $branch, $borrowernumber, $biblionumber, $constraint, $bibitems,  $priority, $notes, $title, $checkitem,  $found
638
    #          $branch, $borrowernumber, $biblionumber, $constraint, $bibitems,  $priority, $notes, $title, $checkitem,  $found
625
    AddReserve( $branch, $borrowernumber, $biblionumber, 'a', undef, 0, undef, $title, undef, undef );
639
    AddReserve( $branch, $borrowernumber, $biblionumber, 'a', undef, $rank, undef, $title, undef, undef );
626
640
627
    # Hashref building
641
    # Hashref building
628
    my $out;
642
    my $out;
Lines 695-701 sub HoldItem { Link Here
695
        $branch = $$borrower{branchcode};
709
        $branch = $$borrower{branchcode};
696
    }
710
    }
697
711
698
    my $rank;
712
    my $rank = _get_reserve_next_rank($biblionumber);
699
    my $found;
713
    my $found;
700
714
701
    # Get rank and found
715
    # Get rank and found
702
- 

Return to bug 8918