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

(-)a/C4/Reserves.pm (-25 / +5 lines)
Lines 107-113 BEGIN { Link Here
107
      ChargeReserveFee
107
      ChargeReserveFee
108
      GetReserveFee
108
      GetReserveFee
109
109
110
      ModReserveFill
111
      ModReserveAffect
110
      ModReserveAffect
112
      ModReserve
111
      ModReserve
113
      ModReserveStatus
112
      ModReserveStatus
Lines 1093-1118 sub ModReserve { Link Here
1093
    }
1092
    }
1094
}
1093
}
1095
1094
1096
=head2 ModReserveFill
1097
1098
  &ModReserveFill($reserve);
1099
1100
Fill a reserve. If I understand this correctly, this means that the
1101
reserved book has been found and given to the patron who reserved it.
1102
1103
C<$reserve> specifies the reserve to fill. It is a reference-to-hash
1104
whose keys are fields from the reserves table in the Koha database.
1105
1106
=cut
1107
1108
sub ModReserveFill {
1109
    my ($res) = @_;
1110
    my $reserve_id = $res->{'reserve_id'};
1111
1112
    my $hold = Koha::Holds->find($reserve_id);
1113
    $hold->fill;
1114
}
1115
1116
=head2 ModReserveStatus
1095
=head2 ModReserveStatus
1117
1096
1118
  &ModReserveStatus($itemnumber, $newstatus);
1097
  &ModReserveStatus($itemnumber, $newstatus);
Lines 1795-1801 sub _Findgroupreserve { Link Here
1795
  _koha_notify_reserve( $hold->reserve_id );
1774
  _koha_notify_reserve( $hold->reserve_id );
1796
1775
1797
Sends a notification to the patron that their hold has been filled (through
1776
Sends a notification to the patron that their hold has been filled (through
1798
ModReserveAffect, _not_ ModReserveFill)
1777
ModReserveAffect)
1799
1778
1800
The letter code for this notice may be found using the following query:
1779
The letter code for this notice may be found using the following query:
1801
1780
Lines 1956-1965 sub MoveReserve { Link Here
1956
    my ( $restype, $res, undef ) = CheckReserves( $itemnumber, undef, $lookahead );
1935
    my ( $restype, $res, undef ) = CheckReserves( $itemnumber, undef, $lookahead );
1957
    return unless $res;
1936
    return unless $res;
1958
1937
1959
    my $biblionumber     =  $res->{biblionumber};
1938
    my $biblionumber = $res->{biblionumber};
1960
1939
1961
    if ($res->{borrowernumber} == $borrowernumber) {
1940
    if ($res->{borrowernumber} == $borrowernumber) {
1962
        ModReserveFill($res);
1941
        my $hold = Koha::Holds->find( $res->{reserve_id} );
1942
        $hold->fill;
1963
    }
1943
    }
1964
    else {
1944
    else {
1965
        # warn "Reserved";
1945
        # warn "Reserved";
Lines 1975-1981 sub MoveReserve { Link Here
1975
1955
1976
        if ( $borr_res ) {
1956
        if ( $borr_res ) {
1977
            # The item is reserved by the current patron
1957
            # The item is reserved by the current patron
1978
            ModReserveFill($borr_res->unblessed);
1958
            $borr_res->fill;
1979
        }
1959
        }
1980
1960
1981
        if ( $cancelreserve eq 'revert' ) { ## Revert waiting reserve to priority 1
1961
        if ( $cancelreserve eq 'revert' ) { ## Revert waiting reserve to priority 1
(-)a/C4/SIP/ILS/Item.pm (-2 / +6 lines)
Lines 21-27 use C4::Circulation qw( barcodedecode ); Link Here
21
use C4::Context;
21
use C4::Context;
22
use C4::Items;
22
use C4::Items;
23
use C4::Members;
23
use C4::Members;
24
use C4::Reserves qw( ModReserveFill );
25
use Koha::Biblios;
24
use Koha::Biblios;
26
use Koha::Checkouts::ReturnClaims;
25
use Koha::Checkouts::ReturnClaims;
27
use Koha::Checkouts;
26
use Koha::Checkouts;
Lines 404-416 sub barcode_is_borrowernumber { # because hold_queue only has borrowernumber. Link Here
404
    return unless $converted;
403
    return unless $converted;
405
    return ($number == $converted);
404
    return ($number == $converted);
406
}
405
}
406
# FIXME: This methods is very likely not used. It's only reference in the codebase
407
#        is itself. I'm 'fixing' it so we can remove ModReserveFill. But filing a bug
408
#        for properly removing it.
407
sub fill_reserve {
409
sub fill_reserve {
408
    my $self = shift;
410
    my $self = shift;
409
    my $hold = shift or return;
411
    my $hold = shift or return;
410
    foreach (qw(biblionumber borrowernumber reservedate)) {
412
    foreach (qw(biblionumber borrowernumber reservedate)) {
411
        $hold->{$_} or return;
413
        $hold->{$_} or return;
412
    }
414
    }
413
    return ModReserveFill($hold);
415
416
    my $hold_obj = Koha::Holds->find( $hold->id );
417
    return $hold_obj->fill;
414
}
418
}
415
419
416
=head2 build_additional_item_fields_string
420
=head2 build_additional_item_fields_string
(-)a/C4/SIP/ILS/Transaction/Checkout.pm (-2 lines)
Lines 17-23 use C4::SIP::ILS::Transaction; Link Here
17
use C4::Context;
17
use C4::Context;
18
use C4::Circulation qw( AddIssue GetIssuingCharges CanBookBeIssued );
18
use C4::Circulation qw( AddIssue GetIssuingCharges CanBookBeIssued );
19
use C4::Members;
19
use C4::Members;
20
use C4::Reserves qw(ModReserveFill);
21
use Koha::DateUtils;
20
use Koha::DateUtils;
22
21
23
use parent qw(C4::SIP::ILS::Transaction);
22
use parent qw(C4::SIP::ILS::Transaction);
24
- 

Return to bug 29869