Lines 289-310
sub DelDebarmentsAfterPayment {
Link Here
|
289 |
my $total_due = $lines->total_outstanding; |
289 |
my $total_due = $lines->total_outstanding; |
290 |
|
290 |
|
291 |
foreach my $debarment (@{ $debarments }){ |
291 |
foreach my $debarment (@{ $debarments }){ |
292 |
if (exists $liftDebarmentRules->{$debarment->{'comment'}}) { |
292 |
my $rule; |
293 |
# Delete debarment IF: |
293 |
|
294 |
# 1. there is no maximum outstanding fines defined for the liftDebarmentRule |
294 |
foreach my $liftRule (keys %{ $liftDebarmentRules }){ |
295 |
# and there is no outstanding fines. |
295 |
my $comment = $debarment->{'comment'}; |
296 |
# 2. there is a maximum outstanding fines amount defined |
296 |
$rule = $liftRule if $comment =~ $liftRule; |
297 |
# and total_due is smaller or equal than the defined maximum outstanding amount |
297 |
} |
298 |
# Otherwise, do not lift the debarment. |
298 |
next unless $rule; |
299 |
if (not defined $liftDebarmentRules->{$debarment->{'comment'}}->{'outstanding'}){ |
299 |
|
300 |
if ($total_due <= 0) { |
300 |
# Delete debarment IF: |
301 |
DelDebarment($debarment->{'borrower_debarment_id'}); |
301 |
# 1. there is no maximum outstanding fines defined for the liftDebarmentRule |
302 |
} |
302 |
# and there is no outstanding fines. |
|
|
303 |
# 2. there is a maximum outstanding fines amount defined |
304 |
# and total_due is smaller or equal than the defined maximum outstanding amount |
305 |
# Otherwise, do not lift the debarment. |
306 |
if (not defined $liftDebarmentRules->{$rule}->{'outstanding'}){ |
307 |
if ($total_due <= 0) { |
308 |
DelDebarment($debarment->{'borrower_debarment_id'}); |
303 |
} |
309 |
} |
304 |
else { |
310 |
} |
305 |
if ($total_due <= $liftDebarmentRules->{$debarment->{'comment'}}->{'outstanding'}) { |
311 |
else { |
306 |
DelDebarment($debarment->{'borrower_debarment_id'}); |
312 |
if ($total_due <= $liftDebarmentRules->{$rule}->{'outstanding'}) { |
307 |
} |
313 |
DelDebarment($debarment->{'borrower_debarment_id'}); |
308 |
} |
314 |
} |
309 |
} |
315 |
} |
310 |
} |
316 |
} |