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, reservesallowed, issuelength, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); |
104 |
my $sth_insert = $dbh->prepare("INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, fine, finedays, firstremind, chargeperiod,rentaldiscount, reservesmaxpickupdelay, rentaldiscount) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); |
105 |
my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, hardduedate=?, hardduedatecompare=?, rentaldiscount=? WHERE branchcode=? AND categorycode=? AND itemtype=?"); |
105 |
my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, rentaldiscount=?, reservesmaxpickupdelay=?, rentaldiscount=? 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 121-134
elsif ($op eq 'add') {
Link Here
|
121 |
$hardduedate = format_date_in_iso($hardduedate); |
121 |
$hardduedate = format_date_in_iso($hardduedate); |
122 |
my $hardduedatecompare = $input->param('hardduedatecompare'); |
122 |
my $hardduedatecompare = $input->param('hardduedatecompare'); |
123 |
my $rentaldiscount = $input->param('rentaldiscount'); |
123 |
my $rentaldiscount = $input->param('rentaldiscount'); |
|
|
124 |
my $reservesmaxpickupdelay = $input->param('reservesmaxpickupdelay'); |
124 |
$debug and warn "Adding $br, $bor, $cat, $fine, $maxissueqty"; |
125 |
$debug and warn "Adding $br, $bor, $cat, $fine, $maxissueqty"; |
125 |
|
126 |
|
126 |
$sth_search->execute($br,$bor,$cat); |
127 |
$sth_search->execute($br,$bor,$cat); |
127 |
my $res = $sth_search->fetchrow_hashref(); |
128 |
my $res = $sth_search->fetchrow_hashref(); |
128 |
if ($res->{total}) { |
129 |
if ($res->{total}) { |
129 |
$sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$hardduedate,$hardduedatecompare,$rentaldiscount, $br,$bor,$cat); |
130 |
$sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$rentaldiscount, $reservesmaxpickupdelay, $rentaldiscount, $br,$bor,$cat); |
130 |
} else { |
131 |
} else { |
131 |
$sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount); |
132 |
$sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$reservesmaxpickupdelay,$rentaldiscount); |
132 |
} |
133 |
} |
133 |
} |
134 |
} |
134 |
elsif ($op eq "set-branch-defaults") { |
135 |
elsif ($op eq "set-branch-defaults") { |