Пример #1
0
 /**
  * @return Pap_Db_PayoutHistory
  */
 public function getPayoutHistoryItem() {
     $historyItem = new Pap_Db_PayoutHistory();        
     $historyItem->setId($this->getPayoutHistoryId());
     try {
         $historyItem->load();
     } catch (Gpf_Exception $e) {
         return null;
     }
     return $historyItem;
 }
Пример #2
0
    private function migratePayoutHistory() {
    	echo "  Migrating payout history.....";
    	
    	$selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
        $selectBuilder->select->add('*');
        $selectBuilder->from->add('wd_pa_accounting');

        $count = 0;
        foreach($selectBuilder->getAllRowsIterator() as $record) {
        	$obj = new Pap_Db_PayoutHistory();
        	$obj->set('payouthistoryid', $record->get('accountingid'));
        	$obj->set('dateinserted', $record->get('dateinserted'));
        	$obj->set('merchantnote', $record->get('note'));
        	$obj->set('datefrom', $record->get('datefrom'));
        	$obj->set('dateto', $record->get('dateto'));
        	if($record->get('wirefile') != '') {
        		$obj->set('exportfile', $record->get('wirefile'));
        	}
        	$obj->save();
        	
        	$this->payoutHistoryIds[] = $record->get('accountingid');
        	$count++;
        }
        
    	echo " ($count) ..... DONE<br/>";
    }    
 /**
  * @return Pap_Db_PayoutHistory
  */
 private function createPayoutHistoryItem(Gpf_Rpc_Form $form) {
     $payoutHistory = new Pap_Db_PayoutHistory();
     $payoutHistory->setAffiliateNote($form->getFieldValue("affiliateNote"));
     $payoutHistory->setMerchantNote($form->getFieldValue("paymentNote"));
     $payoutHistory->setDateInserted(Gpf_Common_DateUtils::now());
     $payoutHistory->setAccountId(Gpf_Application::getInstance()->getAccountId());
     $payoutHistory->save();
     
     return $payoutHistory;
 }