Permalink
Browse files

These now actually work.

However charges.pl needs to be templated still, and We need a way to add new
charge rules, this script only updates existing charging rules.
  • Loading branch information...
1 parent 322d929 commit f7b081fbb36aea1e836f87fc1e3151d379ec8195 rangi committed Mar 29, 2003
Showing with 6 additions and 6 deletions.
  1. +3 −3 charges.pl
  2. +3 −3 updatecharges.pl
View
@@ -66,13 +66,13 @@
while (my $data=$sth->fetchrow_hashref){
my @trow2;
for ($i=0;$i<9;$i++){
- $query="select * from categoryitem where categorycode='$trow3[$i]' and itemtype='$data->{'itemtype'}'";
+ $query="select * from categoryitem where categorycode=? and itemtype=?";
my $sth2=$dbh->prepare($query);
- $sth2->execute;
+ $sth2->execute($trow3[$i],$data->{'itemtype'});
my $dat=$sth2->fetchrow_hashref;
$sth2->finish;
my $fine=$dat->{'fine'}+0;
- $trow2[$i]="<input type=text name=\"$trow3[$i]$data->{'itemtype'}\" value=\"$fine,$dat->{'startcharge'},$dat->{'chargeperiod'}\" size=6>";
+ $trow2[$i]="<input type=text name=\"$trow3[$i]$data->{'itemtype'}\" value=\"$fine,$dat->{'firstremind'},$dat->{'chargeperiod'}\" size=6>";
}
print mktablerow(11,'white',$data->{'description'},@trow2);
}
View
@@ -48,9 +48,9 @@
my $data=$input->param($key);
my @dat=split(',',$data);
# print "$bor $cat $dat[0] $dat[1] $dat[2] <br> ";
- my $sth=$dbh->prepare("Update categoryitem set fine=$dat[0],startcharge=$dat[1],chargeperiod=$dat[2] where
- categorycode='$bor' and itemtype='$cat'");
- $sth->execute;
+ my $sth=$dbh->prepare("Update categoryitem set fine=?,firstremind=?,chargeperiod=? where
+ categorycode=? and itemtype=?");
+ $sth->execute($dat[0],$dat[1],$dat[2],$bor,$cat);
$sth->finish;
}
print $input->redirect("/cgi-bin/koha/charges.pl");

0 comments on commit f7b081f

Please sign in to comment.