Bugzilla – Attachment 123498 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: move get_effective_expire_charge to Koha::CirculationRules
Bug-25711-move-geteffectiveexpirecharge-to-KohaCir.patch (text/plain), 2.97 KB, created by
Peter Vashchuk
on 2021-08-05 13:38:20 UTC
(
hide
)
Description:
Bug 25711: move get_effective_expire_charge to Koha::CirculationRules
Filename:
MIME Type:
Creator:
Peter Vashchuk
Created:
2021-08-05 13:38:20 UTC
Size:
2.97 KB
patch
obsolete
>From e287f8ad1262dd38ab8ea4f8ad2e94ae28f74969 Mon Sep 17 00:00:00 2001 >From: Petro Vashchuk <stalkernoid@gmail.com> >Date: Thu, 5 Aug 2021 16:37:40 +0300 >Subject: [PATCH] Bug 25711: move get_effective_expire_charge to > Koha::CirculationRules > >Move get_effective_expire_reserves_charge as a new method >in Koha::CirculationRules to retrieve the effective value of the rule. >--- > Koha/CirculationRules.pm | 26 ++++++++++++++++++++++++++ > Koha/Hold.pm | 11 +++-------- > 2 files changed, 29 insertions(+), 8 deletions(-) > >diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm >index 959eb14d76..fd9ec35329 100644 >--- a/Koha/CirculationRules.pm >+++ b/Koha/CirculationRules.pm >@@ -579,6 +579,32 @@ sub get_effective_daysmode { > > } > >+=head3 get_effective_expire_reserves_charge >+ >+Return the value for expire_reserves_charge defined in the circulation rules. >+If not defined (or empty string), the value of the system preference ExpireReservesMaxPickUpDelayCharge is returned >+ >+=cut >+ >+sub get_effective_expire_reserves_charge { >+ my ( $class, $params ) = @_; >+ >+ my $itemtype = $params->{itemtype}; >+ my $branchcode = $params->{branchcode}; >+ my $categorycode = $params->{categorycode}; >+ >+ my $expire_reserves_charge_rule = $class->get_effective_rule( >+ { >+ itemtype => $itemtype, >+ branchcode => $branchcode, >+ categorycode => $categorycode, >+ rule_name => 'expire_reserves_charge', >+ } >+ ); >+ >+ return $expire_reserves_charge_rule ? $expire_reserves_charge_rule->rule_value : C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); >+ >+} > > =head3 type > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index 35ea687795..9d2c348b99 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -553,19 +553,14 @@ sub cancel { > > # and, if desired, charge a cancel fee > 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( >+ my $charge = Koha::CirculationRules->get_effective_expire_reserves_charge( > { >+ itemtype => $item->effective_itemtype, >+ branchcode => C4::Reserves::GetReservesControlBranch($item->unblessed, $self->borrower->unblessed), > categorycode => $self->borrower->categorycode, >- itemtype => $item->effective_itemtype, >- branchcode => $branchcode, >- rule_name => 'expire_reserves_charge', > } > ); >- $charge = $rule ? $rule->rule_value : C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); > > my $account = > Koha::Account->new( { patron_id => $self->borrowernumber } ); >-- >2.31.1
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