Пример #1
0
 public function __construct()
 {
     parent::__construct();
     $vendor_id = $this->getRequest()->getParam('vendor_id', 0);
     $this->setId('vpaymentGrids_' . $vendor_id);
     $this->setDefaultSort('created_at');
     $this->setDefaultDir('DESC');
     $this->setUseAjax(true);
     $this->setSaveParametersInSession(true);
 }
Пример #2
0
 public function __construct()
 {
     parent::__construct();
     $this->setVendor(Mage::registry('vendor_data'));
     $this->setPendingAmount(0.0);
     $this->setPendingTransfers(0);
     $this->setPaidAmount(0.0);
     $this->setCanceledAmount(0.0);
     $this->setRefundableAmount(0.0);
     $this->setRefundedAmount(0.0);
     $this->setEarningAmount(0.0);
     if ($this->getVendor() && $this->getVendor()->getId()) {
         $productsCollection = array();
         $paymentHelper = Mage::helper('csmarketplace/payment');
         $collection = $paymentHelper->_getTransactionsStats($this->getVendor());
         if (count($collection) > 0) {
             foreach ($collection as $stats) {
                 switch ($stats->getPaymentState()) {
                     case Ced_CsMarketplace_Model_Vorders::STATE_OPEN:
                         $this->setPendingAmount($stats->getNetAmount());
                         $this->setPendingTransfers($stats->getCount() ? $stats->getCount() : 0);
                         break;
                     case Ced_CsMarketplace_Model_Vorders::STATE_PAID:
                         $this->setPaidAmount($stats->getNetAmount());
                         break;
                     case Ced_CsMarketplace_Model_Vorders::STATE_CANCELED:
                         $this->setCanceledAmount($stats->getNetAmount());
                         break;
                     case Ced_CsMarketplace_Model_Vorders::STATE_REFUND:
                         $this->setRefundableAmount($stats->getNetAmount());
                         break;
                     case Ced_CsMarketplace_Model_Vorders::STATE_REFUNDED:
                         $this->setRefundedAmount($stats->getNetAmount());
                         break;
                 }
             }
         }
         $this->setEarningAmount($this->getVendor()->getAssociatedPayments()->getFirstItem()->getBalance());
     }
     $this->setTemplate('csmarketplace/vendor/entity/edit/tab/vpayments.phtml');
 }