/**
  *
  * @return Pap_Db_Commission
  */
 protected function getCommissionForTransaction() {
     $transactions = new Gpf_SqlBuilder_SelectBuilder();
     $transactions->select->add('c.'.Pap_Db_Table_Commissions::TYPE);
     $transactions->select->add('c.'.Pap_Db_Table_Commissions::VALUE);
     $transactions->where->add('t.'.Pap_Db_Table_Transactions::TRANSACTION_ID, '=', $this->transaction->getId());
     $transactions->where->add('c.'.Pap_Db_Table_Commissions::SUBTYPE,'=',self::getCommissionTypeFromTransaction($this->transaction->getType()));
     $this->initTransactionSql($transactions);
     
     $commission = new Pap_Db_Commission();
     $commission->fillFromRecord($transactions->getOneRow());
     return $commission;
 }
 /**
  * @param Pap_Db_Transaction $transaction
  * @return string
  */
 private function outputAddedTransacion(Pap_Db_Transaction $transaction) {
     $output = '';
     $output .= $this->outputln($this->_('Added transaction:'), 'font-weight: bold; color: green;');
     $output .= $this->output($this->_('Transaction ID'), 'font-weight: bold;') . ': ' . $transaction->getId() . ', ';
     $output .= $this->output($this->_('Parent transaction ID'), 'font-weight: bold;') . ': ' . $transaction->getParentTransactionId() . ', ';
     $output .= $this->output($this->_('Order ID'), 'font-weight: bold;') . ': ' . $transaction->getOrderId() . ', ';
     $output .= $this->output($this->_('Affiliate'), 'font-weight: bold;') . ': ' . $transaction->getUserId() . ', ';
     $output .= $this->output($this->_('TotalCost'), 'font-weight: bold;') . ': ' . $transaction->getTotalCost() . ', ';
     $output .= $this->output($this->_('Commission'), 'font-weight: bold;') . ': ' . $transaction->getCommission() . ', ';
     $output .= $this->output($this->_('Tier'), 'font-weight: bold;') . ': ' . $transaction->getTier();
     $output .= '<br />';
     return $output;
 }