protected function recomputeCommissions() {
        $transactions = $this->getTransactionsSelect();
        $this->rule->setTransactionsWhere($transactions->where, 't');

        foreach ($transactions->getAllRowsIterator() as $record) {       	
            $newCommission = new Pap_Db_Commission();
            $newCommission->setTypeId($record->get(Pap_Db_Table_Transactions::COMMISSIONTYPEID));
            $newCommission->setTier($record->get(Pap_Db_Table_Transactions::TIER));
            $newCommission->setGroupId($this->rule->getCommissionGroupId());          
            if ($record->get(Pap_Db_Table_Transactions::R_TYPE) == Pap_Common_Constants::TYPE_RECURRING) { 
            	$newCommission->setSubtype(Pap_Db_Table_Commissions::SUBTYPE_RECURRING);
            } else {
            	$newCommission->setSubtype(Pap_Db_Table_Commissions::SUBTYPE_NORMAL);
            }
            try {
            	$newCommission->loadFromData();
            } catch (Exception $e) {
            	$this->logMessage(sprintf("Error loading commission (%s)", $e->getMessage()));
            	return;
            }            
            $transaction = new Pap_Db_Transaction();
            $transaction->fillFromRecord($record);
            $transaction->recompute($newCommission);            
            $transaction->update();         
            $refundTransaction = $transaction->getRefundOrChargebackTransaction();
            if (!is_null($refundTransaction) &&
                    $refundTransaction->getStatus() != Pap_Common_Constants::STATUS_DECLINED &&
                    $refundTransaction->getPayoutStatus() == Pap_Common_Constants::PSTATUS_UNPAID) {
                $refundTransaction->recompute($newCommission);
                $refundTransaction->update();
            }
        }
        $this->logMessage(sprintf("Transactions were updated based on new commission group %s", $this->rule->getCommissionGroupId()));
    }