As wholly says, you're forgetting that there's $97 available to you to split between your referral fee, the cash discount, and feature discounts.
I can't make heads or tails of where the logic is coming from for some of the items you've chosen to add up or subtract, so I'm just going to start from scratch myself and ignore the math above.
Available referral dollars: $97
Cash discount: $50
Cost of extra domain name: $15
First months payment: $10.95
Setup fee: $49.95
Barney signs up without any promo code. He has to pay $10.95 (first month) + $49.95 (signup fee) = $60.90.
Fred signs up with your promo code. He has to pay $10.95 (first month) + $49.95 (signup fee) - $50 (promo code discount) = $10.90.
In the second case, your referral fee is $97 (referral fee) - $50 (cash disount you gave) - $15 (feature discount you gave) = $32 (just like wholly said)
Extra lifetime domain and $82 off with code [color=#CC0000]1DOM82[/color] or use [color=#CC0000]LM97[/color] for $97 off. More Dreamhost coupons