From a68e85669bbdd20ebfebeff097918ea024b75432 Mon Sep 17 00:00:00 2001 From: rangi Date: Sat, 14 Sep 2002 00:57:27 +0000 Subject: [PATCH] fixes for the ordering of the issues table in issues, and also on the printed slip --- C4/Circulation/Circ2.pm | 6 +++--- circ/circulation.pl | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/C4/Circulation/Circ2.pm b/C4/Circulation/Circ2.pm index bab5296de0..d06d89a6a8 100755 --- a/C4/Circulation/Circ2.pm +++ b/C4/Circulation/Circ2.pm @@ -863,8 +863,8 @@ sub currentissues { borrowernumber='$borrowernumber' and issues.itemnumber=items.itemnumber and items.biblionumber=biblio.biblionumber and items.biblioitemnumber=biblioitems.biblioitemnumber and returndate is null - $crit order by issues.timestamp desc"; -# print $select; + $crit order by issues.date_due"; +# warn $select; my $sth=$dbh->prepare($select); $sth->execute; while (my $data = $sth->fetchrow_hashref) { @@ -903,7 +903,7 @@ sub getissues { and items.biblioitemnumber = biblioitems.biblioitemnumber and issues.returndate is null order by issues.date_due"; -# print $select; +# warn $select; my $sth=$dbh->prepare($select); $sth->execute; my $counter = 0; diff --git a/circ/circulation.pl b/circ/circulation.pl index b3a528019b..28466fa605 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -422,7 +422,7 @@ if ($borrower) { $book->{'dewey'} $book->{'subclass'} EOF } - foreach my $book (sort {$a->{'due_date'} <=> $b->{'due_date'}} @previousissues){ + foreach my $book (sort {$a->{'date_due'} cmp $b->{'date_due'}} @previousissues){ my $dd = $book->{'date_due'}; my $datedue = $book->{'date_due'}; #convert to nz style dates @@ -651,18 +651,20 @@ sub printslip { $env->{'nottodaysissues'}=0; my $i=0; my @issues; - foreach (sort keys %$borrowerissues) { + foreach (sort {$a <=> $b} keys %$borrowerissues) { $issues[$i]=$borrowerissues->{$_}; my $dd=$issues[$i]->{'date_due'}; +# warn $_,$dd; #convert to nz style dates #this should be set with some kinda config variable my @tempdate=split(/-/,$dd); $issues[$i]->{'date_due'}="$tempdate[2]/$tempdate[1]/$tempdate[0]"; $i++; } - foreach (sort keys %$borroweriss2) { + foreach (sort {$a <=> $b} keys %$borroweriss2) { $issues[$i]=$borroweriss2->{$_}; my $dd=$issues[$i]->{'date_due'}; +# warn $_,$dd; #convert to nz style dates #this should be set with some kinda config variable my @tempdate=split(/-/,$dd); -- 2.39.5