Hello,

Just found that variable $total is not defined here

 $comm->commission_notes = t('Level @level commission recorded for affiliate uid:@affiliate', array('@affiliate' => $aff, '@percent' => $comm_pct*100, '@level' => $level, '@commission' => uc_currency_format($comm), '@ordertotal' => uc_currency_format(<b>$total</b>), '@firstname' => $order->billing_first_name, '@lastname' => $order->billing_last_name));

Seems need to replace it into $commission.

Let me know how to fix it!

Thanks,
Vadim