query => $input,
type => "intranet",
authnotrequired => 0,
- flagsrequired => {parameters => 1},
+ flagsrequired => {parameters => 1, management => 1},
debug => 1,
});
# save the values entered
my $cat = $3; # item type
my $data=$input->param($key);
my ($issuelength,$maxissueqty)=split(',',$data);
- if ($maxissueqty >0) {
+# if ($maxissueqty >0) {
$sth_search->execute($br,$bor,$cat);
my $res = $sth_search->fetchrow_hashref();
if ($res->{total}) {
} else {
$sth_Iinsert->execute($br,$bor,$cat,$maxissueqty,$issuelength);
}
- } else {
- $sth_Idelete->execute($br,$bor,$cat);
- }
+# } else {
+# $sth_Idelete->execute($br,$bor,$cat);
+# }
}
# FINES
if ($key =~ /F-(.*)-(.*)\.(.*)/) {
my $cat = $3; # item type
my $data=$input->param($key);
my ($fine,$firstremind,$chargeperiod)=split(',',$data);
- if ($fine >0) {
+# if ($fine >0) {
$sth_search->execute($br,$bor,$cat);
my $res = $sth_search->fetchrow_hashref();
if ($res->{total}) {
} else {
$sth_Finsert->execute($br,$bor,$cat,$fine,$firstremind,$chargeperiod);
}
- } else {
- $sth_Fdelete->execute($br,$bor,$cat);
- }
+# } else {
+# $sth_Fdelete->execute($br,$bor,$cat);
+# }
}
}
$sth=$dbh->prepare("Select description,itemtype from itemtypes order by description");
$sth->execute;
# $i=0;
-my $toggle="white";
+my $toggle= 1;
my @row_loop;
my @itemtypes;
while (my $row=$sth->fetchrow_hashref){
foreach my $data (@itemtypes) {
my @trow2;
my @cell_loop;
- if ( $toggle eq 'white' ) {
- $toggle = '#ffffcc';
+ if ( $toggle eq 1 ) {
+ $toggle = 0;
} else {
- $toggle = 'white';
+ $toggle = 1;
}
for (my $i=0;$i<=$#trow3;$i++){
my $sth2=$dbh->prepare("select * from issuingrules where branchcode=? and categorycode=? and itemtype=?");
my $maxissueqty = $dat->{'maxissueqty'}+0;
my $issuelength = $dat->{'issuelength'}+0;
my $finesvalue;
- $finesvalue= "$fine,$dat->{'firstremind'},$dat->{'chargeperiod'}" if $fine>0;
+ $finesvalue= "$fine,$dat->{'firstremind'},$dat->{'chargeperiod'}" if $fine+$dat->{'firstremind'}+$dat->{'chargeperiod'}>0;
my $issuingvalue;
- if ($maxissueqty>0) {
- $issuingvalue = "$issuelength,$maxissueqty" ;
- }
- else {
- $issuingvalue = "$issuelength, 5";
- $maxissueqty = 5;
- }
+# if ($maxissueqty>0) {
+ $issuingvalue = "$issuelength,$maxissueqty" if $issuelength+$maxissueqty>0;
+# }
+# else {
+# $issuingvalue = "$issuelength, 5";
+# $maxissueqty = 5;
+# }
my %row = (finesname=> "F-$branch-$trow3[$i].$$data->{'itemtype'}",
finesvalue => $finesvalue,
issuingname => "I-$branch-$trow3[$i].$$data->{itemtype}",