From 95805aa43b05c1f2841cf08b79f0218ea374af07 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 8 May 2014 08:10:31 -0400 Subject: [PATCH] Bug 6427 [Part 25] - Fix inverted logic in GetMemberAccountBalance The total being treated as the total ammount of fines is actually the total amount of charges that are *not* fines. --- C4/Members.pm | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index f020abc..b3df466 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -1229,24 +1229,24 @@ sub GetMemberAccountBalance { unless ( C4::Context->preference('ManInvInNoissuesCharge') ) { my $dbh = C4::Context->dbh; - my $man_inv_types = $dbh->selectcol_arrayref( - qq{SELECT authorised_value FROM authorised_values WHERE category = 'MANUAL_INV'} - ); + my $man_inv_types = $dbh->selectcol_arrayref(q{ + SELECT authorised_value FROM authorised_values WHERE category = 'MANUAL_INV' + }); push( @not_fines, @$man_inv_types ); } - my $fines = + my $other_charges = Koha::Database->new()->schema->resultset('AccountDebit')->search( { borrowernumber => $borrowernumber, - type => { -not_in => \@not_fines } + type => { -in => \@not_fines } } )->get_column('amount_outstanding')->sum(); return ( $borrower->account_balance(), - $fines, - $borrower->account_balance() - $fines + $borrower->account_balance() - $other_charges, + $other_charges ); } -- 1.7.2.5