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, lengthunit, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount, overduefinescap) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'); |
104 |
my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, holdspickupdelay, 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=?, 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=?, reservesallowed=?, holdspickupdelay=?, 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 $reservesallowed = $input->param('reservesallowed'); |
116 |
my $reservesallowed = $input->param('reservesallowed'); |
|
|
117 |
my $holdspickupdelay = $input->param('holdspickupdelay'); |
117 |
$maxissueqty =~ s/\s//g; |
118 |
$maxissueqty =~ s/\s//g; |
118 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
119 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
119 |
my $issuelength = $input->param('issuelength'); |
120 |
my $issuelength = $input->param('issuelength'); |
Lines 128-136
elsif ($op eq 'add') {
Link Here
|
128 |
$sth_search->execute($br,$bor,$cat); |
129 |
$sth_search->execute($br,$bor,$cat); |
129 |
my $res = $sth_search->fetchrow_hashref(); |
130 |
my $res = $sth_search->fetchrow_hashref(); |
130 |
if ($res->{total}) { |
131 |
if ($res->{total}) { |
131 |
$sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat); |
132 |
$sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $holdspickupdelay, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat); |
132 |
} else { |
133 |
} else { |
133 |
$sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$overduefinescap); |
134 |
$sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed, $holdspickupdelay, $issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$overduefinescap); |
134 |
} |
135 |
} |
135 |
} |
136 |
} |
136 |
elsif ($op eq "set-branch-defaults") { |
137 |
elsif ($op eq "set-branch-defaults") { |