Bugzilla – Attachment 6206 Details for
Bug 6987
C4::Overdues::GetFine returns inconsistent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Signed-off patch
0001-SIGNED-OFF-Bug-6987-Make-return-from-Overdues-GetFin.patch (text/plain), 1.47 KB, created by
Sophie MEYNIEUX
on 2011-11-04 15:30:13 UTC
(
hide
)
Description:
Signed-off patch
Filename:
MIME Type:
Creator:
Sophie MEYNIEUX
Created:
2011-11-04 15:30:13 UTC
Size:
1.47 KB
patch
obsolete
>From b32765cf326a3c8e6496f1f342db9f137655b9b5 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Fri, 7 Oct 2011 13:19:06 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 6987 Make return from Overdues::GetFine > consistent > >If there is not a fine amount return zero not >undefined or other undefined behaviour > >Use more meaningful var names for readability > >Signed-off-by: Sophie Meynieux <sophie.meynieux@biblibre.com> >--- > C4/Overdues.pm | 13 ++++++++----- > 1 files changed, 8 insertions(+), 5 deletions(-) > >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index 9f4b22f..898d538 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -644,13 +644,16 @@ C<$borrowernumber> is the borrowernumber > sub GetFine { > my ( $itemnum, $borrowernumber ) = @_; > my $dbh = C4::Context->dbh(); >- my $query = "SELECT sum(amountoutstanding) FROM accountlines >- where accounttype like 'F%' >- AND amountoutstanding > 0 AND itemnumber = ? AND borrowernumber=?"; >+ my $query = q|SELECT sum(amountoutstanding) as fineamount FROM accountlines >+ where accounttype like 'F%' >+ AND amountoutstanding > 0 AND itemnumber = ? AND borrowernumber=?|; > my $sth = $dbh->prepare($query); > $sth->execute( $itemnum, $borrowernumber ); >- my $data = $sth->fetchrow_hashref(); >- return ( $data->{'sum(amountoutstanding)'} ); >+ my $fine = $sth->fetchrow_hashref(); >+ if ($fine->{fineamount}) { >+ return $fine->{fineamount}; >+ } >+ return 0; > } > > >-- >1.7.5.4 >
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 6987
:
5770
| 6206