The discount amount of the code is deducted from the creator's referral $.
If someone uses an affiliate link AND a promo code, then the creator of the code will get the money (unless his or her code deducts the maximum $97.) Unfortunately, the person whose affiliate link was used will receive zilch.