The needed changes have been made and a new PR has been created
Fixing critical issues with Fees > Batch Payments #2656
Since the altered files are identical in master and openEMR5.0.2 they can be back ported and will work.
See the comments in the PR for full details.
Thanks