Bugzilla – Attachment 135061 Details for
Bug 25711
Move ExpireReservesMaxPickUpDelayCharge to the circulation rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25711: (QA follow-up) Refactor to clarify logic
Bug-25711-QA-follow-up-Refactor-to-clarify-logic.patch (text/plain), 2.42 KB, created by
Peter Vashchuk
on 2022-05-17 12:03:37 UTC
(
hide
)
Description:
Bug 25711: (QA follow-up) Refactor to clarify logic
Filename:
MIME Type:
Creator:
Peter Vashchuk
Created:
2022-05-17 12:03:37 UTC
Size:
2.42 KB
patch
obsolete
>From 126cd3a2597d5899695c7acb11f07c50b90a3387 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 20 Apr 2021 15:14:41 +0100 >Subject: [PATCH] Bug 25711: (QA follow-up) Refactor to clarify logic > >At the point where 'ExpireReservesMaxPickUpDelayCharge' can/should kick >in, we should already have an item waiting (else what's triggered a pickup >delay). As such we can drop the fall through default of using the syspref >when we don't yet have an item. > >We can also save us some calculations and database hits by only >calculating the charge value when we've actually been asked to charge. >So we also move the block inside the 'charge_cancel_fee' block. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> >--- > Koha/Hold.pm | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index ad4e3a6c95..885b6139c9 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -604,8 +604,9 @@ sub cancel { > C4::Reserves::_FixPriority({ biblionumber => $self->biblionumber }); > > # and, if desired, charge a cancel fee >- my $charge; >- if (my $item = $self->item) { >+ if ( $params->{'charge_cancel_fee'} ) { >+ my $charge; >+ my $item = $self->item; > my $branchcode = C4::Reserves::GetReservesControlBranch($item->unblessed, $self->borrower->unblessed); > > my $rule = Koha::CirculationRules->get_effective_rule( >@@ -618,11 +619,7 @@ sub cancel { > ); > my $rule_value = $rule && $rule->rule_value // ''; > $charge = $rule_value ne '' ? $rule_value : C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); >- } else { >- $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); >- } > >- if ( $charge && $params->{'charge_cancel_fee'} ) { > my $account = > Koha::Account->new( { patron_id => $self->borrowernumber } ); > $account->add_debit( >@@ -634,7 +631,7 @@ sub cancel { > type => 'RESERVE_EXPIRED', > item_id => $self->itemnumber > } >- ); >+ ) if $charge; > } > > C4::Log::logaction( 'HOLDS', 'CANCEL', $self->reserve_id, $self ) >-- >2.35.3
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 25711
:
107144
|
107407
|
107683
|
107844
|
108689
|
119851
|
119911
|
119912
|
120164
|
123309
|
123310
|
123326
|
123327
|
123328
|
123452
|
123456
|
123498
|
123568
|
123610
|
123653
|
123661
|
135060
|
135061
|
135062
|
135063
|
135064
|
135065
|
135156
|
135157
|
135158
|
135159
|
135160
|
135161
|
135950
|
135951
|
135952
|
135953
|
135954
|
135955
|
136769
|
140377
|
140378
|
140379
|
140380
|
140381
|
140382
|
140383
|
141270
|
157632
|
157633
|
157634
|
157635
|
157636
|
157637
|
157638
|
157639
|
171054
|
171055
|
171056
|
171057
|
171058
|
171059
|
176243
|
176244
|
176245
|
176246
|
176247
|
176248
|
176408
|
176409
|
176410
|
176411
|
176412
|
176413
|
176414
|
176415
|
176416
|
176417
|
176418
|
176419
|
176420
|
176421