Bug 14882: Librarians are not warned if patron owe more than maxoutstanding when...
authorKyle M Hall <kyle@bywatersolutions.com>
Wed, 23 Sep 2015 14:38:32 +0000 (10:38 -0400)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 25 Sep 2015 18:37:11 +0000 (15:37 -0300)
If a patron owes more than the system preference maxoutstanding in fees
and fines, the patron will be unable to place holds via the opac.
However, a librarian placing a hold for a patron is not even warned!

Test Plan:
1) Apply this patch
2) Set maxoutstanding to 1.00
3) Find a patron owing more than 1.00
4) Attempt to place a hold
5) Note the warning that the patron owes money

Works as expected.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
reserve/request.pl

index 02be79a..d251752 100644 (file)
@@ -1,3 +1,4 @@
+[% USE Koha %]
 [% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc' %]
 [% UNLESS ( multi_hold ) %]
@@ -332,6 +333,10 @@ function checkMultiHold() {
     <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %]</a>'s <strong>account has expired</strong></li>
     [% END %]
 
+    [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
+    <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %]</a> <strong>owes [% amount_outstanding | format('%.2f') %]</strong></li>
+    [% END %]
+
     [% IF ( diffbranch ) %]
     <li> <strong>Pickup library is different</strong> than <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %]</a>'s home library ([% borrower_branchname %] / [% borrower_branchcode %] )</li>
     [% END %]
index d32f7a0..fefe4b0 100755 (executable)
@@ -175,7 +175,8 @@ if ($borrowernumber_hold && !$action) {
                 expiry              => $expiry,
                 diffbranch          => $diffbranch,
                 messages            => $messages,
-                warnings            => $warnings
+                warnings            => $warnings,
+                amount_outstanding  => GetMemberAccountRecords($borrowerinfo->{borrowernumber}),
     );
 }