Browse Source

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>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
17.05.x
Jonathan Druart 7 years ago
committed by Kyle M Hall
parent
commit
90f9a3c6ac
  1. 2
      C4/Utils/DataTables/Members.pm
  2. 2
      circ/circulation.pl
  3. 3
      circ/returns.pl
  4. 2
      members/moremember.pl
  5. 8
      t/db_dependent/Reserves.t
  6. 2
      tools/cleanborrowers.pl

2
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);

2
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

3
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) );

2
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,

8
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)

2
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;
}

Loading…
Cancel
Save