Mage_Adminhtml_Block_Sales_Invoice_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Sales_Invoice_Grid:

Mage_Adminhtml_Block_Widget_Grid 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 ()
 getRowUrl ($row)
 getGridUrl ()

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()
 _prepareMassaction ()


Detailed Description

Adminhtml sales orders grid

Author:
Magento Core Team <core@magentocommerce.com>

Definition at line 32 of file Grid.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 35 of file Grid.php.

00036     {
00037         parent::__construct();
00038         $this->setId('sales_invoice_grid');
00039         $this->setDefaultSort('created_at');
00040         $this->setDefaultDir('DESC');
00041     }


Member Function Documentation

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 43 of file Grid.php.

00044     {
00045         //TODO: add full name logic
00046         $collection = Mage::getResourceModel('sales/order_invoice_collection')
00047             ->addAttributeToSelect('order_id')
00048             ->addAttributeToSelect('increment_id')
00049             ->addAttributeToSelect('created_at')
00050             ->addAttributeToSelect('state')
00051             ->addAttributeToSelect('grand_total')
00052             ->addAttributeToSelect('order_currency_code')
00053             ->joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id', null, 'left')
00054             ->joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id', null, 'left')
00055             ->joinAttribute('order_increment_id', 'order/increment_id', 'order_id', null, 'left')
00056             ->joinAttribute('order_created_at', 'order/created_at', 'order_id', null, 'left')
00057         ;
00058         $this->setCollection($collection);
00059         return parent::_prepareCollection();
00060     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 62 of file Grid.php.

00063     {
00064         $this->addColumn('increment_id', array(
00065             'header'    => Mage::helper('sales')->__('Invoice #'),
00066             'index'     => 'increment_id',
00067             'type'      => 'number',
00068         ));
00069 
00070         $this->addColumn('created_at', array(
00071             'header'    => Mage::helper('sales')->__('Invoice Date'),
00072             'index'     => 'created_at',
00073             'type'      => 'datetime',
00074         ));
00075 
00076         $this->addColumn('order_increment_id', array(
00077             'header'    => Mage::helper('sales')->__('Order #'),
00078             'index'     => 'order_increment_id',
00079             'type'      => 'number',
00080         ));
00081 
00082         $this->addColumn('order_created_at', array(
00083             'header'    => Mage::helper('sales')->__('Order Date'),
00084             'index'     => 'order_created_at',
00085             'type'      => 'datetime',
00086         ));
00087 
00088         $this->addColumn('billing_firstname', array(
00089             'header' => Mage::helper('sales')->__('Bill to First name'),
00090             'index' => 'billing_firstname',
00091         ));
00092 
00093         $this->addColumn('billing_lastname', array(
00094             'header' => Mage::helper('sales')->__('Bill to Last name'),
00095             'index' => 'billing_lastname',
00096         ));
00097 
00098         $this->addColumn('state', array(
00099             'header'    => Mage::helper('sales')->__('Status'),
00100             'index'     => 'state',
00101             'type'      => 'options',
00102             'options'   => Mage::getModel('sales/order_invoice')->getStates(),
00103         ));
00104 
00105         $this->addColumn('grand_total', array(
00106             'header'    => Mage::helper('customer')->__('Amount'),
00107             'index'     => 'grand_total',
00108             'type'      => 'currency',
00109             'align'     => 'right',
00110             'currency'  => 'order_currency_code',
00111         ));
00112 
00113         $this->addColumn('action',
00114             array(
00115                 'header'    => Mage::helper('sales')->__('Action'),
00116                 'width'     => '50px',
00117                 'type'      => 'action',
00118                 'getter'     => 'getId',
00119                 'actions'   => array(
00120                     array(
00121                         'caption' => Mage::helper('sales')->__('View'),
00122                         'url'     => array('base'=>'*/*/view'),
00123                         'field'   => 'invoice_id'
00124                     )
00125                 ),
00126                 'filter'    => false,
00127                 'sortable'  => false,
00128                 'is_system' => true
00129         ));
00130 
00131         return parent::_prepareColumns();
00132     }

_prepareMassaction (  )  [protected]

Prepare grid massaction actions

Returns:
Mage_Adminhtml_Block_Widget_Grid

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 134 of file Grid.php.

00135     {
00136         $this->setMassactionIdField('entity_id');
00137         $this->getMassactionBlock()->setFormFieldName('invoice_ids');
00138 
00139         $this->getMassactionBlock()->addItem('pdfinvoices_order', array(
00140              'label'=> Mage::helper('sales')->__('PDF Invoices'),
00141              'url'  => $this->getUrl('*/*/pdfinvoices'),
00142         ));
00143 
00144         return $this;
00145     }

getGridUrl (  ) 

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 156 of file Grid.php.

00157     {
00158         return $this->getUrl('*/*/*', array('_current' => true));
00159     }

getRowUrl ( row  ) 

Definition at line 147 of file Grid.php.

00148     {
00149         return $this->getUrl('*/*/view',
00150             array(
00151                 'invoice_id'=> $row->getId(),
00152             )
00153         );
00154     }


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

Generated on Sat Jul 4 17:22:58 2009 for Magento by  doxygen 1.5.8