Bugzilla – Attachment 18195 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 - QA Followup
Bug-7560---SIP-Self-Checkout-Ignoring-Fines-Thresh.patch (text/plain), 3.07 KB, created by
Kyle M Hall (khall)
on 2013-05-17 13:11:34 UTC
(
hide
)
Description:
Bug 7560 - SIP Self Checkout Ignoring Fines Thresholds for Not Being able to Check Out Books - QA Followup
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-05-17 13:11:34 UTC
Size:
3.07 KB
patch
obsolete
>From a69874a415a52c9214d9fb5f596dc372bbbcbf04 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 11 Mar 2013 13:29:31 -0400 >Subject: [PATCH] Bug 7560 - SIP Self Checkout Ignoring Fines Thresholds for Not Being able to Check Out Books - QA Followup > >--- > C4/Accounts.pm | 21 +++++++++++++++++++++ > C4/Overdues.pm | 20 -------------------- > C4/SIP/ILS/Transaction/Renew.pm | 2 +- > 3 files changed, 22 insertions(+), 21 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index a39ca54..c4b5046 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -50,6 +50,7 @@ BEGIN { > &makepartialpayment > &recordpayment_selectaccts > &WriteOffFee >+ &GetTotalFines > ); > } > >@@ -997,6 +998,26 @@ sub WriteOffFee { > > } > >+=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; >+} >+ > END { } # module clean-up code here (global destructor) > > 1; >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index 06faff9..20276cd 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -53,7 +53,6 @@ BEGIN { > &GetOverdueDelays > &GetOverduerules > &GetFine >- &GetTotalFines > &CreateItemAccountLine > &ReplacementCost2 > >@@ -693,25 +692,6 @@ 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; >-} > > sub ReplacementCost2 { > my ( $itemnum, $borrowernumber ) = @_; >diff --git a/C4/SIP/ILS/Transaction/Renew.pm b/C4/SIP/ILS/Transaction/Renew.pm >index 7d1269b..47cda6c 100644 >--- a/C4/SIP/ILS/Transaction/Renew.pm >+++ b/C4/SIP/ILS/Transaction/Renew.pm >@@ -35,7 +35,7 @@ sub do_renew_for { > my $borrower = shift; > my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber}); > >- unless ( C4::Overdues::GetTotalFines($borrower->{borrowernumber}) < C4::Context->preference('OPACFineNoRenewals') ) { >+ unless ( C4::Accounts::GetTotalFines($borrower->{borrowernumber}) < C4::Context->preference('OPACFineNoRenewals') ) { > $renewokay = 0; > $renewerror = 'too_many_fines' > } >-- >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