View | Details | Raw Unified | Return to bug 16223
Collapse All | Expand All

(-)a/Koha/Patron/Debarments.pm (-15 / +21 lines)
Lines 311-332 sub DelDebarmentsAfterPayment { Link Here
311
    my ( $total_due, $accts, $numaccts ) = C4::Members::GetMemberAccountRecords($borrowernumber);
311
    my ( $total_due, $accts, $numaccts ) = C4::Members::GetMemberAccountRecords($borrowernumber);
312
312
313
    foreach my $debarment (@{ $debarments }){
313
    foreach my $debarment (@{ $debarments }){
314
        if (exists $liftDebarmentRules->{$debarment->{'comment'}}) {
314
        my $rule;
315
            # Delete debarment IF:
315
316
            # 1. there is no maximum outstanding fines defined for the liftDebarmentRule
316
        foreach my $liftRule (keys $liftDebarmentRules){
317
            #    and there is no outstanding fines.
317
            my $comment = $debarment->{'comment'};
318
            # 2. there is a maximum outstanding fines amount defined
318
            $rule = $liftRule if $comment =~ $liftRule;
319
            #    and total_due is smaller or equal than the defined maximum outstanding amount
319
        }
320
            # Otherwise, do not lift the debarment.
320
        next unless $rule;
321
            if (not defined $liftDebarmentRules->{$debarment->{'comment'}}->{'outstanding'}){
321
322
                if ($total_due <= 0) {
322
        # Delete debarment IF:
323
                    DelDebarment($debarment->{'borrower_debarment_id'});
323
        # 1. there is no maximum outstanding fines defined for the liftDebarmentRule
324
                }
324
        #    and there is no outstanding fines.
325
        # 2. there is a maximum outstanding fines amount defined
326
        #    and total_due is smaller or equal than the defined maximum outstanding amount
327
        # Otherwise, do not lift the debarment.
328
        if (not defined $liftDebarmentRules->{$rule}->{'outstanding'}){
329
            if ($total_due <= 0) {
330
                DelDebarment($debarment->{'borrower_debarment_id'});
325
            }
331
            }
326
            else {
332
        }
327
                if ($total_due <= $liftDebarmentRules->{$debarment->{'comment'}}->{'outstanding'}) {
333
        else {
328
                    DelDebarment($debarment->{'borrower_debarment_id'});
334
            if ($total_due <= $liftDebarmentRules->{$rule}->{'outstanding'}) {
329
                }
335
                DelDebarment($debarment->{'borrower_debarment_id'});
330
            }
336
            }
331
        }
337
        }
332
    }
338
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-5 / +5 lines)
Lines 53-65 Patrons: Link Here
53
         - pref: DebarmentsToLiftAfterPayment
53
         - pref: DebarmentsToLiftAfterPayment
54
           type: textarea
54
           type: textarea
55
           class: code
55
           class: code
56
         - Lift these debarments after Borrower has paid his/her fees
56
         - Lift these debarments after Borrower has paid his/her fees. Matches dynamic content in debarment comment.
57
         - "<p>Example, debarment is lifted after all fees are paid:</p>"
57
         - "<p>Example, debarments with comment (either exact match or dynamic content, e.g. 'Debarment message for Patron 123') that match 'Debarment message' are lifted after all fees are paid:</p>"
58
         - "<pre>Debarment message:</pre>
58
         - "<pre>Debarment message:</pre>
59
            <pre>  outstanding: 0</pre>"
59
            <pre>  outstanding: 0</pre>"
60
         - "<p>Example, debarment is lifted after payment with outstanding fees less or equal than 5:</p>"
60
         - "<p>Example, debarment with message of exactly 'Debarment message' is lifted after payment with outstanding fees less or equal than 5:</p>"
61
         - "<pre>Another debarment:</pre>
61
         - "<pre>^Debarment message$:</pre>
62
            <pre>  outstanding: 5.00</pre>"
62
            <pre>  outstanding: 5.00</pre>"
63
         - You can use regex in the definitions to match your needs.
63
     -
64
     -
64
         - pref: EnhancedMessagingPreferences
65
         - pref: EnhancedMessagingPreferences
65
           choices:
66
           choices:
66
- 

Return to bug 16223