Issue #24846:correctly calculate percentpaid