[Koha-cvs] CVS: koha/misc fines2.pl,1.9,1.9.2.1
MJ Ray
slef at users.sourceforge.net
Thu Dec 18 01:04:15 CET 2003
Update of /cvsroot/koha/koha/misc
In directory sc8-pr-cvs1:/tmp/cvs-serv19312/misc
Modified Files:
Tag: rel_2_0
fines2.pl
Log Message:
DBI call fix for bug 662
Index: fines2.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/fines2.pl,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -C2 -r1.9 -r1.9.2.1
*** fines2.pl 13 Oct 2002 10:44:59 -0000 1.9
--- fines2.pl 18 Dec 2003 00:04:13 -0000 1.9.2.1
***************
*** 110,116 ****
#
my $dbh = C4::Context->dbh;
! my $query="Select * from borrowers where borrowernumber='$borrower->{'guarantor'}'";
! my $sth=$dbh->prepare($query);
! $sth->execute;
my $tdata=$sth->fetchrow_hashref;
$sth->finish;
--- 110,115 ----
#
my $dbh = C4::Context->dbh;
! my $sth=$dbh->prepare("Select * from borrowers where borrowernumber=?");
! $sth->execute($borrower->{'guarantor'});
my $tdata=$sth->fetchrow_hashref;
$sth->finish;
***************
*** 138,157 ****
# this should be a separate function
#
! $item->{'title'}=~ s/\'/\\'/g;
! my $query="Insert into accountlines
(borrowernumber,itemnumber,accountno,date,amount,
description,accounttype,amountoutstanding) values
! ($data->[$i]->{'borrowernumber'},$data->[$i]->{'itemnumber'},
! '$accountno',now(),'$cost','Lost item $item->{'title'} $item->{'barcode'} $due','L','$cost')";
! my $sth=$dbh->prepare($query);
! $sth->execute;
$sth->finish;
! $query="update items set itemlost=2 where itemnumber='$data->[$i]->{'itemnumber'}'";
! $sth=$dbh->prepare($query);
! $sth->execute;
$sth->finish;
- } else { # FIXME
- # this should be deleted
- #
}
}
--- 137,150 ----
# this should be a separate function
#
! my $sth=$dbh->prepare("Insert into accountlines
(borrowernumber,itemnumber,accountno,date,amount,
description,accounttype,amountoutstanding) values
! (?,?,?,now(),?,?,'L',?)");
! $sth->execute($data->[$i]->{'borrowernumber'},$data->[$i]->{'itemnumber'},
! $accountno,$cost,"Lost item $item->{'title'} $item->{'barcode'} $due",$cost);
$sth->finish;
! $sth=$dbh->prepare("update items set itemlost=2 where itemnumber=?");
! $sth->execute($data->[$i]->{'itemnumber'});
$sth->finish;
}
}
More information about the Koha-cvs
mailing list