I figured out the problem. The discounts with the wrong sign are correct because they are AR discounts instead of AP discounts. Thanks to all for their thoughts...
When I change the discount to an income account, the amount is negative which is the opposite of what I expect because it is decreasing income instead of increa...