[Bug 30027] New: Koha::Account->payout_amount should not total the lines in perl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30027 Bug ID: 30027 Summary: Koha::Account->payout_amount should not total the lines in perl Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Fines and fees Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org 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) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30027 Johanna Räisä <johanna.raisa@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |johanna.raisa@koha-suomi.fi --- Comment #1 from Johanna Räisä <johanna.raisa@koha-suomi.fi> --- (In reply to Nick Clemens (kidclamp) from comment #0)
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)
I'm looking at a problem which relates to this, https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38972 Koha::Account::Lines->total_outstanding is calculating the outstanding little differently. I tried to replace $outstanding_credits with that in Koha::Account->payout_amount. In some cases the resultset is different, total_outstanding uses only amountoutstanding column and outstanding_credits uses also the amount column. Maybe these functions should be giving same results before total_outstanding could be used in the payout_amount function. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org