Cant change mode of payment of sales invoice return

when i make a sales invoice i am able to change the mode of payment in the payments table freely.

but when i make a sales return to that sales invoice for some reason the mode of payment always reverts back to the default mode of payment of the pos profile that was used in the invoice return after saving.

i tried checking the selling settings the system settings accounts settings pos setting and found nothing

i am not sure if this is a bug or i am missing something

this happens only in sales return and not in the invoice itself.


I have the same issue, please let me know do you get a solution already

Thank you.

I know its a late reply but just incase someone still has this issue,
i don’t understand why its there but i found 2 functions that apply this effect on returns only:

a python method “set_total_amount_to_default_mop” in erpnext/erpnext/controllers/

a js function “set_total_amount_to_default_mop” in erpnext/public/js/controllers/taxes_and_totals.js