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

(-)a/Koha/Patron/Debarments.pm (-15 / +21 lines)
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
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-5 / +5 lines)
Lines 89-101 Patrons: Link Here
89
         - pref: DebarmentsToLiftAfterPayment
89
         - pref: DebarmentsToLiftAfterPayment
90
           type: textarea
90
           type: textarea
91
           class: code
91
           class: code
92
         - Lift these debarments after Borrower has paid his/her fees
92
         - Lift these debarments after Borrower has paid his/her fees. Matches dynamic content in debarment comment.
93
         - "<p>Example, debarment is lifted after all fees are paid:</p>"
93
         - "<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>"
94
         - "<pre>Debarment message:</pre>
94
         - "<pre>Debarment message:</pre>
95
            <pre>  outstanding: 0</pre>"
95
            <pre>  outstanding: 0</pre>"
96
         - "<p>Example, debarment is lifted after payment with outstanding fees less or equal than 5:</p>"
96
         - "<p>Example, debarment with message of exactly 'Debarment message' is lifted after payment with outstanding fees less or equal than 5:</p>"
97
         - "<pre>Another debarment:</pre>
97
         - "<pre>^Debarment message$:</pre>
98
            <pre>  outstanding: 5.00</pre>"
98
            <pre>  outstanding: 5.00</pre>"
99
         - You can use regex in the definitions to match your needs.
99
    Membership expiry:
100
    Membership expiry:
100
     -
101
     -
101
         - When renewing borrowers, base the new expiry date on
102
         - When renewing borrowers, base the new expiry date on
102
- 

Return to bug 16223