From 38f5658b3351428ca931e342d431da1c58ddd1de Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 17 May 2012 10:40:30 -0400 Subject: [PATCH] Bug 8112 - Overdues with Fines giving duplicates If a borrower has multiple fines of type FU for a given item, that row will appear in the Overdues with Fines report for each fine on record. Fixed by grouping the results by borrowernumber. --- C4/Overdues.pm | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Overdues.pm b/C4/Overdues.pm index c7430c9..cdf7b92 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -1237,10 +1237,10 @@ sub GetOverduesForBranch { my $i = 0; my $sth; if ($location) { - $sth = $dbh->prepare("$select AND items.location = ? ORDER BY borrowers.surname, borrowers.firstname"); + $sth = $dbh->prepare("$select AND items.location = ? GROUP BY borrowers.borrowernumber ORDER BY borrowers.surname, borrowers.firstname"); $sth->execute($branch, $location); } else { - $sth = $dbh->prepare("$select ORDER BY borrowers.surname, borrowers.firstname"); + $sth = $dbh->prepare("$select GROUP BY borrowers.borrowernumber ORDER BY borrowers.surname, borrowers.firstname"); $sth->execute($branch); } while ( my $data = $sth->fetchrow_hashref ) { -- 1.7.2.5