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

(-)a/Koha/Patron/Debarments.pm (-15 / +21 lines)
Lines 326-347 sub DelDebarmentsAfterPayment { Link Here
326
    my $total_due = $lines->total_outstanding;
326
    my $total_due = $lines->total_outstanding;
327
327
328
    foreach my $debarment (@{ $debarments }){
328
    foreach my $debarment (@{ $debarments }){
329
        if (exists $liftDebarmentRules->{$debarment->{'comment'}}) {
329
        my $rule;
330
            # Delete debarment IF:
330
331
            # 1. there is no maximum outstanding fines defined for the liftDebarmentRule
331
        foreach my $liftRule (keys %{ $liftDebarmentRules }){
332
            #    and there is no outstanding fines.
332
            my $comment = $debarment->{'comment'};
333
            # 2. there is a maximum outstanding fines amount defined
333
            $rule = $liftRule if $comment =~ $liftRule;
334
            #    and total_due is smaller or equal than the defined maximum outstanding amount
334
        }
335
            # Otherwise, do not lift the debarment.
335
        next unless $rule;
336
            if (not defined $liftDebarmentRules->{$debarment->{'comment'}}->{'outstanding'}){
336
337
                if ($total_due <= 0) {
337
        # Delete debarment IF:
338
                    DelDebarment($debarment->{'borrower_debarment_id'});
338
        # 1. there is no maximum outstanding fines defined for the liftDebarmentRule
339
                }
339
        #    and there is no outstanding fines.
340
        # 2. there is a maximum outstanding fines amount defined
341
        #    and total_due is smaller or equal than the defined maximum outstanding amount
342
        # Otherwise, do not lift the debarment.
343
        if (not defined $liftDebarmentRules->{$rule}->{'outstanding'}){
344
            if ($total_due <= 0) {
345
                DelDebarment($debarment->{'borrower_debarment_id'});
340
            }
346
            }
341
            else {
347
        }
342
                if ($total_due <= $liftDebarmentRules->{$debarment->{'comment'}}->{'outstanding'}) {
348
        else {
343
                    DelDebarment($debarment->{'borrower_debarment_id'});
349
            if ($total_due <= $liftDebarmentRules->{$rule}->{'outstanding'}) {
344
                }
350
                DelDebarment($debarment->{'borrower_debarment_id'});
345
            }
351
            }
346
        }
352
        }
347
    }
353
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-6 / +6 lines)
Lines 98-110 Patrons: Link Here
98
         - pref: DebarmentsToLiftAfterPayment
98
         - pref: DebarmentsToLiftAfterPayment
99
           type: textarea
99
           type: textarea
100
           class: code
100
           class: code
101
         - Lift these debarments after Borrower has paid his/her fees
101
         - Lift these debarments after Borrower has paid his/her fees. Matches dynamic content in debarment comment.
102
         - "<p>Example, debarment is lifted after all fees are paid:</p>"
102
         - "<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>"
103
         - "<pre>Debarment message:</pre>
103
         - "<pre>Debarment message:</pre>
104
            <pre>  outstanding: 0</pre>"
104
            <pre>  outstanding: 0</pre>"
105
         - "<p>Example, debarment is lifted after payment with outstanding fees less or equal than 5:</p>"
105
         - "<p>Example, debarment with message of exactly 'Debarment message' is lifted after payment with outstanding fees less or equal than 5:</p>"
106
         - "<pre>Another debarment:</pre>
106
         - "<pre>^Debarment message$:</pre>
107
            <pre>  outstanding: 5.00</pre>"    
107
            <pre>  outstanding: 5.00</pre>"
108
         - You can use regex in the definitions to match your needs.
108
    Membership expiry:
109
    Membership expiry:
109
     -
110
     -
110
         - When renewing borrowers, base the new expiry date on
111
         - When renewing borrowers, base the new expiry date on
111
- 

Return to bug 16223