Bugzilla – Attachment 44350 Details for
Bug 15068
Get rid of warnings in members/summary-print.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 15068 - Get rid of warnings in members/summary-print.pl
PASSED-QA-Bug-15068---Get-rid-of-warnings-in-membe.patch (text/plain), 3.37 KB, created by
Katrin Fischer
on 2015-11-04 00:17:59 UTC
(
hide
)
Description:
[PASSED QA] Bug 15068 - Get rid of warnings in members/summary-print.pl
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2015-11-04 00:17:59 UTC
Size:
3.37 KB
patch
obsolete
>From dbe16976c2bac2349bf7c65aeed8f1c7af7794f3 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Tue, 27 Oct 2015 12:38:32 +0100 >Subject: [PATCH] [PASSED QA] Bug 15068 - Get rid of warnings in > members/summary-print.pl > >This patch removes warnings when printing a summary from a member's >detail page, like: > >- use of uninitialized value in sprintf > at /usr/share/kohaclone/members/summary-print.pl line 47 > >- Use of uninitialized value $roadtype in concatenation (.) or string > at /usr/share/kohaclone/members/summary-print.pl line 61 > >- Use of uninitialized value in addition (+) > at /usr/share/kohaclone/members/summary-print.pl line 87 > >- Argument "2015-11-03 23:59:00" isn't numeric in numeric comparison > (<=>) at /usr/share/kohaclone/members/summary-print.pl line 103 > >To test: >- Apply patch >- Go to a detail page with a member who has a lot of fines >- Print summary >- Verify that warnings like the ones above do no longer appear. > >Signed-off-by: Frederic Demians <f.demians@tamil.fr> > Have been able to see those warnings in Apache log file, and notice > their disappearance after applying this patch. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > members/summary-print.pl | 18 ++++++++++++------ > 1 file changed, 12 insertions(+), 6 deletions(-) > >diff --git a/members/summary-print.pl b/members/summary-print.pl >index 4530e14..7bed793 100755 >--- a/members/summary-print.pl >+++ b/members/summary-print.pl >@@ -43,9 +43,10 @@ my $data = GetMember( 'borrowernumber' => $borrowernumber ); > > my ( $total, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber); > foreach my $accountline (@$accts) { >- $accountline->{amount} = sprintf '%.2f', $accountline->{amount}; >- $accountline->{amountoutstanding} = sprintf '%.2f', >- $accountline->{amountoutstanding}; >+ $accountline->{amount} = sprintf( '%.2f', $accountline->{amount} ) >+ if ( $accountline->{amount} ) ; >+ $accountline->{amountoutstanding} = sprintf( '%.2f', $accountline->{amountoutstanding} ) >+ if ( $accountline->{amountoutstanding} ); > > if ( $accountline->{accounttype} ne 'F' > && $accountline->{accounttype} ne 'FU' ) >@@ -56,8 +57,12 @@ foreach my $accountline (@$accts) { > > my $roadtype = > C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ); >+$roadtype = '' if ( ! $roadtype ); > > our $totalprice = 0; >+my $total_format = ''; >+$total_format = sprintf( "%.2f", $total ) if ($total); >+ > $template->param( > %$data, > >@@ -65,7 +70,7 @@ $template->param( > address => $data->{'streetnumber'} . " $roadtype " . $data->{'address'}, > > accounts => $accts, >- totaldue => sprintf( "%.2f", $total ), >+ totaldue => $total_format, > > issues => build_issue_data( GetPendingIssues($borrowernumber) ), > totalprice => $totalprice, >@@ -84,7 +89,8 @@ sub build_issue_data { > foreach my $issue ( @{$issues} ) { > > my %row = %{$issue}; >- $totalprice += $issue->{replacementprice}; >+ $totalprice += $issue->{replacementprice} >+ if ( $issue->{replacementprice} ); > > #find the charge for an item > my ( $charge, $itemtype ) = >@@ -100,7 +106,7 @@ sub build_issue_data { > push( @{$return}, \%row ); > } > >- @{$return} = sort { $a->{date_due} <=> $b->{date_due} } @{$return}; >+ @{$return} = sort { $a->{date_due} eq $b->{date_due} } @{$return}; > > return $return; > } >-- >1.9.1
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 15068
:
44062
|
44322
| 44350