Public Member Functions | |
__construct () | |
getOrder () | |
getRowUrl ($row) | |
getGridUrl () | |
getTabLabel () | |
getTabTitle () | |
canShowTab () | |
isHidden () | |
Protected Member Functions | |
_prepareCollection () | |
_prepareColumns () |
Definition at line 34 of file Invoices.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 Invoices.php.
00039 { 00040 parent::__construct(); 00041 $this->setId('order_invoices_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 Invoices.php.
00046 { 00047 //TODO: add full name logic 00048 $collection = Mage::getResourceModel('sales/order_invoice_collection') 00049 ->addAttributeToSelect('order_id') 00050 ->addAttributeToSelect('increment_id') 00051 ->addAttributeToSelect('created_at') 00052 ->addAttributeToSelect('state') 00053 ->addAttributeToSelect('grand_total') 00054 ->addAttributeToSelect('base_grand_total') 00055 ->addAttributeToSelect('store_currency_code') 00056 ->addAttributeToSelect('base_currency_code') 00057 ->addAttributeToSelect('order_currency_code') 00058 ->joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id', null, 'left') 00059 ->joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id', null, 'left') 00060 ->addExpressionAttributeToSelect('billing_name', 00061 'CONCAT({{billing_firstname}}, " ", {{billing_lastname}})', 00062 array('billing_firstname', 'billing_lastname')) 00063 ->setOrderFilter($this->getOrder()) 00064 ; 00065 $this->setCollection($collection); 00066 return parent::_prepareCollection(); 00067 }
_prepareColumns | ( | ) | [protected] |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 69 of file Invoices.php.
00070 { 00071 $this->addColumn('increment_id', array( 00072 'header' => Mage::helper('sales')->__('Invoice #'), 00073 'index' => 'increment_id', 00074 'width' => '120px', 00075 )); 00076 00077 $this->addColumn('billing_name', array( 00078 'header' => Mage::helper('sales')->__('Bill to Name'), 00079 'index' => 'billing_name', 00080 )); 00081 00082 $this->addColumn('created_at', array( 00083 'header' => Mage::helper('sales')->__('Invoice Date'), 00084 'index' => 'created_at', 00085 'type' => 'datetime', 00086 )); 00087 00088 $this->addColumn('state', array( 00089 'header' => Mage::helper('sales')->__('Status'), 00090 'index' => 'state', 00091 'type' => 'options', 00092 'options' => Mage::getModel('sales/order_invoice')->getStates(), 00093 )); 00094 00095 $this->addColumn('base_grand_total', array( 00096 'header' => Mage::helper('customer')->__('Amount'), 00097 'index' => 'base_grand_total', 00098 'type' => 'currency', 00099 'currency' => 'base_currency_code', 00100 )); 00101 00102 return parent::_prepareColumns(); 00103 }
canShowTab | ( | ) |
getGridUrl | ( | ) |
getOrder | ( | ) |
Retrieve order model instance
Definition at line 110 of file Invoices.php.
00111 { 00112 return Mage::registry('current_order'); 00113 }
getRowUrl | ( | $ | row | ) |
getTabLabel | ( | ) |
######################## TAB settings #################################
Implements Mage_Adminhtml_Block_Widget_Tab_Interface.
Definition at line 134 of file Invoices.php.
00135 { 00136 return Mage::helper('sales')->__('Invoices'); 00137 }
getTabTitle | ( | ) |
Implements Mage_Adminhtml_Block_Widget_Tab_Interface.
Definition at line 139 of file Invoices.php.
00140 { 00141 return Mage::helper('sales')->__('Order Invoices'); 00142 }
isHidden | ( | ) |