Public Member Functions | |
__construct () | |
getOrder () | |
getRowUrl ($row) | |
getGridUrl () | |
getTabLabel () | |
getTabTitle () | |
canShowTab () | |
isHidden () | |
Protected Member Functions | |
_prepareCollection () | |
_prepareColumns () |
Definition at line 34 of file Creditmemos.php.
__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 }
_prepareCollection | ( | ) | [protected] |
Prepare grid collection object
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.
getGridUrl | ( | ) |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 133 of file Creditmemos.php.
getOrder | ( | ) |
Retrieve order model instance
Definition at line 118 of file Creditmemos.php.
00119 { 00120 return Mage::registry('current_order'); 00121 }
getRowUrl | ( | $ | row | ) |
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.