[Koha-cvs] CVS: koha/C4/Circulation Returns.pm,1.5,1.6
Andrew Arensburger
arensb at users.sourceforge.net
Sun Oct 13 10:31:51 CEST 2002
Update of /cvsroot/koha/koha/C4/Circulation
In directory usw-pr-cvs1:/tmp/cvs-serv15231
Modified Files:
Returns.pm
Log Message:
Deleted unused variables.
Removed trailing whitespace.
Index: Returns.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Circulation/Returns.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** Returns.pm 13 Oct 2002 06:29:37 -0000 1.5
--- Returns.pm 13 Oct 2002 08:31:49 -0000 1.6
***************
*** 42,86 ****
use C4::Print;
! use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
!
# set the version for version checking
$VERSION = 0.01;
!
@ISA = qw(Exporter);
@EXPORT = qw(&returnrecord &calc_odues &Returns);
- %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
-
- # your exported package globals go here,
- # as well as any optionally exported functions
-
- @EXPORT_OK = qw($Var1 %Hashit);
-
-
- # non-exported package globals go here
- use vars qw(@more $stuff);
-
- # initalize package globals, first exported ones
-
- my $Var1 = '';
- my %Hashit = ();
-
- # then the others (which are still accessible as $Some::Module::stuff)
- my $stuff = '';
- my @more = ();
-
- # all file-scoped lexicals must be created before
- # the functions below that use them.
-
- # file-private lexicals go here
- my $priv_var = '';
- my %secret_hash = ();
-
- # here's a file-private function as a closure,
- # callable as &$priv_func; it cannot be prototyped.
- my $priv_func = sub {
- # stuff goes here.
- };
-
- # make all your functions, whether exported or not;
# FIXME - This is only used in C4::Circmain and C4::Circulation, both
--- 42,52 ----
use C4::Print;
! use vars qw($VERSION @ISA @EXPORT);
!
# set the version for version checking
$VERSION = 0.01;
!
@ISA = qw(Exporter);
@EXPORT = qw(&returnrecord &calc_odues &Returns);
# FIXME - This is only used in C4::Circmain and C4::Circulation, both
***************
*** 90,94 ****
sub Returns {
my ($env)=@_;
! my $dbh = C4::Context->dbh;
my @items;
@items[0]=" "x50;
--- 56,60 ----
sub Returns {
my ($env)=@_;
! my $dbh = C4::Context->dbh;
my @items;
@items[0]=" "x50;
***************
*** 106,110 ****
# until (($reason eq "Circ") || ($reason eq "Quit")) {
until ($reason ne "") {
! ($reason,$item) =
returnwindow($env,"Enter Returns",
$item,\@items,$borrower,$amt_owing,$odues,$dbh,$resp); #C4::Circulation
--- 72,76 ----
# until (($reason eq "Circ") || ($reason eq "Quit")) {
until ($reason ne "") {
! ($reason,$item) =
returnwindow($env,"Enter Returns",
$item,\@items,$borrower,$amt_owing,$odues,$dbh,$resp); #C4::Circulation
***************
*** 113,117 ****
if ($reason eq "") {
$resp = "";
! ($resp,$bornum,$borrower,$itemno,$itemrec,$amt_owing) =
checkissue($env,$dbh,$item);
if ($bornum ne "") {
--- 79,83 ----
if ($reason eq "") {
$resp = "";
! ($resp,$bornum,$borrower,$itemno,$itemrec,$amt_owing) =
checkissue($env,$dbh,$item);
if ($bornum ne "") {
***************
*** 121,125 ****
$odues = "";
$amt_owing = "";
! }
if ($resp ne "") {
#if ($resp eq "Returned") {
--- 87,91 ----
$odues = "";
$amt_owing = "";
! }
if ($resp ne "") {
#if ($resp eq "Returned") {
***************
*** 132,136 ****
if ($items[20] > "") {
pop @items;
! }
}
#} elsif ($resp ne "") {
--- 98,102 ----
if ($items[20] > "") {
pop @items;
! }
}
#} elsif ($resp ne "") {
***************
*** 139,143 ****
#if ($resp ne "Returned") {
# error_msg($env,"$resp");
! # $bornum = "";
#}
}
--- 105,109 ----
#if ($resp ne "Returned") {
# error_msg($env,"$resp");
! # $bornum = "";
#}
}
***************
*** 160,167 ****
my $amt_owing;
$item = uc $item;
! my $query = "select * from items,biblio
where barcode = '$item'
and (biblio.biblionumber=items.biblionumber)";
! my $sth=$dbh->prepare($query);
$sth->execute;
if ($itemrec=$sth->fetchrow_hashref) {
--- 126,133 ----
my $amt_owing;
$item = uc $item;
! my $query = "select * from items,biblio
where barcode = '$item'
and (biblio.biblionumber=items.biblionumber)";
! my $sth=$dbh->prepare($query);
$sth->execute;
if ($itemrec=$sth->fetchrow_hashref) {
***************
*** 183,188 ****
$bornum = $issuerec->{'borrowernumber'};
$itemno = $issuerec->{'itemnumber'};
! $amt_owing = returnrecord($env,$dbh,$bornum,$itemno);
! $reason = "Returned";
} else {
$sth->finish;
--- 149,154 ----
$bornum = $issuerec->{'borrowernumber'};
$itemno = $issuerec->{'itemnumber'};
! $amt_owing = returnrecord($env,$dbh,$bornum,$itemno);
! $reason = "Returned";
} else {
$sth->finish;
***************
*** 192,209 ****
my ($resfound,$resrec) = find_reserves($env,$dbh,$itemrec->{'itemnumber'});
if ($resfound eq "y") {
! my $bquery = "select * from borrowers
where borrowernumber = '$resrec->{'borrowernumber'}'";
my $btsh = $dbh->prepare($bquery);
! $btsh->execute;
my $resborrower = $btsh->fetchrow_hashref;
#printreserve($env,$resrec,$resborrower,$itemrec);
! my $mess = "Reserved for collection at branch $resrec->{'branchcode'}";
C4::InterfaceCDK::error_msg($env,$mess);
$btsh->finish;
! }
} else {
$sth->finish;
$reason = "Item not found";
! }
return ($reason,$bornum,$borrower,$itemno,$itemrec,$amt_owing);
# end checkissue
--- 158,175 ----
my ($resfound,$resrec) = find_reserves($env,$dbh,$itemrec->{'itemnumber'});
if ($resfound eq "y") {
! my $bquery = "select * from borrowers
where borrowernumber = '$resrec->{'borrowernumber'}'";
my $btsh = $dbh->prepare($bquery);
! $btsh->execute;
my $resborrower = $btsh->fetchrow_hashref;
#printreserve($env,$resrec,$resborrower,$itemrec);
! my $mess = "Reserved for collection at branch $resrec->{'branchcode'}";
C4::InterfaceCDK::error_msg($env,$mess);
$btsh->finish;
! }
} else {
$sth->finish;
$reason = "Item not found";
! }
return ($reason,$bornum,$borrower,$itemno,$itemrec,$amt_owing);
# end checkissue
***************
*** 220,226 ****
my @datearr = localtime(time);
my $dateret = (1900+$datearr[5])."-".$datearr[4]."-".$datearr[3];
! 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);
$sth->execute;
--- 186,192 ----
my @datearr = localtime(time);
my $dateret = (1900+$datearr[5])."-".$datearr[4]."-".$datearr[3];
! 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);
$sth->execute;
***************
*** 249,254 ****
$sth->finish;
# check for charge made for lost book
! my $query = "select * from accountlines
! where (borrowernumber = '$bornum')
and (itemnumber = '$itemno')
and (accounttype = 'L')";
--- 215,220 ----
$sth->finish;
# check for charge made for lost book
! my $query = "select * from accountlines
! where (borrowernumber = '$bornum')
and (itemnumber = '$itemno')
and (accounttype = 'L')";
***************
*** 256,260 ****
$sth->execute;
if (my $data = $sth->fetchrow_hashref) {
! # writeoff this amount
my $offset;
my $amount = $data->{'amount'};
--- 222,226 ----
$sth->execute;
if (my $data = $sth->fetchrow_hashref) {
! # writeoff this amount
my $offset;
my $amount = $data->{'amount'};
***************
*** 290,294 ****
$usth->execute;
$usth->finish;
! }
$sth->finish;
UpdateStats($env,'branch','return','0','',$itemno);
--- 256,260 ----
$usth->execute;
$usth->finish;
! }
$sth->finish;
UpdateStats($env,'branch','return','0','',$itemno);
***************
*** 304,308 ****
my $amt_owing;
return($amt_owing);
! }
# This function is only used in &checkissue and &returnrecord, both of
--- 270,274 ----
my $amt_owing;
return($amt_owing);
! }
# This function is only used in &checkissue and &returnrecord, both of
***************
*** 313,317 ****
my ($env,$dbh,$itemnumber)= @_;
my $br = $env->{'branchcode'};
! my $query = "update items
set datelastseen = now(), holdingbranch = '$br'
where (itemnumber = '$itemnumber')";
--- 279,283 ----
my ($env,$dbh,$itemnumber)= @_;
my $br = $env->{'branchcode'};
! my $query = "update items
set datelastseen = now(), holdingbranch = '$br'
where (itemnumber = '$itemnumber')";
***************
*** 319,323 ****
$sth->execute;
$sth->finish;
!
}
--- 285,289 ----
$sth->execute;
$sth->finish;
!
}
***************
*** 330,334 ****
my ($env,$dbh,$itemno) = @_;
my $itemdata = itemnodata($env,$dbh,$itemno);
! my $query = "select * from reserves where found is null
and biblionumber = $itemdata->{'biblionumber'} and cancellationdate is NULL
order by priority,reservedate ";
--- 296,300 ----
my ($env,$dbh,$itemno) = @_;
my $itemdata = itemnodata($env,$dbh,$itemno);
! my $query = "select * from reserves where found is null
and biblionumber = $itemdata->{'biblionumber'} and cancellationdate is NULL
order by priority,reservedate ";
***************
*** 361,365 ****
}
if ($resfound eq "y") {
! my $updquery = "update reserves
set found = 'W',itemnumber='$itemno'
where borrowernumber = $resrec->{'borrowernumber'}
--- 327,331 ----
}
if ($resfound eq "y") {
! my $updquery = "update reserves
set found = 'W',itemnumber='$itemno'
where borrowernumber = $resrec->{'borrowernumber'}
***************
*** 377,384 ****
$updsth->execute;
$updsth->finish;
! }
}
}
$sth->finish;
! return ($resfound,$resrec);
}
--- 343,350 ----
$updsth->execute;
$updsth->finish;
! }
}
}
$sth->finish;
! return ($resfound,$resrec);
}
More information about the Koha-cvs
mailing list