Bug 20942: (QA follow-up) Use $lines->total_outstanding
This patch makes the controller code use $lines->total_outstanding
instead of expecting ->outstanding_debits and ->outstanding_credits
return the total.
Tests should pass as before. No behaviour change is expected.
To test:
- Run:
$ kshell
k$ prove t/db_dependent/api/v1/patrons_accounts.t
=> SUCCESS: Tests still pass, no behaviour change.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6672b26d16)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
66faf4dd1c
commit
a73d45534f
|
|
@ -50,19 +50,19 @@ sub get {
|
|||
|
||||
$balance->{balance} = $account->balance;
|
||||
|
||||
# get outstanding debits
|
||||
my ( $debits_total, $debits ) = $account->outstanding_debits;
|
||||
my ( $credits_total, $credits ) = $account->outstanding_credits;
|
||||
# get outstanding debits and credits
|
||||
my $debits = $account->outstanding_debits;
|
||||
my $credits = $account->outstanding_credits;
|
||||
|
||||
my @debit_lines = map { _to_api( $_->TO_JSON ) } @{ $debits->as_list };
|
||||
$balance->{outstanding_debits} = {
|
||||
total => $debits_total,
|
||||
total => $debits->total_outstanding,
|
||||
lines => \@debit_lines
|
||||
};
|
||||
|
||||
my @credit_lines = map { _to_api( $_->TO_JSON ) } @{ $credits->as_list };
|
||||
$balance->{outstanding_credits} = {
|
||||
total => $credits_total,
|
||||
total => $credits->total_outstanding,
|
||||
lines => \@credit_lines
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue