Bugzilla – Attachment 147920 Details for
Bug 32684
Implement SIP patron status field "too many items lost"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32684: (QA follow-up) Move too_many_lost to Patron
Bug-32684-QA-follow-up-Move-toomanylost-to-Patron.patch (text/plain), 3.20 KB, created by
Marcel de Rooy
on 2023-03-08 12:47:11 UTC
(
hide
)
Description:
Bug 32684: (QA follow-up) Move too_many_lost to Patron
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-03-08 12:47:11 UTC
Size:
3.20 KB
patch
obsolete
>From 20ba556263cda88baa1f9af54a0e20f8a96bebb8 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 8 Mar 2023 12:45:53 +0000 >Subject: [PATCH] Bug 32684: (QA follow-up) Move too_many_lost to Patron >Content-Type: text/plain; charset=utf-8 > >Alternative implementation outside sub new. > >Test plan: >Run t/db_dependent/SIP/Message.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/SIP/ILS/Patron.pm | 13 ++++++++++++- > C4/SIP/Sip/MsgType.pm | 9 +-------- > 2 files changed, 13 insertions(+), 9 deletions(-) > >diff --git a/C4/SIP/ILS/Patron.pm b/C4/SIP/ILS/Patron.pm >index e5542bfb2b..6a815fb3c5 100644 >--- a/C4/SIP/ILS/Patron.pm >+++ b/C4/SIP/ILS/Patron.pm >@@ -209,7 +209,6 @@ my %fields = ( > too_many_overdue => 0, # for patron_status[6] > too_many_renewal => 0, # for patron_status[7] > too_many_claim_return => 0, # for patron_status[8] >- too_many_lost => 0, # for patron_status[9] > # excessive_fines => 0, # for patron_status[10] > # excessive_fees => 0, # for patron_status[11] > recall_overdue => 0, # for patron_status[12] >@@ -287,6 +286,18 @@ sub check_password { > } > > # A few special cases, not in AUTOLOADed %fields >+ >+sub too_many_lost { >+ my ( $self, $server ) = @_; >+ my $too_many_lost = 0; >+ if( $server && $server->{account} && ( my $lost_block_checkout = $server->{account}->{lost_block_checkout} )) { >+ my $lost_block_checkout_value = $server->{account}->{lost_block_checkout_value} // 1; >+ my $lost_checkouts = Koha::Checkouts->search({ borrowernumber => $self->borrowernumber, 'itemlost' => { '>=', $lost_block_checkout_value } }, { join => 'item'} )->count; >+ $too_many_lost = $lost_checkouts >= $lost_block_checkout; >+ } >+ return $too_many_lost; >+} >+ > sub fee_amount { > my $self = shift; > if ( $self->{fines} ) { >diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm >index 658eb5eb91..3510683d84 100644 >--- a/C4/SIP/Sip/MsgType.pm >+++ b/C4/SIP/Sip/MsgType.pm >@@ -1717,13 +1717,6 @@ sub patron_status_string { > > my $patron_status; > >- my $too_many_lost = 0; >- if ( my $lost_block_checkout = $server->{account}->{lost_block_checkout} ) { >- my $lost_block_checkout_value = $server->{account}->{lost_block_checkout_value} // 1; >- my $lost_checkouts = Koha::Checkouts->search({ borrowernumber => $patron->borrowernumber, 'itemlost' => { '>=', $lost_block_checkout_value } }, { join => 'item'} )->count; >- $too_many_lost = $lost_checkouts >= $lost_block_checkout; >- } >- > siplog( "LOG_DEBUG", "patron_status_string: %s charge_ok: %s", $patron->id, $patron->charge_ok ); > $patron_status = sprintf( > '%s%s%s%s%s%s%s%s%s%s%s%s%s%s', >@@ -1736,7 +1729,7 @@ sub patron_status_string { > $server->{account}->{overdues_block_checkout} ? boolspace( $patron->too_many_overdue ) : q{ }, > boolspace( $patron->too_many_renewal ), > boolspace( $patron->too_many_claim_return ), >- boolspace( $too_many_lost ), >+ boolspace( $patron->too_many_lost( $server ) ), > boolspace( $patron->excessive_fines ), > boolspace( $patron->excessive_fees ), > boolspace( $patron->recall_overdue ), >-- >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 32684
:
145491
|
145492
|
145493
|
145494
|
145786
|
147883
|
147884
|
147919
|
147920
|
147924
|
147969