Bugzilla – Attachment 65640 Details for
Bug 19059
Move C4::Reserves::CancelReserve to the Koha::Hold->cancel
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 19059: Remove CancelReserve
SIGNED-OFF-Bug-19059-Remove-CancelReserve.patch (text/plain), 2.52 KB, created by
Owen Leonard
on 2017-08-08 14:00:50 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 19059: Remove CancelReserve
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2017-08-08 14:00:50 UTC
Size:
2.52 KB
patch
obsolete
>From 55459d7a149a9a7e2ccfba8e0e3d8eb46818b071 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 7 Aug 2017 15:13:17 -0300 >Subject: [PATCH] [SIGNED-OFF] Bug 19059: Remove CancelReserve > >It's done! > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > C4/Reserves.pm | 61 ---------------------------------------------------------- > 1 file changed, 61 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 697dd66..079fb39 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -837,67 +837,6 @@ sub AutoUnsuspendReserves { > map { $_->suspend(0)->suspend_until(undef)->store() } @holds; > } > >-=head2 CancelReserve >- >- CancelReserve({ reserve_id => $reserve_id, [ biblionumber => $biblionumber, borrowernumber => $borrrowernumber, itemnumber => $itemnumber, ] [ charge_cancel_fee => 1 ] }); >- >-Cancels a reserve. If C<charge_cancel_fee> is passed and the C<ExpireReservesMaxPickUpDelayCharge> syspref is set, charge that fee to the patron's account. >- >-=cut >- >-sub CancelReserve { >- my ( $params ) = @_; >- >- my $reserve_id = $params->{'reserve_id'}; >- my $hold; >- if ( $reserve_id ) { >- $hold = Koha::Holds->find( $reserve_id ); >- } else { >- $hold = Koha::Holds->search( $params ); # biblionumber, borrowernumber, itemnumber >- } >- >- return unless $hold; >- >- logaction( 'HOLDS', 'CANCEL', $hold->reserve_id, Dumper($hold->unblessed) ) >- if C4::Context->preference('HoldsLog'); >- >- my $query = " >- UPDATE reserves >- SET cancellationdate = now(), >- priority = 0 >- WHERE reserve_id = ? >- "; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare($query); >- $sth->execute( $reserve_id ); >- >- $query = " >- INSERT INTO old_reserves >- SELECT * FROM reserves >- WHERE reserve_id = ? >- "; >- $sth = $dbh->prepare($query); >- $sth->execute( $reserve_id ); >- >- $query = " >- DELETE FROM reserves >- WHERE reserve_id = ? >- "; >- $sth = $dbh->prepare($query); >- $sth->execute( $reserve_id ); >- >- # now fix the priority on the others.... >- _FixPriority({ biblionumber => $hold->biblionumber }); >- >- # and, if desired, charge a cancel fee >- my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); >- if ( $charge && $params->{'charge_cancel_fee'} ) { >- manualinvoice($hold->borrowernumber, $hold->itemnumber, '', 'HE', $charge); >- } >- >- return $hold->unblessed; >-} >- > =head2 ModReserve > > ModReserve({ rank => $rank, >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19059
:
65607
|
65608
|
65609
|
65610
|
65611
|
65630
|
65631
|
65632
|
65633
|
65634
|
65636
|
65637
|
65638
|
65639
|
65640
|
66783
|
66930
|
66975
|
66976
|
66977
|
66978
|
66979
|
66980
|
66981