Bug 21673 - Koha::Account::Lines->total_outstanding must be used when needed
Summary: Koha::Account::Lines->total_outstanding must be used when needed
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on: 13098
Blocks: 21696
  Show dependency treegraph
 
Reported: 2018-10-25 19:55 UTC by Jonathan Druart
Modified: 2020-01-06 20:14 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 21673: Use Koha::Account::Lines->total_amountoutstanding when needed (4.00 KB, patch)
2018-10-25 19:56 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21673: Use Koha::Account::Lines->total_amountoutstanding when needed (4.06 KB, patch)
2018-10-27 11:43 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 21673: (QA follow-up) Fix typo and remove unused library (1.32 KB, patch)
2018-10-27 11:43 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 21673: Use Koha::Account::Lines->total_amountoutstanding when needed (4.12 KB, patch)
2018-10-31 15:07 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 21673: (QA follow-up) Fix typo and remove unused library (1.38 KB, patch)
2018-10-31 15:07 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2018-10-25 19:55:21 UTC
There are several times the same pattern to retrieve the sum of amountoutstanding columns for Koha::Account::Line set.
We should use Koha::Account::Lines->total_outstanding instead.
Comment 1 Jonathan Druart 2018-10-25 19:56:34 UTC
Created attachment 81196 [details] [review]
Bug 21673: Use Koha::Account::Lines->total_amountoutstanding when needed

There are several times the same pattern to retrieve the sum of
amountoutstanding columns for Koha::Account::Line set.
We should use Koha::Account::Lines->total_outstanding instead.
Comment 2 Martin Renvoize 2018-10-26 19:10:51 UTC
Comment on attachment 81196 [details] [review]
Bug 21673: Use Koha::Account::Lines->total_amountoutstanding when needed

Review of attachment 81196 [details] [review]:
-----------------------------------------------------------------

::: Koha/Account/Lines.pm
@@ -46,4 @@
>  sub total_outstanding {
>      my ( $self ) = @_;
>  
> -    my $total = sum0( $self->get_column('amountoutstanding') );

You've removed the only use of sum0, but not removed the List::Util import above ;)
Comment 3 Tomás Cohen Arazi 2018-10-27 11:43:32 UTC
Created attachment 81355 [details] [review]
Bug 21673: Use Koha::Account::Lines->total_amountoutstanding when needed

There are several times the same pattern to retrieve the sum of
amountoutstanding columns for Koha::Account::Line set.
We should use Koha::Account::Lines->total_outstanding instead.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi 2018-10-27 11:43:39 UTC
Created attachment 81356 [details] [review]
Bug 21673: (QA follow-up) Fix typo and remove unused library

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Martin Renvoize 2018-10-31 15:07:46 UTC
Created attachment 81744 [details] [review]
Bug 21673: Use Koha::Account::Lines->total_amountoutstanding when needed

There are several times the same pattern to retrieve the sum of
amountoutstanding columns for Koha::Account::Line set.
We should use Koha::Account::Lines->total_outstanding instead.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2018-10-31 15:07:51 UTC
Created attachment 81745 [details] [review]
Bug 21673: (QA follow-up) Fix typo and remove unused library

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2018-10-31 15:08:48 UTC
Nice bit of cleaning up..

Passing QA
Comment 8 Nick Clemens 2018-11-06 17:56:26 UTC
Awesome work all!

Pushed to master for 18.11
Comment 9 Martin Renvoize 2018-11-16 12:35:50 UTC
Enhancement, will not be backported for 18.05.x series.