Bugzilla – Attachment 99698 Details for
Bug 16223
Automatically remove any borrower debarments after a payment
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16223: Enable regex match for rules of debarment
0002-Bug-16223-Enable-regex-match-for-rules-of-debarment-.patch (text/plain), 4.14 KB, created by
Emmi Takkinen
on 2020-02-27 11:25:03 UTC
(
hide
)
Description:
Bug 16223: Enable regex match for rules of debarment
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2020-02-27 11:25:03 UTC
Size:
4.14 KB
patch
obsolete
>From 7ee5c50941c744af70266af961072804e5e6d8db Mon Sep 17 00:00:00 2001 >From: Lari Taskula <larit@student.uef.fi> >Date: Fri, 8 Apr 2016 13:26:26 +0000 >Subject: [PATCH 2/2] Bug 16223: Enable regex match for rules of debarment > removals > >--- > Koha/Patron/Debarments.pm | 36 +++++++++++-------- > .../en/modules/admin/preferences/patrons.pref | 9 ++--- > 2 files changed, 26 insertions(+), 19 deletions(-) > >diff --git a/Koha/Patron/Debarments.pm b/Koha/Patron/Debarments.pm >index 77b005295e..f8b1edae87 100644 >--- a/Koha/Patron/Debarments.pm >+++ b/Koha/Patron/Debarments.pm >@@ -289,22 +289,28 @@ sub DelDebarmentsAfterPayment { > my $total_due = $lines->total_outstanding; > > foreach my $debarment (@{ $debarments }){ >- if (exists $liftDebarmentRules->{$debarment->{'comment'}}) { >- # Delete debarment IF: >- # 1. there is no maximum outstanding fines defined for the liftDebarmentRule >- # and there is no outstanding fines. >- # 2. there is a maximum outstanding fines amount defined >- # and total_due is smaller or equal than the defined maximum outstanding amount >- # Otherwise, do not lift the debarment. >- if (not defined $liftDebarmentRules->{$debarment->{'comment'}}->{'outstanding'}){ >- if ($total_due <= 0) { >- DelDebarment($debarment->{'borrower_debarment_id'}); >- } >+ my $rule; >+ >+ foreach my $liftRule (keys %{ $liftDebarmentRules }){ >+ my $comment = $debarment->{'comment'}; >+ $rule = $liftRule if $comment =~ $liftRule; >+ } >+ next unless $rule; >+ >+ # Delete debarment IF: >+ # 1. there is no maximum outstanding fines defined for the liftDebarmentRule >+ # and there is no outstanding fines. >+ # 2. there is a maximum outstanding fines amount defined >+ # and total_due is smaller or equal than the defined maximum outstanding amount >+ # Otherwise, do not lift the debarment. >+ if (not defined $liftDebarmentRules->{$rule}->{'outstanding'}){ >+ if ($total_due <= 0) { >+ DelDebarment($debarment->{'borrower_debarment_id'}); > } >- else { >- if ($total_due <= $liftDebarmentRules->{$debarment->{'comment'}}->{'outstanding'}) { >- DelDebarment($debarment->{'borrower_debarment_id'}); >- } >+ } >+ else { >+ if ($total_due <= $liftDebarmentRules->{$rule}->{'outstanding'}) { >+ DelDebarment($debarment->{'borrower_debarment_id'}); > } > } > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index 3de84e5ac9..c3e6d6f6a7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -70,13 +70,14 @@ Patrons: > - pref: DebarmentsToLiftAfterPayment > type: textarea > class: code >- - Lift these debarments after Borrower has paid his/her fees >- - "<p>Example, debarment is lifted after all fees are paid:</p>" >+ - Lift these debarments after Borrower has paid his/her fees. Matches dynamic content in debarment comment. >+ - "<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>" > - "<pre>Debarment message:</pre> > <pre> outstanding: 0</pre>" >- - "<p>Example, debarment is lifted after payment with outstanding fees less or equal than 5:</p>" >- - "<pre>Another debarment:</pre> >+ - "<p>Example, debarment with message of exactly 'Debarment message' is lifted after payment with outstanding fees less or equal than 5:</p>" >+ - "<pre>^Debarment message$:</pre> > <pre> outstanding: 5.00</pre>" >+ - You can use regex in the definitions to match your needs. > - > - pref: EnhancedMessagingPreferences > choices: >-- >2.17.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16223
:
50078
|
50084
|
99697
|
99698
|
104399
|
104400
|
114272
|
114273
|
118526
|
118572
|
118574
|
118575
|
122768
|
122769
|
127252
|
128005
|
132284
|
132285
|
132286
|
132287
|
143388
|
143389
|
143390
|
143462
|
143670
|
143671
|
143672
|
143688
|
143689
|
143690
|
143765
|
143766
|
143767
|
143768
|
143769
|
143770
|
143936
|
146051
|
146052
|
146053
|
146054
|
146055
|
146056
|
146057
|
148307
|
148308
|
148309
|
148310
|
148311
|
148312
|
148313
|
150024
|
150025
|
150026
|
150027
|
150028
|
150029
|
153024
|
153025
|
153026
|
153027
|
153028
|
153029
|
155644
|
155645
|
155646
|
155647
|
155648
|
155649
|
155650
|
156841
|
156842
|
156843
|
156844
|
156845
|
156846
|
156847
|
156848
|
156849
|
156850