Lines 101-108
elsif ($op eq 'delete-branch-item') {
Link Here
|
101 |
# save the values entered |
101 |
# save the values entered |
102 |
elsif ($op eq 'add') { |
102 |
elsif ($op eq 'add') { |
103 |
my $sth_search = $dbh->prepare('SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?'); |
103 |
my $sth_search = $dbh->prepare('SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?'); |
104 |
my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, renewalperiod, reservesallowed, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount, overduefinescap) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'); |
104 |
my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, renewalperiod, norenewalbefore, reservesallowed, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount, overduefinescap) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'); |
105 |
my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, renewalperiod=?, reservesallowed=?, issuelength=?, lengthunit = ?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?, overduefinescap=? WHERE branchcode=? AND categorycode=? AND itemtype=?"); |
105 |
my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, renewalperiod=?, norenewalbefore=?, reservesallowed=?, issuelength=?, lengthunit = ?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?, overduefinescap=? WHERE branchcode=? AND categorycode=? AND itemtype=?"); |
106 |
|
106 |
|
107 |
my $br = $branch; # branch |
107 |
my $br = $branch; # branch |
108 |
my $bor = $input->param('categorycode'); # borrower category |
108 |
my $bor = $input->param('categorycode'); # borrower category |
Lines 114-119
elsif ($op eq 'add') {
Link Here
|
114 |
my $maxissueqty = $input->param('maxissueqty'); |
114 |
my $maxissueqty = $input->param('maxissueqty'); |
115 |
my $renewalsallowed = $input->param('renewalsallowed'); |
115 |
my $renewalsallowed = $input->param('renewalsallowed'); |
116 |
my $renewalperiod = $input->param('renewalperiod'); |
116 |
my $renewalperiod = $input->param('renewalperiod'); |
|
|
117 |
my $norenewalbefore = $input->param('norenewalbefore'); |
118 |
$norenewalbefore = undef if $norenewalbefore == 0; |
117 |
my $reservesallowed = $input->param('reservesallowed'); |
119 |
my $reservesallowed = $input->param('reservesallowed'); |
118 |
$maxissueqty =~ s/\s//g; |
120 |
$maxissueqty =~ s/\s//g; |
119 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
121 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
Lines 129-137
elsif ($op eq 'add') {
Link Here
|
129 |
$sth_search->execute($br,$bor,$cat); |
131 |
$sth_search->execute($br,$bor,$cat); |
130 |
my $res = $sth_search->fetchrow_hashref(); |
132 |
my $res = $sth_search->fetchrow_hashref(); |
131 |
if ($res->{total}) { |
133 |
if ($res->{total}) { |
132 |
$sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed, $renewalperiod, $reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat); |
134 |
$sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed, $renewalperiod, $norenewalbefore, $reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat); |
133 |
} else { |
135 |
} else { |
134 |
$sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed, $renewalperiod, $reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$overduefinescap); |
136 |
$sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed, $renewalperiod, $norenewalbefore, $reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$overduefinescap); |
135 |
} |
137 |
} |
136 |
} |
138 |
} |
137 |
elsif ($op eq "set-branch-defaults") { |
139 |
elsif ($op eq "set-branch-defaults") { |