Bugzilla – Attachment 167726 Details for
Bug 28924
Allow checkout fine limit to be determined by patron category
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28924: (QA follow-up) Use $self instead of $patron
Bug-28924-QA-follow-up-Use-self-instead-of-patron.patch (text/plain), 6.75 KB, created by
Matt Blenkinsop
on 2024-06-14 15:12:37 UTC
(
hide
)
Description:
Bug 28924: (QA follow-up) Use $self instead of $patron
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-06-14 15:12:37 UTC
Size:
6.75 KB
patch
obsolete
>From d2b8b15d7f6b9f79e7f4fb7af46d3595dad0f28f Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Fri, 14 Jun 2024 14:45:18 +0000 >Subject: [PATCH] Bug 28924: (QA follow-up) Use $self instead of $patron > >--- > C4/Circulation.pm | 4 ++-- > C4/Members.pm | 2 +- > C4/SIP/ILS/Patron.pm | 22 ++++++++++++---------- > Koha/Patron.pm | 9 ++++----- > circ/circulation.pl | 2 +- > members/moremember.pl | 2 +- > 6 files changed, 21 insertions(+), 20 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index ae0296f372..acd6a7df38 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -819,9 +819,9 @@ sub CanBookBeIssued { > # > # BORROWER STATUS > # >- my $patron_borrowing_status = $patron->can_borrow({ patron => $patron }); >+ my $patron_borrowing_status = $patron->can_borrow(); > if ( $patron->category->category_type eq 'X' && ( $item_object->barcode )) { >- # stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1 . >+ # stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1 . > C4::Stats::UpdateStats( > { > branch => C4::Context->userenv->{'branch'}, >diff --git a/C4/Members.pm b/C4/Members.pm >index f7f6c383a6..1d93b49fa1 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -135,7 +135,7 @@ sub patronflags { > my $dbh=C4::Context->dbh; > my $patron = Koha::Patrons->find( $patroninformation->{borrowernumber} ); > my $account = $patron->account; >- my $patron_charge_limits = $patron->is_patron_inside_charge_limits( { patron => $patron } ); >+ my $patron_charge_limits = $patron->is_patron_inside_charge_limits(); > if ( $patron_charge_limits->{noissuescharge}->{charge} > 0 ) { > my %flaginfo; > my $noissuescharge = $patron_charge_limits->{noissuescharge}->{limit} || 5; >diff --git a/C4/SIP/ILS/Patron.pm b/C4/SIP/ILS/Patron.pm >index 9c3cf69989..b14a7e96c2 100644 >--- a/C4/SIP/ILS/Patron.pm >+++ b/C4/SIP/ILS/Patron.pm >@@ -99,24 +99,26 @@ sub new { > $dexpiry and $dexpiry =~ s/-//g; # YYYYMMDD > > # Get fines and add fines for guarantees (depends on preference NoIssuesChargeGuarantees) >- my $patron_charge_limits = $patron->is_patron_inside_charge_limits( { patron => $patron } ); >- my $fines_amount = $patron_charge_limits->{noissuescharge}->{charge}; >+ my $patron_charge_limits = $patron->is_patron_inside_charge_limits(); >+ my $fines_amount = $patron_charge_limits->{noissuescharge}->{charge}; > my $personal_fines_amount = $fines_amount; >- my $fee_limit = $patron_charge_limits->{noissuescharge}->{limit} || 5; >- my $noissueschargeguarantorswithguarantees = $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{limit}; >+ my $fee_limit = $patron_charge_limits->{noissuescharge}->{limit} || 5; >+ my $noissueschargeguarantorswithguarantees = >+ $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{limit}; > my $noissueschargeguarantees = $patron_charge_limits->{NoIssuesChargeGuarantees}->{limit}; >+ > my $fines_msg = ""; > my $fine_blocked = 0; >- if( $patron_charge_limits->{noissuescharge}->{overlimit} ){ >+ if ( $patron_charge_limits->{noissuescharge}->{overlimit} ) { > $fine_blocked = 1; > $fines_msg .= " -- " . "Patron blocked by fines" if $fine_blocked; >- } elsif ( $noissueschargeguarantorswithguarantees ) { >- $fines_amount = $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{charge}; >+ } elsif ($noissueschargeguarantorswithguarantees) { >+ $fines_amount = $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{charge}; > $fine_blocked = $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{overlimit}; > $fines_msg .= " -- " . "Patron blocked by fines ($fines_amount) on related accounts" if $fine_blocked; >- } elsif ( $noissueschargeguarantees ) { >- if( $patron->guarantee_relationships->count ){ >- $fines_amount += $patron_charge_limits->{NoIssuesChargeGuarantees}->{charge}; >+ } elsif ($noissueschargeguarantees) { >+ if ( $patron->guarantee_relationships->count ) { >+ $fines_amount += $patron_charge_limits->{NoIssuesChargeGuarantees}->{charge}; > $fine_blocked = $patron_charge_limits->{NoIssuesChargeGuarantees}->{overlimit}; > $fines_msg .= " -- " . "Patron blocked by fines ($fines_amount) on guaranteed accounts" if $fine_blocked; > } >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 38d6c4ecbe..9d96074ba4 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -2915,17 +2915,16 @@ If any blockers are found, these are returned in a hash > =cut > > sub can_borrow { >- my ( $self, $args ) = @_; >+ my ( $self ) = @_; > >- my $patron = $args->{patron}; > my $status = { can_borrow => 1 }; > >- $status->{debarred} = 1 if $patron->debarred; >- $status->{expired} = 1 if $patron->is_expired; >+ $status->{debarred} = 1 if $self->debarred; >+ $status->{expired} = 1 if $self->is_expired; > $status->{can_borrow} = 0 if $status->{debarred} || $status->{expired}; > > # Patron charges >- my $patron_charge_limits = $patron->is_patron_inside_charge_limits( { patron => $patron } ); >+ my $patron_charge_limits = $self->is_patron_inside_charge_limits(); > %$status = ( %$status, %$patron_charge_limits ); > $status->{can_borrow} = 0 > if $patron_charge_limits->{noissuescharge}->{overlimit} >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 9cc67e8faa..74d21beaca 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -594,7 +594,7 @@ if ( $patron ) { > $template->param( is_anonymous => 1 ); > $noissues = 1; > } >- my $patron_charge_limits = $patron->is_patron_inside_charge_limits( { patron => $patron } ); >+ my $patron_charge_limits = $patron->is_patron_inside_charge_limits(); > if( $patron_charge_limits->{noissuescharge}->{charge} > 0 ) { > my $noissuescharge = $patron_charge_limits->{noissuescharge}->{limit} || 5; # FIXME If noissuescharge == 0 then 5, why?? > $noissues ||= ( not C4::Context->preference("AllowFineOverride") and $patron_charge_limits->{noissuescharge}->{overlimit} ); >diff --git a/members/moremember.pl b/members/moremember.pl >index ba24fbfa2e..773bc4190d 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -242,7 +242,7 @@ my $issues = $patron->checkouts; > my $balance = 0; > $balance = $patron->account->balance; > >-my $patron_charge_limits = $patron->is_patron_inside_charge_limits( { patron => $patron } ); >+my $patron_charge_limits = $patron->is_patron_inside_charge_limits(); > if ( $patron_charge_limits->{noissuescharge}->{charge} > 0 ) { > $template->param( > charges => 1, >-- >2.39.3 (Apple Git-146)
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 28924
:
165870
|
165871
|
165872
|
165873
|
165874
|
165875
|
165876
|
166042
|
166043
|
166044
|
166045
|
166046
|
166047
|
166048
|
166171
|
166172
|
166173
|
166174
|
166175
|
166176
|
166177
|
167719
|
167720
|
167721
|
167722
|
167723
|
167724
|
167725
|
167726
|
167727
|
167728
|
167729
|
167730
|
167731
|
167732
|
167733
|
167734
|
167735
|
167736
|
167737
|
167738
|
167739
|
167740
|
168728
|
168729
|
168730
|
168731
|
168732
|
168733
|
168734
|
168735
|
168736
|
168737
|
168738
|
168984
|
168985
|
168986
|
168987
|
168988
|
168989
|
168990
|
168991
|
168992
|
168993
|
168994
|
168995
|
169177
|
169428