Bugzilla – Attachment 59155 Details for
Bug 17588
Move GetMemberIssuesAndFines to Koha::Patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17588: get_account_lines->get_balance has been replace with account->balance
Bug-17588-getaccountlines-getbalance-has-been-repl.patch (text/plain), 5.54 KB, created by
Julian Maurice
on 2017-01-18 12:00:36 UTC
(
hide
)
Description:
Bug 17588: get_account_lines->get_balance has been replace with account->balance
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2017-01-18 12:00:36 UTC
Size:
5.54 KB
patch
obsolete
>From e2abad4362809446d3645330248d2c800586bf6d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 6 Dec 2016 09:22:11 +0100 >Subject: [PATCH] Bug 17588: get_account_lines->get_balance has been replace > with account->balance > >On previous bugs > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > C4/Utils/DataTables/Members.pm | 2 +- > circ/circulation.pl | 2 +- > circ/returns.pl | 3 +-- > members/moremember.pl | 2 +- > t/db_dependent/Reserves.t | 8 ++++---- > tools/cleanborrowers.pl | 2 +- > 6 files changed, 9 insertions(+), 10 deletions(-) > >diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm >index e4f12cc..64f75a3 100644 >--- a/C4/Utils/DataTables/Members.pm >+++ b/C4/Utils/DataTables/Members.pm >@@ -171,7 +171,7 @@ sub search { > my $patron_object = Koha::Patrons->find( $patron->{borrowernumber} ); > $patron->{overdues} = $patron_object->get_overdues->count; > $patron->{issues} = $patron_object->get_issues->count; >- my $balance = $patron_object->get_account_lines->get_balance; >+ my $balance = $patron_object->account->balance; > # FIXME Should be formatted from the template > $patron->{fines} = sprintf("%.2f", $balance); > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 82cc89e..10e695e 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -268,7 +268,7 @@ if ($borrowernumber) { > $borrower = GetMember( borrowernumber => $borrowernumber ); > my $overdues = $patron->get_overdues; > my $issues = $patron->get_issues; >- my $balance = $patron->get_account_lines->get_balance; >+ my $balance = $patron->account->balance; > > > # if the expiry date is before today ie they have expired >diff --git a/circ/returns.pl b/circ/returns.pl >index bc0e54c..9c37cb5 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -325,8 +325,7 @@ if ($barcode) { > > if ( C4::Context->preference("FineNotifyAtCheckin") ) { > my $patron = Koha::Patrons->find( $borrower->{borrowernumber} ); >- my $account_lines = $patron->get_account_lines; >- my $balance = $patron->get_account_lines->get_balance; >+ my $balance = $patron->account->balance; > > if ($balance > 0) { > $template->param( fines => sprintf("%.2f", $balance) ); >diff --git a/members/moremember.pl b/members/moremember.pl >index c6ce1cd..17c5436 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -121,7 +121,7 @@ $template->param( error => $error ) if ( $error ); > > my $patron = Koha::Patrons->find($borrowernumber); > my $issues = $patron->get_issues; >-my $balance = $patron->get_account_lines->get_balance; >+my $balance = $patron->account->balance; > $template->param( > issuecount => $issues->count, > fines => $balance, >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 8a63bde..a70a28a 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -572,7 +572,7 @@ ok( !C4::Reserves::OnShelfHoldsAllowed($item, $borrower), "OnShelfHoldsAllowed() > > $dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum)); > my $patron = Koha::Patrons->find( $borrowernumber ); >-my $bz14464_fines = $patron->get_account_lines->get_balance; >+my $bz14464_fines = $patron->account->balance; > is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines at beginning' ); > > # First, test cancelling a reserve when there's no charge configured. >@@ -599,7 +599,7 @@ CancelReserve({ reserve_id => $bz14464_reserve, charge_cancel_fee => 1 }); > my $old_reserve = Koha::Database->new()->schema()->resultset('OldReserve')->find( $bz14464_reserve ); > is($old_reserve->get_column('found'), 'W', 'Bug 14968 - Keep found column from reserve'); > >-$bz14464_fines = $patron->get_account_lines->get_balance; >+$bz14464_fines = $patron->account->balance; > is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge configured' ); > > # Then, test cancelling a reserve when there's no charge desired. >@@ -623,7 +623,7 @@ ok( $bz14464_reserve, 'Bug 14464 - 2nd reserve correctly created' ); > > CancelReserve({ reserve_id => $bz14464_reserve }); > >-$bz14464_fines = $patron->get_account_lines->get_balance; >+$bz14464_fines = $patron->account->balance; > is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge desired' ); > > # Finally, test cancelling a reserve when there's a charge desired and configured. >@@ -645,7 +645,7 @@ ok( $bz14464_reserve, 'Bug 14464 - 1st reserve correctly created' ); > > CancelReserve({ reserve_id => $bz14464_reserve, charge_cancel_fee => 1 }); > >-$bz14464_fines = $patron->get_account_lines->get_balance; >+$bz14464_fines = $patron->account->balance; > is( int( $bz14464_fines ), 42, 'Bug 14464 - Fine applied after cancelling reserve with charge desired and configured' ); > > # tests for MoveReserve in relation to ConfirmFutureHolds (BZ 14526) >diff --git a/tools/cleanborrowers.pl b/tools/cleanborrowers.pl >index d2713b5..be81573 100755 >--- a/tools/cleanborrowers.pl >+++ b/tools/cleanborrowers.pl >@@ -200,7 +200,7 @@ sub _skip_borrowers_with_nonzero_balance { > my $balance; > @$borrowers = map { > my $patron = Koha::Patrons->find( $_->{borrowernumber} ); >- my $balance = $patron->get_account_lines->get_balance; >+ my $balance = $patron->account->balance; > (defined $balance && $balance != 0) ? (): ($_); > } @$borrowers; > } >-- >2.1.4
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 17588
:
57339
|
57992
|
57993
|
58430
|
58759
|
58760
|
58761
|
59154
| 59155 |
59156