Bugzilla – Attachment 114273 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 removals
0002-Bug-16223-Enable-regex-match-for-rules-of-debarment-.patch (text/plain), 4.26 KB, created by
Emmi Takkinen
on 2020-12-09 07:54:01 UTC
(
hide
)
Description:
Bug 16223: Enable regex match for rules of debarment removals
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2020-12-09 07:54:01 UTC
Size:
4.26 KB
patch
obsolete
>From 91eade153d31ae917fb3c830d601559de6480432 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 > >Rebased-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >--- > Koha/Patron/Debarments.pm | 36 +++++++++++-------- > .../en/modules/admin/preferences/patrons.pref | 11 +++--- > 2 files changed, 27 insertions(+), 20 deletions(-) > >diff --git a/Koha/Patron/Debarments.pm b/Koha/Patron/Debarments.pm >index 36cd70eb5b..144f01ac97 100644 >--- a/Koha/Patron/Debarments.pm >+++ b/Koha/Patron/Debarments.pm >@@ -326,22 +326,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 b59ca05605..dde86522d5 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 >@@ -98,13 +98,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> >- <pre> outstanding: 5.00</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. > Membership expiry: > - > - When renewing borrowers, base the new expiry date on >-- >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