Bugzilla – Attachment 95122 Details for
Bug 23293
OPACFineNoRenewals always compares against 'balance' not 'outstanding'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23293: Apply OPACFineNoRenewalsIncludeCredit preference
Bug-23293-Apply-OPACFineNoRenewalsIncludeCredit-pr.patch (text/plain), 2.24 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-11-06 18:48:51 UTC
(
hide
)
Description:
Bug 23293: Apply OPACFineNoRenewalsIncludeCredit preference
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-11-06 18:48:51 UTC
Size:
2.24 KB
patch
obsolete
>From d9cb0d16cc3348a995e8f6bf848040276a9ba2e8 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 10 Jul 2019 14:50:06 +0100 >Subject: [PATCH] Bug 23293: Apply OPACFineNoRenewalsIncludeCredit preference > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > C4/Circulation.pm | 5 ++++- > opac/opac-user.pl | 8 ++++++-- > 2 files changed, 10 insertions(+), 3 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 8a8d3ab8fc..191880060b 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2788,7 +2788,10 @@ sub CanBookBeRenewed { > > if ( C4::Context->preference('OPACFineNoRenewalsBlockAutoRenew') ) { > my $fine_no_renewals = C4::Context->preference("OPACFineNoRenewals"); >- my $amountoutstanding = $patron->account->balance; >+ my $amountoutstanding = >+ C4::Context->preference("OPACFineNoRenewalsIncludeCredit") >+ ? $patron->account->balance >+ : $patron->account->outstanding_debits->total_outstanding; > if ( $amountoutstanding and $amountoutstanding > $fine_no_renewals ) { > return ( 0, "auto_too_much_oweing" ); > } >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index 451b7f9356..6c55ad2965 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -124,16 +124,20 @@ if ( $userdebarred || $borr->{'gonenoaddress'} || $borr->{'lost'} ) { > my $amountoutstanding = $patron->account->balance; > my $no_renewal_amt = C4::Context->preference( 'OPACFineNoRenewals' ); > $no_renewal_amt = undef unless looks_like_number( $no_renewal_amt ); >+my $amountoutstandingfornewal = >+ C4::Context->preference("OPACFineNoRenewalsIncludeCredit") >+ ? $amountoutstanding >+ : $patron->account->outstanding_debits->total_outstanding; > > if ( C4::Context->preference('OpacRenewalAllowed') > && defined($no_renewal_amt) >- && $amountoutstanding > $no_renewal_amt ) >+ && $amountoutstandingfornewal > $no_renewal_amt ) > { > $borr->{'flagged'} = 1; > $canrenew = 0; > $template->param( > renewal_blocked_fines => $no_renewal_amt, >- renewal_blocked_fines_amountoutstanding => $amountoutstanding, >+ renewal_blocked_fines_amountoutstanding => $amountoutstandingfornewal, > ); > } > >-- >2.24.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 23293
:
91448
|
91449
|
93149
|
93150
|
93151
|
95121
|
95122
|
95123
|
95124
|
95143
|
95144
|
95145
|
95146