Fixed bug in setDiscount and hasDiscount