Browse Source

Bug 29869: Make ModReserveFill a (temporary) wrapper for Koha::Hold->fill

Before diving into removing ModReserveFill, I propose this:

In order to perform real-life testing of the new Koha::Hold->fill
method, this patch makes the ModReserveFill method, just call the new
one.

To test:
1. Apply this patchset
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Hold* \
           t/db_dependent/Hold* \
           t/db_dependent/api/v1/holds.t \
           t/db_dependent/Reserves* \
           t/db_dependent/Circulation* \
           t/db_dependent/SIP/*
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
22.05.x
Tomás Cohen Arazi 2 years ago
committed by Fridolin Somers
parent
commit
c82b607498
  1. 30
      C4/Reserves.pm

30
C4/Reserves.pm

@ -1122,35 +1122,7 @@ sub ModReserveFill {
my $reserve_id = $res->{'reserve_id'};
my $hold = Koha::Holds->find($reserve_id);
# get the priority on this record....
my $priority = $hold->priority;
# update the hold statuses, no need to store it though, we will be deleting it anyway
$hold->set(
{
found => 'F',
priority => 0,
}
);
logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold )
if C4::Context->preference('HoldsLog');
# FIXME Must call Koha::Hold->cancel ? => No, should call ->filled and add the correct log
Koha::Old::Hold->new( $hold->unblessed() )->store();
$hold->delete();
if ( C4::Context->preference('HoldFeeMode') eq 'any_time_is_collected' ) {
my $reserve_fee = GetReserveFee( $hold->borrowernumber, $hold->biblionumber );
ChargeReserveFee( $hold->borrowernumber, $reserve_fee, $hold->biblio->title );
}
# now fix the priority on the others (if the priority wasn't
# already sorted!)....
unless ( $priority == 0 ) {
_FixPriority( { reserve_id => $reserve_id, biblionumber => $hold->biblionumber } );
}
$hold->fill;
}
=head2 ModReserveStatus

Loading…
Cancel
Save