fixes for the ordering of the issues table in issues, and also on the

printed slip
This commit is contained in:
rangi 2002-09-14 00:57:27 +00:00
parent d8753e29df
commit a68e85669b
2 changed files with 8 additions and 6 deletions

View file

@ -863,8 +863,8 @@ sub currentissues {
borrowernumber='$borrowernumber' and issues.itemnumber=items.itemnumber and borrowernumber='$borrowernumber' and issues.itemnumber=items.itemnumber and
items.biblionumber=biblio.biblionumber and items.biblionumber=biblio.biblionumber and
items.biblioitemnumber=biblioitems.biblioitemnumber and returndate is null items.biblioitemnumber=biblioitems.biblioitemnumber and returndate is null
$crit order by issues.timestamp desc"; $crit order by issues.date_due";
# print $select; # warn $select;
my $sth=$dbh->prepare($select); my $sth=$dbh->prepare($select);
$sth->execute; $sth->execute;
while (my $data = $sth->fetchrow_hashref) { while (my $data = $sth->fetchrow_hashref) {
@ -903,7 +903,7 @@ sub getissues {
and items.biblioitemnumber = biblioitems.biblioitemnumber and items.biblioitemnumber = biblioitems.biblioitemnumber
and issues.returndate is null and issues.returndate is null
order by issues.date_due"; order by issues.date_due";
# print $select; # warn $select;
my $sth=$dbh->prepare($select); my $sth=$dbh->prepare($select);
$sth->execute; $sth->execute;
my $counter = 0; my $counter = 0;

View file

@ -422,7 +422,7 @@ if ($borrower) {
<td bgcolor=$tcolor align=center>$book->{'dewey'} $book->{'subclass'}</td></tr> <td bgcolor=$tcolor align=center>$book->{'dewey'} $book->{'subclass'}</td></tr>
EOF 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 $dd = $book->{'date_due'};
my $datedue = $book->{'date_due'}; my $datedue = $book->{'date_due'};
#convert to nz style dates #convert to nz style dates
@ -651,18 +651,20 @@ sub printslip {
$env->{'nottodaysissues'}=0; $env->{'nottodaysissues'}=0;
my $i=0; my $i=0;
my @issues; my @issues;
foreach (sort keys %$borrowerissues) { foreach (sort {$a <=> $b} keys %$borrowerissues) {
$issues[$i]=$borrowerissues->{$_}; $issues[$i]=$borrowerissues->{$_};
my $dd=$issues[$i]->{'date_due'}; my $dd=$issues[$i]->{'date_due'};
# warn $_,$dd;
#convert to nz style dates #convert to nz style dates
#this should be set with some kinda config variable #this should be set with some kinda config variable
my @tempdate=split(/-/,$dd); my @tempdate=split(/-/,$dd);
$issues[$i]->{'date_due'}="$tempdate[2]/$tempdate[1]/$tempdate[0]"; $issues[$i]->{'date_due'}="$tempdate[2]/$tempdate[1]/$tempdate[0]";
$i++; $i++;
} }
foreach (sort keys %$borroweriss2) { foreach (sort {$a <=> $b} keys %$borroweriss2) {
$issues[$i]=$borroweriss2->{$_}; $issues[$i]=$borroweriss2->{$_};
my $dd=$issues[$i]->{'date_due'}; my $dd=$issues[$i]->{'date_due'};
# warn $_,$dd;
#convert to nz style dates #convert to nz style dates
#this should be set with some kinda config variable #this should be set with some kinda config variable
my @tempdate=split(/-/,$dd); my @tempdate=split(/-/,$dd);