From 1eb8f431f48192d94b4f0cc6016b032a74d7d8e7 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 26 Oct 2023 18:52:24 +0000 Subject: [PATCH] Bug 33264: Add information about both blocking/non-blocking fines/fees to blocked-fines.inc 1. Go to Administration > Item types and add a rental charge to an item type. 2. Check out some items of that type to a patron. 3. Go to Debit Types -> RENT and check "Included in noissuescharge?" 3. Now you will see those rental changes on both the checkout and detail pages, checkouts are blocked 4. Go to Debit Types -> RENT and uncheck "Included in noissuescharge?" 5. Now you see no information about the rental charges on the checkout/detail pages. 6. APPLY PATCH, restart services 7. Now check the morememember.pl and cicruclation.pl pages. You should see information about both blocking/non-blocking charges on both of the pages. 8. Turn on BatchCheckout 9. Now from the patrons batch checkout screen make sure the information appears for both blocking/non-blocking charges. --- circ/circulation.pl | 5 ++++- koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc | 7 +++++-- .../intranet-tmpl/prog/en/includes/patron_messages.inc | 1 - members/moremember.pl | 7 ++++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index d68eb1ce5f8..d854cc01765 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -491,10 +491,13 @@ if ( $patron ) { $noissues = 1; } my $account = $patron->account; - if( ( my $owing = $account->non_issues_charges ) > 0 ) { + my $owing = $account->non_issues_charges; + my $issues_charges = $balance - $owing; + if( $owing > 0 || $issues_charges > 0 ) { my $noissuescharge = C4::Context->preference("noissuescharge") || 5; # FIXME If noissuescharge == 0 then 5, why?? $noissues ||= ( not C4::Context->preference("AllowFineOverride") and ( $owing > $noissuescharge ) ); $template->param( + fees => $issues_charges, charges => 1, chargesamount => $owing, ) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc index b53f98d2f65..fcf597289cc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc @@ -1,12 +1,15 @@ [% USE Price %] [% SET NoIssuesCharge = Koha.Preference('noissuescharge') %] -[% IF fines and fines > 0 %] +[% IF fines and fines > 0 || fees and fees > 0 %]
  • Charges: - Patron has outstanding charges of [% fines | $Price %]. + Patron has outstanding charges of [% fines | $Price %] that count towards blocking. [% IF !Koha.Preference('AllowFineOverride') && NoIssuesCharge && fines > NoIssuesCharge %] Checkouts are BLOCKED because fine balance is OVER THE LIMIT. [% END %] + [% IF fees and fees > 0 %] + Patron has outstanding fees of [% fees | $Price %] that do not count towards blocking. + [% END%] [% IF CAN_user_updatecharges_remaining_permissions %] Make payment Pay all charges diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc index ca7e80a4b97..3854954602f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc @@ -98,7 +98,6 @@ [% IF age_limitations %] [% INCLUDE 'category-out-of-age-limit.inc' %] [% END %] - [% IF ( charges ) %] [% INCLUDE 'blocked-fines.inc' fines = chargesamount %] [% END %] diff --git a/members/moremember.pl b/members/moremember.pl index 97703648047..c7672940f84 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -241,10 +241,14 @@ my $issues = $patron->checkouts; my $balance = 0; $balance = $patron->account->balance; + my $account = $patron->account; -if( ( my $owing = $account->non_issues_charges ) > 0 ) { +my $owing = $account->non_issues_charges; +my $issues_charges = $balance - $owing; +if ( $owing > 0 || $issues_charges > 0 ) { my $noissuescharge = C4::Context->preference("noissuescharge") || 5; # FIXME If noissuescharge == 0 then 5, why?? $template->param( + fees => $issues_charges, charges => 1, chargesamount => $owing, ) @@ -288,6 +292,7 @@ elsif ( $patron->is_going_to_expire ) { my $has_modifications = Koha::Patron::Modifications->search( { borrowernumber => $borrowernumber } )->count; + $template->param( patron => $patron, issuecount => $patron->checkouts->count, -- 2.30.2