3 #script to display reports
7 # Copyright 2000-2002 Katipo Communications
9 # This file is part of Koha.
11 # Koha is free software; you can redistribute it and/or modify it under the
12 # terms of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
16 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
17 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
18 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License along with
21 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
22 # Suite 330, Boston, MA 02111-1307 USA
34 $flagsrequired->{circulation}=1;
35 my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
39 my $type=$input->param('type');
41 print startmenu('issue');
42 print "Each box needs to be filled in with fine,time to start charging,charging cycle<br>
43 eg 1,7,7 = $1 fine, after 7 days, every 7 days";
45 my $dbh = C4::Context->dbh;
46 my $query="Select description,categorycode from categories";
47 my $sth=$dbh->prepare($query);
53 while (my $data=$sth->fetchrow_hashref){
54 $trow[$i]=$data->{'description'};
55 $trow3[$i]=$data->{'categorycode'};
59 print mktablerow(10,'white','',@trow);
60 print "<form action=/cgi-bin/koha/updatecharges.pl method=post>";
61 $query="Select description,itemtype from itemtypes";
62 $sth=$dbh->prepare($query);
66 while (my $data=$sth->fetchrow_hashref){
69 $query="select * from categoryitem where categorycode='$trow3[$i]' and itemtype='$data->{'itemtype'}'";
70 my $sth2=$dbh->prepare($query);
72 my $dat=$sth2->fetchrow_hashref;
74 my $fine=$dat->{'fine'}+0;
75 $trow2[$i]="<input type=text name=\"$trow3[$i]$data->{'itemtype'}\" value=\"$fine,$dat->{'startcharge'},$dat->{'chargeperiod'}\" size=6>";
77 print mktablerow(11,'white',$data->{'description'},@trow2);
84 print "<input type=submit></form>";
85 print endmenu('issue');