That unexpected behavior can be caused by a corrupted file, iMetal. I'll share a few steps to fix it.
First, let's remove the discount item from the invoice. Here's how:
Then, let's run the Verify/Rebuild utility to detect the data damage. Here's how:
Lastly, let's pull up the Sales by Customer Detail report. This way, you'll see the discounts applied to invoices. Here's how:
You can also customize the report, add or delete columns and add or remove information.
Feel free to shoot a comment below if you need more help with this.