Bugzilla – Attachment 76641 Details for
Bug 20942
Add route to get patron's account balance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20942: (QA follow-up) Use $lines->total_outstanding
Bug-20942-QA-follow-up-Use-lines-totaloutstanding.patch (text/plain), 1.77 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-07-02 19:21:29 UTC
(
hide
)
Description:
Bug 20942: (QA follow-up) Use $lines->total_outstanding
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-07-02 19:21:29 UTC
Size:
1.77 KB
patch
obsolete
>From d4f580501ee911d3b59adac46610e023a3aeb066 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 2 Jul 2018 16:18:33 -0300 >Subject: [PATCH] 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> >--- > Koha/REST/V1/Patrons/Account.pm | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/Koha/REST/V1/Patrons/Account.pm b/Koha/REST/V1/Patrons/Account.pm >index 2003bde234..a431998628 100644 >--- a/Koha/REST/V1/Patrons/Account.pm >+++ b/Koha/REST/V1/Patrons/Account.pm >@@ -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 > }; > >-- >2.18.0
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 20942
:
76053
|
76054
|
76055
|
76393
|
76409
|
76410
|
76411
|
76412
|
76641
|
76808
|
76809
|
76810
|
76811
|
76812