Lines 82-89
if ($op eq 'save') {
Link Here
|
82 |
my @names=$input->param(); |
82 |
my @names=$input->param(); |
83 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total FROM overduerules WHERE branchcode=? AND categorycode=?"); |
83 |
my $sth_search = $dbh->prepare("SELECT count(*) AS total FROM overduerules WHERE branchcode=? AND categorycode=?"); |
84 |
|
84 |
|
85 |
my $sth_insert = $dbh->prepare("INSERT INTO overduerules (branchcode,categorycode, delay1,letter1,debarred1, delay2,letter2,debarred2, delay3,letter3,debarred3) VALUES (?,?,?,?,?,?,?,?,?,?,?)"); |
85 |
my $sth_insert = $dbh->prepare("INSERT INTO overduerules (branchcode,categorycode, delay1,letter1,debarred1,fine1, delay2,letter2,debarred2,fine2, delay3,letter3,debarred3,fine3) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); |
86 |
my $sth_update=$dbh->prepare("UPDATE overduerules SET delay1=?, letter1=?, debarred1=?, delay2=?, letter2=?, debarred2=?, delay3=?, letter3=?, debarred3=? WHERE branchcode=? AND categorycode=?"); |
86 |
my $sth_update=$dbh->prepare("UPDATE overduerules SET delay1=?, letter1=?, debarred1=?, fine1=?, delay2=?, letter2=?, debarred2=?, fine2=?, delay3=?, letter3=?, debarred3=?, fine3=? WHERE branchcode=? AND categorycode=?"); |
87 |
my $sth_delete=$dbh->prepare("DELETE FROM overduerules WHERE branchcode=? AND categorycode=?"); |
87 |
my $sth_delete=$dbh->prepare("DELETE FROM overduerules WHERE branchcode=? AND categorycode=?"); |
88 |
my $sth_insert_mtt = $dbh->prepare(" |
88 |
my $sth_insert_mtt = $dbh->prepare(" |
89 |
INSERT INTO overduerules_transport_types( |
89 |
INSERT INTO overduerules_transport_types( |
Lines 99-105
if ($op eq 'save') {
Link Here
|
99 |
|
99 |
|
100 |
foreach my $key (@names){ |
100 |
foreach my $key (@names){ |
101 |
# ISSUES |
101 |
# ISSUES |
102 |
if ($key =~ /(delay|letter|debarred)([1-3])-(.*)/) { |
102 |
if ($key =~ /(delay|letter|debarred|fine)([1-3])-(.*)/) { |
103 |
my $type = $1; # data type |
103 |
my $type = $1; # data type |
104 |
my $num = $2; # From 1 to 3 |
104 |
my $num = $2; # From 1 to 3 |
105 |
my $bor = $3; # borrower category |
105 |
my $bor = $3; # borrower category |
Lines 158-169
if ($op eq 'save') {
Link Here
|
158 |
($temphash{$bor}->{"delay1"}?$temphash{$bor}->{"delay1"}:undef), |
158 |
($temphash{$bor}->{"delay1"}?$temphash{$bor}->{"delay1"}:undef), |
159 |
($temphash{$bor}->{"letter1"}?$temphash{$bor}->{"letter1"}:""), |
159 |
($temphash{$bor}->{"letter1"}?$temphash{$bor}->{"letter1"}:""), |
160 |
($temphash{$bor}->{"debarred1"}?$temphash{$bor}->{"debarred1"}:0), |
160 |
($temphash{$bor}->{"debarred1"}?$temphash{$bor}->{"debarred1"}:0), |
|
|
161 |
($temphash{$bor}->{"fine1"}?$temphash{$bor}->{"fine1"}:0), |
161 |
($temphash{$bor}->{"delay2"}?$temphash{$bor}->{"delay2"}:undef), |
162 |
($temphash{$bor}->{"delay2"}?$temphash{$bor}->{"delay2"}:undef), |
162 |
($temphash{$bor}->{"letter2"}?$temphash{$bor}->{"letter2"}:""), |
163 |
($temphash{$bor}->{"letter2"}?$temphash{$bor}->{"letter2"}:""), |
163 |
($temphash{$bor}->{"debarred2"}?$temphash{$bor}->{"debarred2"}:0), |
164 |
($temphash{$bor}->{"debarred2"}?$temphash{$bor}->{"debarred2"}:0), |
|
|
165 |
($temphash{$bor}->{"fine2"}?$temphash{$bor}->{"fine2"}:0), |
164 |
($temphash{$bor}->{"delay3"}?$temphash{$bor}->{"delay3"}:undef), |
166 |
($temphash{$bor}->{"delay3"}?$temphash{$bor}->{"delay3"}:undef), |
165 |
($temphash{$bor}->{"letter3"}?$temphash{$bor}->{"letter3"}:""), |
167 |
($temphash{$bor}->{"letter3"}?$temphash{$bor}->{"letter3"}:""), |
166 |
($temphash{$bor}->{"debarred3"}?$temphash{$bor}->{"debarred3"}:0), |
168 |
($temphash{$bor}->{"debarred3"}?$temphash{$bor}->{"debarred3"}:0), |
|
|
169 |
($temphash{$bor}->{"fine3"}?$temphash{$bor}->{"fine3"}:0), |
167 |
$branch ,$bor |
170 |
$branch ,$bor |
168 |
); |
171 |
); |
169 |
} else { |
172 |
} else { |
Lines 171-182
if ($op eq 'save') {
Link Here
|
171 |
($temphash{$bor}->{"delay1"}?$temphash{$bor}->{"delay1"}:0), |
174 |
($temphash{$bor}->{"delay1"}?$temphash{$bor}->{"delay1"}:0), |
172 |
($temphash{$bor}->{"letter1"}?$temphash{$bor}->{"letter1"}:""), |
175 |
($temphash{$bor}->{"letter1"}?$temphash{$bor}->{"letter1"}:""), |
173 |
($temphash{$bor}->{"debarred1"}?$temphash{$bor}->{"debarred1"}:0), |
176 |
($temphash{$bor}->{"debarred1"}?$temphash{$bor}->{"debarred1"}:0), |
|
|
177 |
($temphash{$bor}->{"fine1"}?$temphash{$bor}->{"fine1"}:0), |
174 |
($temphash{$bor}->{"delay2"}?$temphash{$bor}->{"delay2"}:0), |
178 |
($temphash{$bor}->{"delay2"}?$temphash{$bor}->{"delay2"}:0), |
175 |
($temphash{$bor}->{"letter2"}?$temphash{$bor}->{"letter2"}:""), |
179 |
($temphash{$bor}->{"letter2"}?$temphash{$bor}->{"letter2"}:""), |
176 |
($temphash{$bor}->{"debarred2"}?$temphash{$bor}->{"debarred2"}:0), |
180 |
($temphash{$bor}->{"debarred2"}?$temphash{$bor}->{"debarred2"}:0), |
|
|
181 |
($temphash{$bor}->{"fine2"}?$temphash{$bor}->{"fine2"}:0), |
177 |
($temphash{$bor}->{"delay3"}?$temphash{$bor}->{"delay3"}:0), |
182 |
($temphash{$bor}->{"delay3"}?$temphash{$bor}->{"delay3"}:0), |
178 |
($temphash{$bor}->{"letter3"}?$temphash{$bor}->{"letter3"}:""), |
183 |
($temphash{$bor}->{"letter3"}?$temphash{$bor}->{"letter3"}:""), |
179 |
($temphash{$bor}->{"debarred3"}?$temphash{$bor}->{"debarred3"}:0) |
184 |
($temphash{$bor}->{"debarred3"}?$temphash{$bor}->{"debarred3"}:0), |
|
|
185 |
($temphash{$bor}->{"fine3"}?$temphash{$bor}->{"fine3"}:0), |
180 |
); |
186 |
); |
181 |
} |
187 |
} |
182 |
|
188 |
|
Lines 225-230
for my $data (@categories) {
Link Here
|
225 |
); |
231 |
); |
226 |
$row{delay}=$temphash{$data->{'categorycode'}}->{"delay$i"}; |
232 |
$row{delay}=$temphash{$data->{'categorycode'}}->{"delay$i"}; |
227 |
$row{debarred}=$temphash{$data->{'categorycode'}}->{"debarred$i"}; |
233 |
$row{debarred}=$temphash{$data->{'categorycode'}}->{"debarred$i"}; |
|
|
234 |
$row{fine}=$temphash{$data->{'categorycode'}}->{"fine$i"}; |
228 |
$row{selected_lettercode} = $temphash{ $data->{categorycode} }->{"letter$i"}; |
235 |
$row{selected_lettercode} = $temphash{ $data->{categorycode} }->{"letter$i"}; |
229 |
my @selected_mtts = @{ GetOverdueMessageTransportTypes( $branch, $data->{'categorycode'}, $i) }; |
236 |
my @selected_mtts = @{ GetOverdueMessageTransportTypes( $branch, $data->{'categorycode'}, $i) }; |
230 |
my @mtts; |
237 |
my @mtts; |
Lines 258-263
for my $data (@categories) {
Link Here
|
258 |
|
265 |
|
259 |
if ($dat->{"delay$i"}){$row{delay}=$dat->{"delay$i"};} |
266 |
if ($dat->{"delay$i"}){$row{delay}=$dat->{"delay$i"};} |
260 |
if ($dat->{"debarred$i"}){$row{debarred}=$dat->{"debarred$i"};} |
267 |
if ($dat->{"debarred$i"}){$row{debarred}=$dat->{"debarred$i"};} |
|
|
268 |
if ($dat->{"fine$i"}){$row{fine}=$dat->{"fine$i"};} |
261 |
my @selected_mtts = @{ GetOverdueMessageTransportTypes( $branch, $data->{'categorycode'}, $i) }; |
269 |
my @selected_mtts = @{ GetOverdueMessageTransportTypes( $branch, $data->{'categorycode'}, $i) }; |
262 |
my @mtts; |
270 |
my @mtts; |
263 |
for my $mtt ( @$message_transport_types ) { |
271 |
for my $mtt ( @$message_transport_types ) { |
264 |
- |
|
|