From 1e40f2bb81126814120b6c3113624d8a36378e4e Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 18 Dec 2025 16:42:14 +0000 Subject: [PATCH] Bug 33228: Display all fines on patron details and circulation This patch adds the patrons total balance to the details and circulation pages Only showing totla if different from the no account charges To test: 1 - Go to Administration - Debit types 2 - Add a new type: Code: BLOCK Description: Blocking fine Default amount: 1.00 Can be manually invoiced: checked Included in noissuescharge: checked 3 - Add a new type: Code: NoBLOCK Description: NonBlocking fine Default amount: 1.11 Can be manually invoiced: checked Included in noissuescharge: checked 4 - Find a patron 5 - Accounting->Create manual invoice 6 - Add 2 of each type of debit you created 7 - View patrons 'details' and 'Check out' tabs 8 - Confirm you see only the 2 blocking fees totaled 9 - Apply patch 10 - Reload 11 - Confirm you see 'Total balance: 4.22' Charges: Patron has outstanding charges that may block checkout of 2.00. 12 - Write off the two non-block charges 13 - Confirm you no longer see the 'Total balance' (as it now matches) 14 - Write off the blocking charges and add two non-blocking 15 - Confirm you see the total balance --- circ/circulation.pl | 4 ++++ .../prog/en/includes/blocked-fines.inc | 15 ++++++++++----- .../prog/en/includes/patron_messages.inc | 6 +++--- members/moremember.pl | 5 +++++ 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index dddd2a1f5f9..ddcdb4adf7d 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -643,6 +643,10 @@ if ($patron) { $noissues = 1; } + my $account_balance = $patron->account->balance(); + $template->param( + account_balance => $account_balance, + ); my $patron_charge_limits = $patron->is_patron_inside_charge_limits(); if ( $patron_charge_limits->{noissuescharge}->{charge} > 0 ) { my $noissuescharge = 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 4868e3cbb4d..63dc53dd49a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc @@ -1,15 +1,20 @@ [% USE Price %] [% USE Categories %] +[% IF account_balance && account_balance != NoIssueCharge %] +
  • Total balance: [% account_balance | $Price %]
  • +[% END %] [% IF NoIssuesCharge and NoIssuesCharge > 0 %]
  • Charges: - Patron has outstanding charges of [% NoIssuesCharge | $Price %]. + Patron has outstanding charges that may block checkouts of [% NoIssuesCharge | $Price %]. [% IF !Koha.Preference('AllowFineOverride') && NoIssuesCharge.limit && NoIssuesCharge.overlimit %] Checkouts are BLOCKED because fine balance is OVER THE LIMIT. [% END %] - [% IF CAN_user_updatecharges_remaining_permissions %] - Make payment - Pay all charges - [% END %]
  • [% END %] +
  • + [% IF CAN_user_updatecharges_remaining_permissions %] + Make payment + Pay all charges + [% END %] +
  • 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 93ce0b53bed..343d2f302c6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc @@ -5,7 +5,7 @@ [% SET return_claims = patron.return_claims %] [% SET logged_in_branchcode = Branches.GetLoggedInBranchcode() %] -[% IF ( has_modifications || warndeparture || returnbeforeexpiry || expired || patron.gonenoaddress || patron.lost || userdebarred || odues || ( return_claims.count > ClaimReturnedWarningThreshold ) || age_limitations || limited_category || charges || charges_guarantors_guarantees || charges_guarantees || credits || patron.account_locked ) %] +[% IF ( has_modifications || warndeparture || returnbeforeexpiry || expired || patron.gonenoaddress || patron.lost || userdebarred || odues || ( return_claims.count > ClaimReturnedWarningThreshold ) || age_limitations || limited_category || account_balance || charges || charges_guarantors_guarantees || charges_guarantees || credits || patron.account_locked ) %]

    Attention