From 27a993a16fdd959732abf86f60a814d94b54131e Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 3 Jan 2000 20:05:32 +0000 Subject: [PATCH] fixing date error --- C4/Circulation/Returns.pm | 2 +- C4/Search.pm | 25 +++++++++++++++++++++++-- member.pl | 3 ++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/C4/Circulation/Returns.pm b/C4/Circulation/Returns.pm index ac3600b..89ebd9f 100755 --- a/C4/Circulation/Returns.pm +++ b/C4/Circulation/Returns.pm @@ -165,7 +165,7 @@ sub returnrecord { #my $amt_owing = calc_odues($env,$dbh,$bornum,$itemno); my @datearr = localtime(time); my $dateret = (1900+$datearr[5])."-".$datearr[4]."-".$datearr[3]; - my $query = "update issues set returndate = '$dateret', branchcode ='$env->{'branchcode'}' where + my $query = "update issues set returndate = now(), branchcode ='$env->{'branchcode'}' where (borrowernumber = '$bornum') and (itemnumber = '$itemno') and (returndate is null)"; my $sth = $dbh->prepare($query); diff --git a/C4/Search.pm b/C4/Search.pm index 93544aa..66515cb 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -16,7 +16,7 @@ $VERSION = 0.01; @ISA = qw(Exporter); @EXPORT = qw(&CatSearch &BornameSearch &ItemInfo &KeywordSearch &subsearch &itemdata &bibdata &GetItems &borrdata &getacctlist &itemnodata &itemcount -&OpacSearch &borrdata2 &NewBorrowerNumber &bibitemdata); +&OpacSearch &borrdata2 &NewBorrowerNumber &bibitemdata &borrissues); %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ], # your exported package globals go here, @@ -499,7 +499,7 @@ sub BornameSearch { } $query=$query.") or cardnumber = '$searchstring' order by surname,firstname"; - print $query,"\n"; +# print $query,"\n"; my $sth=$dbh->prepare($query); $sth->execute; my @results; @@ -533,6 +533,27 @@ sub borrdata { return($data); } +sub borrissues { + my ($bornum)=@_; + my $dbh=C4Connect; + my $query; + $query="Select * from issues,biblio,items where borrowernumber='$bornum' and +items.itemnumber=issues.itemnumber and +items.biblionumber=biblio.biblionumber and issues.returndate is NULL"; + #print $query; + my $sth=$dbh->prepare($query); + $sth->execute; + my @result; + my $i=0; + while (my $data=$sth->fetchrow_hashref){ + $result[$i]=$data;; + $i++; + } + $sth->finish; + $dbh->disconnect; + return($i,\@result); +} + sub borrdata2 { diff --git a/member.pl b/member.pl index cf5a7a3..1f16049 100755 --- a/member.pl +++ b/member.pl @@ -43,7 +43,8 @@ for (my $i=0; $i < $count; $i++){ } else { $toggle="white"; } - print mktablerow(8,$toggle,mklink("/cgi-bin/koha/memberentry.pl?bornum=".$results->[$i]{'borrowernumber'},$results->[$i]{'cardnumber'}), + #mklink("/cgi-bin/koha/memberentry.pl?bornum=".$results->[$i]{'borrowernumber'},$results->[$i]{'cardnumber'}), + print mktablerow(8,$toggle,mklink("/cgi-bin/koha/moremember.pl?bornum=".$results->[$i]{'borrowernumber'},$results->[$i]{'cardnumber'}), $results->[$i]{'surname'},$results->[$i]{'firstname'}, $results->[$i]{'categorycode'},$results->[$i]{'streetaddress'}." ".$results->[$i]{'city'},"$od/$issue",$fines, $results->[$i]{'borrowernotes'});