Lines 101-109
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, 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=?, 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=?, 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 |
109 |
my $cat = $input->param('itemtype'); # item type |
109 |
my $cat = $input->param('itemtype'); # item type |
Lines 115-120
elsif ($op eq 'add') {
Link Here
|
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 $reservesallowed = $input->param('reservesallowed'); |
117 |
my $reservesallowed = $input->param('reservesallowed'); |
|
|
118 |
my $holdspickupdelay = $input->param('holdspickupdelay'); |
118 |
$maxissueqty =~ s/\s//g; |
119 |
$maxissueqty =~ s/\s//g; |
119 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
120 |
$maxissueqty = undef if $maxissueqty !~ /^\d+/; |
120 |
my $issuelength = $input->param('issuelength'); |
121 |
my $issuelength = $input->param('issuelength'); |
Lines 129-139
elsif ($op eq 'add') {
Link Here
|
129 |
$sth_search->execute($br,$bor,$cat); |
130 |
$sth_search->execute($br,$bor,$cat); |
130 |
my $res = $sth_search->fetchrow_hashref(); |
131 |
my $res = $sth_search->fetchrow_hashref(); |
131 |
if ($res->{total}) { |
132 |
if ($res->{total}) { |
132 |
$sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed, $renewalperiod, $reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat); |
133 |
$sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed, $renewalperiod, $reservesallowed, $holdspickupdelay, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat); |
133 |
} else { |
134 |
} else { |
134 |
$sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed, $renewalperiod, $reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$overduefinescap); |
135 |
$sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed, $renewalperiod, $reservesallowed, $holdspickupdelay, $issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$overduefinescap); |
135 |
} |
136 |
} |
136 |
} |
137 |
} |
137 |
elsif ($op eq "set-branch-defaults") { |
138 |
elsif ($op eq "set-branch-defaults") { |
138 |
my $categorycode = $input->param('categorycode'); |
139 |
my $categorycode = $input->param('categorycode'); |
139 |
my $maxissueqty = $input->param('maxissueqty'); |
140 |
my $maxissueqty = $input->param('maxissueqty'); |