Discount code = free order = bug

Can anybody help?