Can't submit a partial return on POS invoice

On the POS module, when i issue a sales invoice and make a partial return after, it gives me an error message saying “Total payments amount can’t be greater than (value of return)”… how can i fix this?

I raised the Pull Request regarding the issue so you can track it there.