Wrong Balance quantity in sales invoice in case of multiple sales invoices against a sales order

I created a sales order for 10 items and then created a sales invoice for 5 items with an item discount of 10%.
Next time when I try to create sales invoice for rest of the 5 items, against the same sales order, the system show quantity as 5.5.

What I notice is the balance quantity is reverse calculated from the un-discounted order total. Is this a bug or do I need to change any setting while adding discount on sales invoice.