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)