Bug 30027 - Koha::Account->payout_amount should not total the lines in perl
Summary: Koha::Account->payout_amount should not total the lines in perl
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-04 15:53 UTC by Nick Clemens (kidclamp)
Modified: 2022-02-04 15:53 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2022-02-04 15:53:53 UTC
Currently the routine calls:
585     my $outstanding_credits =
586       exists( $params->{credits} )
587       ? $params->{credits}
588       : $self->outstanding_credits->as_list;
589     for my $credit ( @{$outstanding_credits} ) {
590         $outstanding += $credit->amountoutstanding;
591     }

We should instead call: Koha::Account::Lines->total_outstanding on the Resultlines in order to avoid floating point rounding errors


Currently we see some amounts for refunds Throwing a 500 error, and in plack-error.log:
Amount to payout (81.98) is higher than amountoutstanding (81.98)