Bugzilla – Attachment 181296 Details for
Bug 38532
Show both credits and debits on checkouts and details tabs in staff
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38532: show both debits and credits in patron_messages
Bug-38532-show-both-debits-and-credits-in-patronme.patch (text/plain), 3.64 KB, created by
Martin Renvoize (ashimema)
on 2025-04-22 15:59:59 UTC
(
hide
)
Description:
Bug 38532: show both debits and credits in patron_messages
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-04-22 15:59:59 UTC
Size:
3.64 KB
patch
obsolete
>From e61bf1f217c3523cca163515397b61a684b8e030 Mon Sep 17 00:00:00 2001 >From: Andrew Fuerste Henry <andrew@bywatersolutions.com> >Date: Tue, 26 Nov 2024 18:23:14 +0000 >Subject: [PATCH] Bug 38532: show both debits and credits in patron_messages > >To test: >1: Have patrons with a variety of credit/debit combinations >2: Confirm Koha shows the total debit amount in patron_messages if any debits exist >3: Confirm Koha does not show anything about creditd in patron_messages if any debits exist >4: Apply patch, restart_all >5: Confirm all patrons show both debit total and credit total > >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > circ/circulation.pl | 7 +++++-- > .../intranet-tmpl/prog/en/includes/patron_messages.inc | 2 +- > members/moremember.pl | 8 ++++++-- > 3 files changed, 12 insertions(+), 5 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index e7732bfdc7b..034a6a6969c 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -627,6 +627,8 @@ if ($patron) { > $template->param( is_anonymous => 1 ); > $noissues = 1; > } >+ my $lines = Koha::Account::Lines->search( { borrowernumber => $patron->id } ); >+ my $credits_balance = $lines->credits_total; > my $patron_charge_limits = $patron->is_patron_inside_charge_limits(); > if ( $patron_charge_limits->{noissuescharge}->{charge} > 0 ) { > my $noissuescharge = >@@ -637,10 +639,11 @@ if ($patron) { > charges => 1, > chargesamount => $patron_charge_limits->{noissuescharge}->{charge}, > ); >- } elsif ( $balance < 0 ) { >+ } >+ if ( $credits_balance < 0 ) { > $template->param( > credits => 1, >- creditsamount => -$balance, >+ creditsamount => -$credits_balance, > ); > } > >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 39a9c0ecc6d..a8c92c0417d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >@@ -155,7 +155,7 @@ > [% END %] > > [% IF ( credits ) %] >- <li class="credits"> <span class="circ-hlt">Credits:</span> Patron has a credit[% IF ( creditsamount ) %]of <span class="credit"><strong>[% creditsamount | $Price %]</strong></span>[% END %] </li> >+ <li class="credits"> <span class="circ-hlt">Credits:</span> Patron has outstanding credits[% IF ( creditsamount ) %]of <span class="credit"><strong>[% creditsamount | $Price %]</strong></span>[% END %] </li> > [% END %] > [% IF (noissues && CAN_user_circulate_force_checkout && !moremember) %] > <li> >diff --git a/members/moremember.pl b/members/moremember.pl >index d08cef77a0e..08c2f1a5826 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -238,16 +238,20 @@ my $issues = $patron->checkouts; > my $balance = 0; > $balance = $patron->account->balance; > >+my $lines = Koha::Account::Lines->search( { borrowernumber => $patron->id } ); >+my $credits_balance = $lines->credits_total; >+ > my $patron_charge_limits = $patron->is_patron_inside_charge_limits(); > if ( $patron_charge_limits->{noissuescharge}->{charge} > 0 ) { > $template->param( > charges => 1, > chargesamount => $patron_charge_limits->{noissuescharge}->{charge}, > ); >-} elsif ( $balance < 0 ) { >+} >+if ( $credits_balance < 0 ) { > $template->param( > credits => 1, >- creditsamount => -$balance, >+ creditsamount => -$credits_balance, > ); > } > >-- >2.49.0
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 38532
:
174992
|
181296
|
181297
|
181298
|
181562
|
181563
|
181564
|
182011
|
182012
|
182013