Bugzilla – Attachment 181297 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: (follow-up) Use Koha::Patron->account methods
Bug-38532-follow-up-Use-KohaPatron-account-methods.patch (text/plain), 2.42 KB, created by
Martin Renvoize (ashimema)
on 2025-04-22 16:00:02 UTC
(
hide
)
Description:
Bug 38532: (follow-up) Use Koha::Patron->account methods
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-04-22 16:00:02 UTC
Size:
2.42 KB
patch
obsolete
>From 493abc5b8412ab85c93a01303cb74b2a469f02d0 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Tue, 22 Apr 2025 16:58:07 +0100 >Subject: [PATCH] Bug 38532: (follow-up) Use Koha::Patron->account methods > >Update the patch to use Koha::Account and it's associated 'outstanding' >methods to ensure we accurately portray outstanding amounts rather than >'all credits' totals. > >I also remove the unused `$balance` variable from the >members/moremember.pl controller. >--- > circ/circulation.pl | 5 +++-- > members/moremember.pl | 8 ++------ > 2 files changed, 5 insertions(+), 8 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 034a6a6969c..154b15c7c00 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -627,8 +627,7 @@ 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 = >@@ -640,6 +639,8 @@ if ($patron) { > chargesamount => $patron_charge_limits->{noissuescharge}->{charge}, > ); > } >+ >+ my $credits_balance = $patron->account->outstanding_credits->total_outstanding; > if ( $credits_balance < 0 ) { > $template->param( > credits => 1, >diff --git a/members/moremember.pl b/members/moremember.pl >index 08c2f1a5826..2c7a32b88b2 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -235,12 +235,6 @@ if ( $patron->has_overdues ) { > } > 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( >@@ -248,6 +242,8 @@ if ( $patron_charge_limits->{noissuescharge}->{charge} > 0 ) { > chargesamount => $patron_charge_limits->{noissuescharge}->{charge}, > ); > } >+ >+my $credits_balance = $patron->account->outstanding_credits->total_outstanding; > if ( $credits_balance < 0 ) { > $template->param( > credits => 1, >-- >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