Bugzilla – Attachment 42595 Details for
Bug 7560
SIP Self Checkout Ignoring Fines Thresholds for Not Being able to Check Out Books
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7560 - SIP Self Checkout Ignoring Fines Thresholds for Not Being able to Check Out Books
Bug-7560---SIP-Self-Checkout-Ignoring-Fines-Thresh.patch (text/plain), 3.55 KB, created by
Kyle M Hall (khall)
on 2015-09-16 14:04:18 UTC
(
hide
)
Description:
Bug 7560 - SIP Self Checkout Ignoring Fines Thresholds for Not Being able to Check Out Books
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-09-16 14:04:18 UTC
Size:
3.55 KB
patch
obsolete
>From 15836eee95b00dbc117bc498b0b9bd0086648331 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 20 Feb 2012 08:01:46 -0500 >Subject: [PATCH] Bug 7560 - SIP Self Checkout Ignoring Fines Thresholds for Not Being able to Check Out Books > >Add checks in C4::ILS::Patron and C4::ILS::Transaction::Renew to make sure the patron >is below the noissuescharge system pref for issues and OPACFineNoRenewals for renewals. > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > C4/Overdues.pm | 21 +++++++++++++++++++++ > C4/SIP/ILS/Patron.pm | 4 ++-- > C4/SIP/ILS/Transaction/Renew.pm | 7 +++++++ > 3 files changed, 30 insertions(+), 2 deletions(-) > >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index 6eeb6cf..03bcc85 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -48,6 +48,7 @@ BEGIN { > &UpdateFine > &GetFine > &get_chargeable_units >+ &GetTotalFines > &CheckItemNotify > &GetOverduesForBranch > &RemoveNotifyLine >@@ -667,6 +668,26 @@ sub GetFine { > return 0; > } > >+=head2 GetTotalFines >+ >+ my $total_fines_owed = GetTotalFines( $borrowernumber ); >+ >+ Returns the total amount owed by the given borrower. >+ >+=cut >+ >+sub GetTotalFines { >+ my ( $borrowernumber ) = @_; >+ my $dbh = C4::Context->dbh(); >+ my $query = "SELECT SUM( amountoutstanding ) AS total FROM accountlines WHERE borrowernumber = ?"; >+ my $sth = $dbh->prepare( $query ); >+ $sth->execute( $borrowernumber ); >+ my $row = $sth->fetchrow_hashref(); >+ my $total = $row->{'total'}; >+ $total = $total || 0; >+ return $total; >+} >+ > =head2 NumberNotifyId > > (@notify) = &NumberNotifyId($borrowernumber); >diff --git a/C4/SIP/ILS/Patron.pm b/C4/SIP/ILS/Patron.pm >index 4e9c152..df40e9b 100644 >--- a/C4/SIP/ILS/Patron.pm >+++ b/C4/SIP/ILS/Patron.pm >@@ -81,8 +81,8 @@ sub new { > address => $adr, > home_phone => $kp->{phone}, > email_addr => $kp->{email}, >- charge_ok => ( !$debarred && !$expired && !$fine_blocked), >- renew_ok => ( !$debarred && !$expired && !$fine_blocked), >+ charge_ok => ( !$debarred && !$expired && !$fine_blocked && ( $fines_amount < C4::Context->preference('noissuescharge') ) ), >+ renew_ok => ( !$debarred && !$expired && !$fine_blocked && ( $fines_amount < C4::Context->preference('OPACFineNoRenewals') ) ), > recall_ok => ( !$debarred && !$expired && !$fine_blocked), > hold_ok => ( !$debarred && !$expired && !$fine_blocked), > card_lost => ( $kp->{lost} || $kp->{gonenoaddress} || $flags->{LOST} ), >diff --git a/C4/SIP/ILS/Transaction/Renew.pm b/C4/SIP/ILS/Transaction/Renew.pm >index e0f905b..d909edb 100644 >--- a/C4/SIP/ILS/Transaction/Renew.pm >+++ b/C4/SIP/ILS/Transaction/Renew.pm >@@ -33,6 +33,7 @@ sub do_renew_for { > my $self = shift; > my $borrower = shift; > my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber}); >+ > if ($renewokay) { # ok so far check charges > my ($fee, undef) = GetIssuingCharges($self->{item}->{itemnumber}, $self->{patron}->{borrowernumber}); > if ($fee > 0) { >@@ -44,6 +45,12 @@ sub do_renew_for { > } > > } >+ >+ unless ( C4::Overdues::GetTotalFines($borrower->{borrowernumber}) < C4::Context->preference('OPACFineNoRenewals') ) { >+ $renewokay = 0; >+ $renewerror = 'too_many_fines' >+ } >+ > if ($renewokay){ > $self->{due} = undef; > my $issue = AddIssue( $borrower, $self->{item}->id, undef, 0 ); >-- >1.7.2.5
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 7560
:
7772
|
11475
|
16044
|
16045
|
16047
|
16048
|
18194
|
18195
|
18196
|
18198
|
18199
|
18200
|
20004
|
20005
|
20006
|
42595
|
42596
|
42597
|
43587
|
43777
|
50398