Bugzilla – Attachment 162966 Details for
Bug 35950
Move the handling of statistics patron logic out of CanBookBeIssued
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35950: Move AddReturn call into circulation.pl
Bug-35950-Move-AddReturn-call-into-circulationpl.patch (text/plain), 3.49 KB, created by
Martin Renvoize (ashimema)
on 2024-03-08 14:57:18 UTC
(
hide
)
Description:
Bug 35950: Move AddReturn call into circulation.pl
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-03-08 14:57:18 UTC
Size:
3.49 KB
patch
obsolete
>From 596365377c366661916583dba72c2d6a19308678 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 29 Feb 2024 20:48:25 +0000 >Subject: [PATCH] Bug 35950: Move AddReturn call into circulation.pl > >There should be no change in beahavior. Following the test plan from Bug 35840. > >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> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Circulation.pm | 15 +-------------- > circ/circulation.pl | 17 ++++++++++++++++- > 2 files changed, 17 insertions(+), 15 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 1de9b54873e..522ac9d7688 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -836,21 +836,8 @@ sub CanBookBeIssued { > } > ); > my $block_lost_return = C4::Context->preference("BlockReturnOfLostItems") ? 1 : 0; >- my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ); >- ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) = >- 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 ( >- { >- STATS => 1, >- CHECKEDIN => $stats_return, >- MESSAGES => $stats_messages, >- ITEM => $stats_iteminformation, >- BORROWER => $stats_borrower, >- }, >- {} >- ); >+ return ( { STATS => 1, }, {} ); > } > > if ( $patron->gonenoaddress && $patron->gonenoaddress == 1 ) { >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 0ba9c2d46c8..d61c4851f2d 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -34,7 +34,7 @@ use Try::Tiny; > use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); > use C4::Auth qw( get_session get_template_and_user ); > use C4::Koha; >-use C4::Circulation qw( barcodedecode CanBookBeIssued AddIssue ); >+use C4::Circulation qw( barcodedecode CanBookBeIssued AddIssue AddReturn ); > use C4::Members; > use C4::Biblio qw( TransformMarcToKoha ); > use C4::Search qw( new_record_from_zebra ); >@@ -355,6 +355,21 @@ if (@$barcodes && $op eq 'cud-checkout') { > $biblio = $item->biblio; > } > >+ if ( $issuingimpossible->{'STATS'} ) { >+ $template->param( STATS => 1 ); >+ >+ if ( $item->onloan ) { >+ my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) = >+ AddReturn( $item->barcode, C4::Context->userenv->{'branch'}, undef, undef, 1 ); >+ >+ $template->param( >+ CHECKEDIN => $stats_return, >+ MESSAGES => $stats_messages, >+ ITEM => $stats_iteminformation, >+ BORROWER => $stats_borrower, >+ ); >+ } >+ } > # Fix for bug 7494: optional checkout-time fallback search for a book > > if ( $issuingimpossible->{'UNKNOWN_BARCODE'} >-- >2.44.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 35950
:
162616
|
162617
|
162618
|
162686
|
162687
| 162966 |
162967