When calculating the Discount in an Invoice, Infusion Business Software looks at the Line Value, not the Unit sell price.
This is best explained by looking at the example below
The math used on the top line with 10 supplied
(10*.90) minus (10*.90-.04)=8.64
The same calculation is then used in the second line
(1*.90)minus (1*.09-.04) =.86
This is based on using two decimal places in the Product defaults. Even at three or four decimal places there are possibilities for rounding issues.