Fixing up a whole pile of warnings
This commit is contained in:
parent
fa44a070d2
commit
74b1eb77c7
|
|
@ -1,6 +1,7 @@
|
|||
package C4::Accounts2; #assummes C4/Accounts2
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
require Exporter;
|
||||
use DBI;
|
||||
use C4::Database;
|
||||
|
|
@ -55,7 +56,7 @@ sub recordpayment{
|
|||
$updquery = "insert into accountoffsets
|
||||
(borrowernumber, accountno, offsetaccount, offsetamount)
|
||||
values ($bornumber,$accdata->{'accountno'},$nextaccntno,$newamtos)";
|
||||
my $usth = $dbh->prepare($updquery);
|
||||
$usth = $dbh->prepare($updquery);
|
||||
$usth->execute;
|
||||
$usth->finish;
|
||||
}
|
||||
|
|
@ -105,7 +106,7 @@ sub makepayment{
|
|||
$updquery = "insert into accountlines
|
||||
(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding)
|
||||
values ($bornumber,$nextaccntno,now(),$payment,'Payment,thanks - $user', 'Pay',0)";
|
||||
my $usth = $dbh->prepare($updquery);
|
||||
$usth = $dbh->prepare($updquery);
|
||||
$usth->execute;
|
||||
$usth->finish;
|
||||
UpdateStats($env,$user,'payment',$amount,'','','',$bornumber);
|
||||
|
|
@ -258,7 +259,7 @@ sub fixcredit{
|
|||
$updquery = "insert into accountoffsets
|
||||
(borrowernumber, accountno, offsetaccount, offsetamount)
|
||||
values ($bornumber,$accdata->{'accountno'},$nextaccntno,$newamtos)";
|
||||
my $usth = $dbh->prepare($updquery);
|
||||
$usth = $dbh->prepare($updquery);
|
||||
$usth->execute;
|
||||
$usth->finish;
|
||||
}
|
||||
|
|
@ -289,7 +290,7 @@ sub fixcredit{
|
|||
$updquery = "insert into accountoffsets
|
||||
(borrowernumber, accountno, offsetaccount, offsetamount)
|
||||
values ($bornumber,$accdata->{'accountno'},$nextaccntno,$newamtos)";
|
||||
my $usth = $dbh->prepare($updquery);
|
||||
$usth = $dbh->prepare($updquery);
|
||||
$usth->execute;
|
||||
$usth->finish;
|
||||
}
|
||||
|
|
@ -342,7 +343,7 @@ sub refund{
|
|||
$updquery = "insert into accountoffsets
|
||||
(borrowernumber, accountno, offsetaccount, offsetamount)
|
||||
values ($bornumber,$accdata->{'accountno'},$nextaccntno,$newamtos)";
|
||||
my $usth = $dbh->prepare($updquery);
|
||||
$usth = $dbh->prepare($updquery);
|
||||
$usth->execute;
|
||||
$usth->finish;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package C4::Acquisitions; #assumes C4/Acquisitions.pm
|
|||
use strict;
|
||||
require Exporter;
|
||||
use C4::Database;
|
||||
|
||||
use warnings;
|
||||
use vars qw($VERSION @ISA @EXPORT);
|
||||
|
||||
# set the version for version checking
|
||||
|
|
@ -742,7 +742,7 @@ sub curconvert {
|
|||
if ($cur==0){
|
||||
$cur=1;
|
||||
}
|
||||
my $price=$price / $cur;
|
||||
$price=$price / $cur;
|
||||
return($price);
|
||||
}
|
||||
|
||||
|
|
@ -1046,7 +1046,7 @@ sub getitemtypes {
|
|||
$sth->execute;
|
||||
# || die "Cannot execute $query\n" . $sth->errstr;
|
||||
while (my $data = $sth->fetchrow_hashref) {
|
||||
@results[$count] = $data;
|
||||
$results[$count] = $data;
|
||||
$count++;
|
||||
} # while
|
||||
|
||||
|
|
|
|||
|
|
@ -395,7 +395,7 @@ sub returnbook {
|
|||
|
||||
# check for overdue fine
|
||||
|
||||
$overduecharge;
|
||||
|
||||
$sth=$dbh->prepare("select * from accountlines where (borrowernumber=$borrower->{'borrowernumber'}) and (itemnumber = $iteminformation->{'itemnumber'}) and (accounttype='FU' or accounttype='O')");
|
||||
$sth->execute;
|
||||
# alter fine to show that the book has been returned
|
||||
|
|
@ -471,7 +471,7 @@ sub returnbook {
|
|||
(borrowernumber, accountno, offsetaccount, offsetamount)
|
||||
values
|
||||
($data->{'borrowernumber'},$accdata->{'accountno'},$nextaccntno,$newamtos)";
|
||||
my $usth = $dbh->prepare($updquery);
|
||||
$usth = $dbh->prepare($updquery);
|
||||
$usth->execute;
|
||||
$usth->finish;
|
||||
}
|
||||
|
|
@ -729,7 +729,7 @@ sub checkwaiting {
|
|||
$sth->execute();
|
||||
my $cnt=0;
|
||||
if (my $data=$sth->fetchrow_hashref) {
|
||||
@itemswaiting[$cnt] =$data;
|
||||
$itemswaiting[$cnt] =$data;
|
||||
$cnt ++
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
@ -820,7 +820,7 @@ sub renewbook {
|
|||
$datedue = (1900+$datearr[5])."-".($datearr[4]+1)."-".$datearr[3];
|
||||
}
|
||||
my @date = split("-",$datedue);
|
||||
my $odatedue = (@date[2]+0)."-".(@date[1]+0)."-".@date[0];
|
||||
my $odatedue = ($date[2]+0)."-".($date[1]+0)."-".$date[0];
|
||||
my $issquery = "select * from issues where borrowernumber='$bornum' and
|
||||
itemnumber='$itemno' and returndate is null";
|
||||
my $sth=$dbh->prepare($issquery);
|
||||
|
|
@ -832,7 +832,7 @@ sub renewbook {
|
|||
set date_due = '$datedue', renewals = '$renews'
|
||||
where borrowernumber='$bornum' and
|
||||
itemnumber='$itemno' and returndate is null";
|
||||
my $sth=$dbh->prepare($updquery);
|
||||
$sth=$dbh->prepare($updquery);
|
||||
|
||||
$sth->execute;
|
||||
$sth->finish;
|
||||
|
|
@ -861,7 +861,7 @@ sub calc_charges {
|
|||
my $discount = $data2->{'rentaldiscount'};
|
||||
$charge = ($charge *(100 - $discount)) / 100;
|
||||
}
|
||||
$sth2->{'finish'};
|
||||
$sth2->finish;
|
||||
}
|
||||
$sth1->finish;
|
||||
return ($charge);
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ use C4::Database;
|
|||
use C4::Stats;
|
||||
use C4::Accounts2;
|
||||
use C4::Circulation::Circ2;
|
||||
use warnings;
|
||||
|
||||
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
|
||||
|
||||
|
|
@ -128,7 +129,7 @@ sub renewbook {
|
|||
set date_due = '$datedue', renewals = '$renews'
|
||||
where borrowernumber='$bornum' and
|
||||
itemnumber='$itemno' and returndate is null";
|
||||
my $sth=$dbh->prepare($updquery);
|
||||
$sth=$dbh->prepare($updquery);
|
||||
$sth->execute;
|
||||
$sth->finish;
|
||||
UpdateStats($env,$env->{'branchcode'},'renew','','',$itemno);
|
||||
|
|
@ -178,7 +179,7 @@ sub calc_charges {
|
|||
my $discount = $data2->{'rentaldiscount'};
|
||||
$charge = ($charge *(100 - $discount)) / 100;
|
||||
}
|
||||
$sth2->{'finish'};
|
||||
$sth2->finish;
|
||||
}
|
||||
$sth1->finish;
|
||||
$dbh->disconnect;
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ sub CalcReserveFee {
|
|||
my $x = 0;
|
||||
my $allissued = 1;
|
||||
while ($x < $cntitemsfound) {
|
||||
my $bitdata = @biblioitems[$x];
|
||||
my $bitdata = $biblioitems[$x];
|
||||
my $query2 = "select * from items
|
||||
where biblioitemnumber = '$bitdata->{'biblioitemnumber'}'";
|
||||
my $sth2 = $dbh->prepare($query2);
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ sub KeywordSearch {
|
|||
# print $query;
|
||||
my $sth=$dbh->prepare($query);
|
||||
$sth->execute;
|
||||
my $i=0;
|
||||
$i=0;
|
||||
while (my @res=$sth->fetchrow_array){
|
||||
$results[$i]=$res[0];
|
||||
$i++;
|
||||
|
|
@ -383,7 +383,7 @@ sub KeywordSearch2 {
|
|||
my $i2=1;
|
||||
@results=sort @results;
|
||||
my @res;
|
||||
my $count=@results;
|
||||
$count=@results;
|
||||
$i=1;
|
||||
if ($count > 0){
|
||||
$res[0]=$results[0];
|
||||
|
|
@ -952,7 +952,7 @@ sub itemissues {
|
|||
$query2="select * from issues,borrowers where itemnumber='$data->{'itemnumber'}'
|
||||
and issues.borrowernumber=borrowers.borrowernumber
|
||||
order by date_due desc";
|
||||
my $sth2=$dbh->prepare($query2) || die $dbh->errstr;
|
||||
$sth2=$dbh->prepare($query2) || die $dbh->errstr;
|
||||
$sth2->execute || die $sth2->errstr;
|
||||
for (my $i2=0;$i2<2;$i2++){
|
||||
if (my $data2=$sth2->fetchrow_hashref){
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ biblio.title,reserves.reservedate";
|
|||
$sth=$dbh->prepare($query);
|
||||
$sth->execute;
|
||||
while (my $data=$sth->fetchrow_hashref){
|
||||
@results[$i]=$data;
|
||||
$results[$i]=$data;
|
||||
$i++;
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ print $input->header;
|
|||
#my ($analytictitle)=analytic($biblionumber,'t');
|
||||
#my ($analyticauthor)=analytic($biblionumber,'a');
|
||||
print startpage();
|
||||
print startmenu();
|
||||
print startmenu('catalogue');
|
||||
my %inputs;
|
||||
|
||||
#have to get all subtitles, subjects and additional authors
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ for (my $i=0;$i<$count;$i++){
|
|||
$issue->[$i]{'barcode'}</a></td>
|
||||
<TD>$issue->[$i]{'date_due'}</td>";
|
||||
#find the charge for an item
|
||||
my ($charge,$itemtype)=calc_charges(\%env,$issue->[$i]{'itemnumber'},$bornum);
|
||||
my ($charge,$itemtype)=calc_charges(undef,$issue->[$i]{'itemnumber'},$bornum);
|
||||
print "<TD>$itemtype</td>";
|
||||
print "<TD>$charge</td>";
|
||||
|
||||
|
|
|
|||
32
request.pl
32
request.pl
|
|
@ -18,13 +18,14 @@ print $input->header;
|
|||
|
||||
#setup colours
|
||||
print startpage();
|
||||
print startmenu();
|
||||
print startmenu('catalogue');
|
||||
my $blah;
|
||||
my $bib=$input->param('bib');
|
||||
my $dat=bibdata($bib);
|
||||
my ($count,$reserves)=FindReserves($bib);
|
||||
#print $count;
|
||||
#print $input->dump;
|
||||
|
||||
print $count if $DEBUG;
|
||||
print $input->dump if $DEBUG;
|
||||
|
||||
|
||||
print <<printend
|
||||
|
|
@ -55,16 +56,21 @@ print <<printend
|
|||
<TD><select name=rank-request>
|
||||
printend
|
||||
;
|
||||
$count++;
|
||||
my $i;
|
||||
for ($i=1;$i<$count;$i++){
|
||||
print "<option value=$i>$i\n";
|
||||
my $value;
|
||||
for $value(1..$count){
|
||||
print "<option value=$value>$value\n";
|
||||
}
|
||||
print "<option value=$i selected>$i\n";
|
||||
print "<option value=$value selected>$value\n";
|
||||
|
||||
# FIXME
|
||||
# we should create a today function (in C4::Koha) that returns
|
||||
# either a US or non-US date string based on a configuration switch
|
||||
#
|
||||
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =localtime(time);
|
||||
$year=$year+1900;
|
||||
$mon++;
|
||||
my $date="$mday/$mon/$year";
|
||||
|
||||
print <<printend
|
||||
</select>
|
||||
</td>
|
||||
|
|
@ -104,9 +110,10 @@ print <<printend
|
|||
</TR>
|
||||
printend
|
||||
;
|
||||
my $blah;
|
||||
my ($count2,@data)=bibitems($bib);
|
||||
for ($i=0;$i<$count2;$i++){
|
||||
|
||||
my @data;
|
||||
($count2,@data)=bibitems($bib);
|
||||
for (my $i=0;$i<$count2;$i++){
|
||||
my @barcodes=barcodes($data[$i]->{'biblioitemnumber'});
|
||||
if ($data[$i]->{'dewey'} == 0){
|
||||
$data[$i]->{'dewey'}="";
|
||||
|
|
@ -155,7 +162,7 @@ printend
|
|||
;
|
||||
$count--;
|
||||
|
||||
for ($i=0;$i<$count;$i++){
|
||||
for (my $i=0;$i<$count;$i++){
|
||||
print "<input type=hidden name=borrower value=$reserves->[$i]{'borrowernumber'}>";
|
||||
print "<input type=hidden name=biblio value=$reserves->[$i]{'biblionumber'}>";
|
||||
#my $bor=$reserves->[$i]{'firstname'}."%20".$reserves->[$i]{'surname'};
|
||||
|
|
@ -213,6 +220,7 @@ print "
|
|||
</tr>
|
||||
";
|
||||
}
|
||||
|
||||
print <<printend
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ my $isbn=validate($input->param('isbn'));
|
|||
$search{'isbn'}=$isbn;
|
||||
|
||||
my $datebefore=validate($input->param('date-before'));
|
||||
$search{'date-before'};
|
||||
$search{'date-before'}=$datebefore;
|
||||
|
||||
my $class=$input->param('class');
|
||||
$search{'class'}=$class;
|
||||
|
|
@ -94,7 +94,6 @@ if ($type eq 'intra'){
|
|||
}
|
||||
print center();
|
||||
my $count;
|
||||
my @results;
|
||||
if ($itemnumber ne '' || $isbn ne ''){
|
||||
($count,@results)=&CatSearch(\$blah,'precise',\%search,$num,$offset);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue