Mage_Adminhtml_Block_Sales_Order_View_Tab_Creditmemos Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Sales_Order_View_Tab_Creditmemos:

Mage_Adminhtml_Block_Widget_Grid Mage_Adminhtml_Block_Widget_Tab_Interface Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getOrder ()
 getRowUrl ($row)
 getGridUrl ()
 getTabLabel ()
 getTabTitle ()
 canShowTab ()
 isHidden ()

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()


Detailed Description

Definition at line 34 of file Creditmemos.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 38 of file Creditmemos.php.

00039     {
00040         parent::__construct();
00041         $this->setId('order_creditmemos_grid');
00042         $this->setUseAjax(true);
00043     }


Member Function Documentation

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 45 of file Creditmemos.php.

00046     {
00047         //TODO: add full name logic
00048         $collection = Mage::getResourceModel('sales/order_Creditmemo_collection')
00049             ->addAttributeToSelect('increment_id')
00050             ->addAttributeToSelect('created_at')
00051             ->addAttributeToSelect('order_currency_code')
00052             ->addAttributeToSelect('store_currency_code')
00053             ->addAttributeToSelect('base_currency_code')
00054             ->addAttributeToSelect('state')
00055             ->addAttributeToSelect('grand_total')
00056             ->addAttributeToSelect('base_grand_total')
00057             ->joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id', null, 'left')
00058             ->joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id', null, 'left')
00059             ->addExpressionAttributeToSelect('billing_name',
00060                 'CONCAT({{billing_firstname}}, " ", {{billing_lastname}})',
00061                 array('billing_firstname', 'billing_lastname'))
00062             ->setOrderFilter($this->getOrder())
00063         ;
00064         $this->setCollection($collection);
00065         return parent::_prepareCollection();
00066     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 68 of file Creditmemos.php.

00069     {
00070         $this->addColumn('increment_id', array(
00071             'header' => Mage::helper('sales')->__('Credit Memo #'),
00072             'width' => '120px',
00073             'index' => 'increment_id',
00074         ));
00075 
00076         /*$this->addColumn('billing_firstname', array(
00077             'header' => Mage::helper('sales')->__('Bill to First name'),
00078             'index' => 'billing_firstname',
00079         ));
00080 
00081         $this->addColumn('billing_lastname', array(
00082             'header' => Mage::helper('sales')->__('Bill to Last name'),
00083             'index' => 'billing_lastname',
00084         ));*/
00085         $this->addColumn('billing_name', array(
00086             'header' => Mage::helper('sales')->__('Bill to Name'),
00087             'index' => 'billing_name',
00088         ));
00089 
00090         $this->addColumn('created_at', array(
00091             'header' => Mage::helper('sales')->__('Created At'),
00092             'index' => 'created_at',
00093             'type' => 'datetime',
00094         ));
00095 
00096         $this->addColumn('state', array(
00097             'header'    => Mage::helper('sales')->__('Status'),
00098             'index'     => 'state',
00099             'type'      => 'options',
00100             'options'   => Mage::getModel('sales/order_creditmemo')->getStates(),
00101         ));
00102 
00103         $this->addColumn('base_grand_total', array(
00104             'header'    => Mage::helper('customer')->__('Refunded'),
00105             'index'     => 'base_grand_total',
00106             'type'      => 'currency',
00107             'currency'  => 'base_currency_code',
00108         ));
00109 
00110         return parent::_prepareColumns();
00111     }

canShowTab (  ) 

Implements Mage_Adminhtml_Block_Widget_Tab_Interface.

Definition at line 151 of file Creditmemos.php.

00152     {
00153         return true;
00154     }

getGridUrl (  ) 

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 133 of file Creditmemos.php.

00134     {
00135         return $this->getUrl('*/*/creditmemos', array('_current' => true));
00136     }

getOrder (  ) 

Retrieve order model instance

Returns:
Mage_Sales_Model_Order

Definition at line 118 of file Creditmemos.php.

00119     {
00120         return Mage::registry('current_order');
00121     }

getRowUrl ( row  ) 

Definition at line 123 of file Creditmemos.php.

00124     {
00125         return $this->getUrl(
00126             '*/sales_order_creditmemo/view',
00127             array(
00128                 'creditmemo_id'=> $row->getId(),
00129                 'order_id'  => $row->getOrderId()
00130              ));
00131     }

getTabLabel (  ) 

######################## TAB settings #################################

Implements Mage_Adminhtml_Block_Widget_Tab_Interface.

Definition at line 141 of file Creditmemos.php.

00142     {
00143         return Mage::helper('sales')->__('Credit Memos');
00144     }

getTabTitle (  ) 

Implements Mage_Adminhtml_Block_Widget_Tab_Interface.

Definition at line 146 of file Creditmemos.php.

00147     {
00148         return Mage::helper('sales')->__('Order Credit Memos');
00149     }

isHidden (  ) 

Implements Mage_Adminhtml_Block_Widget_Tab_Interface.

Definition at line 156 of file Creditmemos.php.

00157     {
00158         return false;
00159     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:02 2009 for Magento by  doxygen 1.5.8