Lines 101-114
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, norenewalbefore, 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, maxsuspensiondays, firstremind, chargeperiod,rentaldiscount, overduefinescap) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'); |
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=?"); |
105 |
my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, maxsuspensiondays=?, 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 |
109 |
my $cat = $input->param('itemtype'); # item type |
109 |
my $cat = $input->param('itemtype'); # item type |
110 |
my $fine = $input->param('fine'); |
110 |
my $fine = $input->param('fine'); |
111 |
my $finedays = $input->param('finedays'); |
111 |
my $finedays = $input->param('finedays'); |
|
|
112 |
my $maxsuspensiondays = $input->param('maxsuspensiondays'); |
112 |
my $firstremind = $input->param('firstremind'); |
113 |
my $firstremind = $input->param('firstremind'); |
113 |
my $chargeperiod = $input->param('chargeperiod'); |
114 |
my $chargeperiod = $input->param('chargeperiod'); |
114 |
my $maxissueqty = $input->param('maxissueqty'); |
115 |
my $maxissueqty = $input->param('maxissueqty'); |
Lines 131-139
elsif ($op eq 'add') {
Link Here
|
131 |
$sth_search->execute($br,$bor,$cat); |
132 |
$sth_search->execute($br,$bor,$cat); |
132 |
my $res = $sth_search->fetchrow_hashref(); |
133 |
my $res = $sth_search->fetchrow_hashref(); |
133 |
if ($res->{total}) { |
134 |
if ($res->{total}) { |
134 |
$sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed, $renewalperiod, $norenewalbefore, $reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat); |
135 |
$sth_update->execute($fine, $finedays, $maxsuspensiondays, $firstremind, $chargeperiod, $maxissueqty, $renewalsallowed, $renewalperiod, $norenewalbefore, $reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat); |
135 |
} else { |
136 |
} else { |
136 |
$sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed, $renewalperiod, $norenewalbefore, $reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$overduefinescap); |
137 |
$sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed, $renewalperiod, $norenewalbefore, $reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays, $maxsuspensiondays, $firstremind,$chargeperiod,$rentaldiscount,$overduefinescap); |
137 |
} |
138 |
} |
138 |
} |
139 |
} |
139 |
elsif ($op eq "set-branch-defaults") { |
140 |
elsif ($op eq "set-branch-defaults") { |