[Koha-cvs] CVS: koha charges.pl,1.4,1.5 updatecharges.pl,1.4,1.5
Chris Cormack
rangi at users.sourceforge.net
Sun Mar 30 00:15:20 CET 2003
Update of /cvsroot/koha/koha
In directory sc8-pr-cvs1:/tmp/cvs-serv15791
Modified Files:
charges.pl updatecharges.pl
Log Message:
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.
Index: charges.pl
===================================================================
RCS file: /cvsroot/koha/koha/charges.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** charges.pl 28 Oct 2002 17:46:18 -0000 1.4
--- charges.pl 29 Mar 2003 23:15:17 -0000 1.5
***************
*** 67,77 ****
my @trow2;
for ($i=0;$i<9;$i++){
! $query="select * from categoryitem where categorycode='$trow3[$i]' and itemtype='$data->{'itemtype'}'";
my $sth2=$dbh->prepare($query);
! $sth2->execute;
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>";
}
print mktablerow(11,'white',$data->{'description'}, at trow2);
--- 67,77 ----
my @trow2;
for ($i=0;$i<9;$i++){
! $query="select * from categoryitem where categorycode=? and itemtype=?";
my $sth2=$dbh->prepare($query);
! $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->{'firstremind'},$dat->{'chargeperiod'}\" size=6>";
}
print mktablerow(11,'white',$data->{'description'}, at trow2);
Index: updatecharges.pl
===================================================================
RCS file: /cvsroot/koha/koha/updatecharges.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** updatecharges.pl 13 Oct 2002 07:35:58 -0000 1.4
--- updatecharges.pl 29 Mar 2003 23:15:17 -0000 1.5
***************
*** 49,55 ****
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;
$sth->finish;
}
--- 49,55 ----
my @dat=split(',',$data);
# print "$bor $cat $dat[0] $dat[1] $dat[2] <br> ";
! 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;
}
More information about the Koha-cvs
mailing list