Discount Resets After Saving Sales Invoice

Hello, I’m trying to add Discount on single item in Sales Invoice, but it seems that after saving the Sales Invoice, the Discount disappears.

This bug only happens when there are some margins on the item’s price though.
So if the pricelist of the item is $100, I sell it $110 ($10 margin), then give $5 flat discount (the final price would be $105 theorically). But after saving the Sales Invoice the $5 discount would disappear