Bugzilla – Attachment 161732 Details for
Bug 35840
Local use is double-counted when using both RecordLocalUseOnReturn and statistical patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35840: Add option to AddReturn to skip recording of localuse
Bug-35840-Add-option-to-AddReturn-to-skip-recordin.patch (text/plain), 2.85 KB, created by
Andrew Fuerste-Henry
on 2024-02-02 21:27:32 UTC
(
hide
)
Description:
Bug 35840: Add option to AddReturn to skip recording of localuse
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2024-02-02 21:27:32 UTC
Size:
2.85 KB
patch
obsolete
>From 189531d74709ddc7f548f2ef6d51ce05e1af3801 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Mon, 29 Jan 2024 18:26:28 +0000 >Subject: [PATCH] Bug 35840: Add option to AddReturn to skip recording of > localuse > >To test: >1. APPLY PATCH, restart_all >2. Turn on RecordLocalUseOnReturn >3. Create a Statistical patron. >4. Check an item out to a regular patron. >5. Check the item out to a Statistical patron. >6. This should trigger a return and you will see 2 entries in the statistics table, one for localuse and one for a return. >7. Try checking out an item to the Stats patron that is NOT checked out. >8. You should only see 1 entry, localuse, in the statistics table. > >Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> >--- > C4/Circulation.pm | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 109809d4b99..08de40f85ed 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -836,7 +836,7 @@ sub CanBookBeIssued { > ); > my $block_lost_return = C4::Context->preference("BlockReturnOfLostItems") ? 1 : 0; > my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) = >- AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'} ); >+ AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'}, undef, undef, 1 ) if $item_object->onloan; > ModDateLastSeen( $item_object->itemnumber, $block_lost_return ); # FIXME Move to Koha::Item > return ( > { >@@ -2049,7 +2049,7 @@ sub GetBranchItemRule { > =head2 AddReturn > > ($doreturn, $messages, $iteminformation, $borrower) = >- &AddReturn( $barcode, $branch [,$exemptfine] [,$returndate] ); >+ &AddReturn( $barcode, $branch [,$exemptfine] [,$returndate] [,$skip_localuse ] ); > > Returns a book. > >@@ -2065,6 +2065,8 @@ removed. Optional. > =item C<$return_date> allows the default return date to be overridden > by the given return date. Optional. > >+=item C<$skip_localuse> indicated that localuse should not be recorded. Optional. >+ > =back > > C<&AddReturn> returns a list of four items: >@@ -2130,7 +2132,7 @@ patron who last borrowed the book. > =cut > > sub AddReturn { >- my ( $barcode, $branch, $exemptfine, $return_date ) = @_; >+ my ( $barcode, $branch, $exemptfine, $return_date, $skip_localuse ) = @_; > > if ($branch and not Koha::Libraries->find($branch)) { > warn "AddReturn error: branch '$branch' not found. Reverting to " . C4::Context->userenv->{'branch'}; >@@ -2473,7 +2475,7 @@ sub AddReturn { > ccode => $item->ccode, > categorycode => $categorycode, > interface => C4::Context->interface, >- }); >+ }) unless ( $skip_localuse && $stat_type eq 'localuse' ); > > # Send a check-in slip. # NOTE: borrower may be undef. Do not try to send messages then. > if ( $patron ) { >-- >2.30.2
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 35840
:
161212
|
161217
|
161223
|
161374
|
161442
|
161443
|
161612
|
161613
|
161614
|
161732
|
161733
|
162963
|
162964
|
162965