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

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

Return to bug 16223