Browse Source

little change

master
chris 22 years ago
parent
commit
5b23a090f5
  1. 5
      C4/Circulation.pm
  2. 10
      C4/Circulation/Returns.pm

5
C4/Circulation.pm

@ -112,14 +112,15 @@ sub checkoverdues{
sub previousissue {
my ($env,$itemnum,$dbh,$bornum)=@_;
my $sth=$dbh->prepare("Select firstname,surname,issues.borrowernumber,cardnumber
my $sth=$dbh->prepare("Select
firstname,surname,issues.borrowernumber,cardnumber,returndate
from issues,borrowers where
issues.itemnumber='$itemnum' and
issues.borrowernumber=borrowers.borrowernumber");
$sth->execute;
my $borrower=$sth->fetchrow_hashref;
$sth->finish;
if ($borrower->{'borrowernumber'} ne ''){
if ($borrower->{'borrowernumber'} ne '' && $borrower->{'returndate'} eq ''){
if ($bornum eq $borrower->{'borrowernumber'}){
# no need to issue
my ($renewstatus) = &renewstatus($env,$dbh,$bornum,$itemnum);

10
C4/Circulation/Returns.pm

@ -62,14 +62,14 @@ sub returnrecord {
my @datearr = localtime(time);
my $dateret = (1900+$datearr[5])."-".$datearr[4]."-".$datearr[3];
debug_msg($env,"before return");
my $query = "update issues
set returndate = '$dateret', branchcode = '$env->{'branchcode'}'
where (borrowernumber = '$bornum') and (itemnumber = '$itemno')
my $query = "update issues set returndate = '$dateret', branchcode ='$env->{'branchcode'}' where (borrowernumber = '$bornum') and (itemnumber = '$itemno')
and (returndate is null)";
print $query;
#output(1,10,$query);
my $sth = $dbh->prepare($query);
$sth->execute;
$sth->finish;
UpdateStats($env,'branch','return','0');
#pause();
return($amt_owing);
}

Loading…
Cancel
Save