Bugzilla – Attachment 52447 Details for
Bug 14048
Change RefundLostItemFeeOnReturn to be branch specific
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14048: Hook new rules into C4::Circulation
Bug-14048-Hook-new-rules-into-C4Circulation.patch (text/plain), 2.58 KB, created by
Tomás Cohen Arazi (tcohen)
on 2016-06-15 19:08:06 UTC
(
hide
)
Description:
Bug 14048: Hook new rules into C4::Circulation
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2016-06-15 19:08:06 UTC
Size:
2.58 KB
patch
obsolete
>From a444058926ea6be888efaf0e67dd75bf33184ccc Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 3 Jun 2016 11:26:42 -0300 >Subject: [PATCH] Bug 14048: Hook new rules into C4::Circulation > >This patch makes AddIssue and AddReturn use the new implementation > >The behaviour should respect the specification. > >Sponsored-by: DoverNet >Sponsored-by: South-East Kansas Library System >Sponsored-by: SWITCH Library Consortium >--- > C4/Circulation.pm | 22 ++++++++++++++++++---- > 1 file changed, 18 insertions(+), 4 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 50e6c10..7fa77da 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -53,6 +53,8 @@ use Koha::Patron::Debarments; > use Koha::Database; > use Koha::Libraries; > use Koha::Holds; >+use Koha::RefundLostItemFeeRule; >+use Koha::RefundLostItemFeeRules; > use Carp; > use List::MoreUtils qw( uniq ); > use Scalar::Util qw( looks_like_number ); >@@ -1437,7 +1439,12 @@ sub AddIssue { > > ## If item was lost, it has now been found, reverse any list item charges if necessary. > if ( $item->{'itemlost'} ) { >- if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) { >+ if ( Koha::RefundLostItemFeeRules->should_refund( >+ current_branch => C4::Context->userenv->{ branch }, >+ patron_branch => $borrower->{ branchcode }, >+ item_home_branch => $item->{ homebranch }, >+ item_holding_branch => $item->{ holdingbranch } >+ ) ) { > _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} ); > } > } >@@ -2110,9 +2117,16 @@ sub AddReturn { > if ( $item->{'itemlost'} ) { > $messages->{'WasLost'} = 1; > >- if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) { >- _FixAccountForLostAndReturned($item->{'itemnumber'}, $borrowernumber, $barcode); # can tolerate undef $borrowernumber >- $messages->{'LostItemFeeRefunded'} = 1; >+ if ( $item->{'itemlost'} ) { >+ if ( Koha::RefundLostItemFeeRules->should_refund( >+ current_branch => C4::Context->userenv->{ branch }, >+ patron_branch => $borrower->{ branchcode }, >+ item_home_branch => $item->{ homebranch }, >+ item_holding_branch => $item->{ holdingbranch } >+ ) ) { >+ _FixAccountForLostAndReturned( $item->{'itemnumber'}, $borrowernumber, $barcode ); >+ $messages->{'LostItemFeeRefunded'} = 1; >+ } > } > } > >-- >2.9.0
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 14048
:
52016
|
52017
|
52018
|
52019
|
52020
|
52169
|
52170
|
52202
|
52203
|
52286
|
52287
|
52288
|
52289
|
52290
|
52291
|
52292
|
52293
|
52306
|
52444
|
52445
|
52446
|
52447
|
52448
|
52449
|
52450
|
52451
|
52482
|
52658
|
52659
|
52660
|
52661
|
52662
|
52663
|
52664
|
52665
|
52666
|
52667
|
52668
|
52748
|
52749
|
52750
|
52751
|
52752
|
52753
|
52754
|
52755
|
52756
|
52757
|
52835
|
52836
|
52837
|
52838
|
52839
|
52840
|
52841
|
52842
|
52843
|
52844
|
52876
|
52883
|
52894
|
53017
|
53018
|
53019
|
53020
|
53021
|
53022
|
53023
|
53024
|
53025
|
53026
|
53027
|
53028
|
53029