Bugzilla – Attachment 81329 Details for
Bug 21681
Remove C4::Accounts::getcharges
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21681: Remove C4::Accounts::getcharges
Bug-21681-Remove-C4Accountsgetcharges.patch (text/plain), 3.03 KB, created by
Martin Renvoize (ashimema)
on 2018-10-26 18:48:23 UTC
(
hide
)
Description:
Bug 21681: Remove C4::Accounts::getcharges
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-10-26 18:48:23 UTC
Size:
3.03 KB
patch
obsolete
>From c41a585285f1c99cdb4362dc9bcefa02120f7ef1 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Fri, 26 Oct 2018 10:05:11 +0000 >Subject: [PATCH] Bug 21681: Remove C4::Accounts::getcharges > >Test plan: >0) Do not apply the patch >1) Enable ILS-DI >2) Go to ><opac_url>/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=51&show_fines=1 >use patron with some paid and unpaid fines >3) Save the page for later usage >4) Apply the patch >5) Repeat 2 with same patron and compare the saved result with the new >one, they should be same >6) git grep getcharges should return no occurance >7) prove t/db_dependent/Accounts.t > >Co-authored-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Accounts.pm | 18 ------------------ > C4/ILSDI/Services.pm | 8 ++++---- > t/db_dependent/Accounts.t | 1 - > 3 files changed, 4 insertions(+), 23 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index 6281becbe8..f03752c543 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -39,7 +39,6 @@ BEGIN { > @EXPORT = qw( > &manualinvoice > &getnextacctno >- &getcharges > &chargelostitem > &ReversePayment > &purge_zero_balance_fees >@@ -280,23 +279,6 @@ sub manualinvoice { > return 0; > } > >-sub getcharges { >- my ( $borrowerno, $timestamp, $accountno ) = @_; >- my $dbh = C4::Context->dbh; >- my $timestamp2 = $timestamp - 1; >- my $query = ""; >- my $sth = $dbh->prepare( >- "SELECT * FROM accountlines WHERE borrowernumber=? AND accountno = ?" >- ); >- $sth->execute( $borrowerno, $accountno ); >- >- my @results; >- while ( my $data = $sth->fetchrow_hashref ) { >- push @results,$data; >- } >- return (@results); >-} >- > #FIXME: ReversePayment should be replaced with a Void Payment feature > sub ReversePayment { > my ($accountlines_id) = @_; >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index 4e0877a551..53465caa9d 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -425,11 +425,11 @@ sub GetPatronInfo { > > # Fines management > if ( $cgi->param('show_fines') && $cgi->param('show_fines') eq "1" ) { >- my @charges; >- for ( my $i = 1 ; my @charge = getcharges( $borrowernumber, undef, $i ) ; $i++ ) { >- push( @charges, @charge ); >+ >+ my $account_lines = $patron->account->lines; >+ while (my $line = $account_lines->next ) { >+ push @{ $borrower->{fines}{fine} }, $line->unblessed; > } >- $borrower->{'fines'}->{'fine'} = \@charges; > } > > # Reserves management >diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t >index 26a2957706..4c40012604 100644 >--- a/t/db_dependent/Accounts.t >+++ b/t/db_dependent/Accounts.t >@@ -44,7 +44,6 @@ can_ok( 'C4::Accounts', > getnextacctno > chargelostitem > manualinvoice >- getcharges > ReversePayment > purge_zero_balance_fees ) > ); >-- >2.19.1
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 21681
:
81269
|
81298
|
81306
|
81322
|
81325
|
81326
|
81327
| 81329 |
81330
|
81331