Mage_Adminhtml_Block_Report_Customer_Orders_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Report_Customer_Orders_Grid:

Mage_Adminhtml_Block_Report_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 ()

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()


Detailed Description

Definition at line 34 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 Mage_Adminhtml_Block_Report_Grid.

Definition at line 37 of file Grid.php.

00038     {
00039         parent::__construct();
00040         $this->setId('gridOrdersCustomer');
00041     }


Member Function Documentation

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Report_Grid.

Definition at line 43 of file Grid.php.

00044     {
00045         parent::_prepareCollection();
00046         $this->getCollection()->initReport('reports/customer_orders_collection');
00047     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Report_Grid.

Definition at line 49 of file Grid.php.

00050     {
00051         $this->addColumn('name', array(
00052             'header'    => $this->__('Customer Name'),
00053             'sortable'  => false,
00054             'index'     => 'name'
00055         ));
00056 
00057         $this->addColumn('orders_count', array(
00058             'header'    => $this->__('Number of Orders'),
00059             'width'     => '100px',
00060             'sortable'  => false,
00061             'index'     => 'orders_count',
00062             'total'     => 'sum',
00063             'type'      => 'number'
00064         ));
00065 
00066         $baseCurrencyCode = $this->getCurrentCurrencyCode();
00067 
00068         $this->addColumn('orders_avg_amount', array(
00069             'header'    => $this->__('Average Order Amount'),
00070             'width'     => '200px',
00071             'align'     => 'right',
00072             'sortable'  => false,
00073             'type'      => 'currency',
00074             'currency_code'  => $baseCurrencyCode,
00075             'index'     => 'orders_avg_amount',
00076             'total'     => 'orders_sum_amount/orders_count',
00077             'renderer'  =>'adminhtml/report_grid_column_renderer_currency'
00078         ));
00079 
00080         $this->addColumn('orders_sum_amount', array(
00081             'header'    => $this->__('Total Order Amount'),
00082             'width'     => '200px',
00083             'align'     => 'right',
00084             'sortable'  => false,
00085             'type'      => 'currency',
00086             'currency_code'  => $baseCurrencyCode,
00087             'index'     => 'orders_sum_amount',
00088             'total'     => 'sum',
00089             'renderer'  => 'adminhtml/report_grid_column_renderer_currency',
00090         ));
00091 
00092         $this->addExportType('*/*/exportOrdersCsv', Mage::helper('reports')->__('CSV'));
00093         $this->addExportType('*/*/exportOrdersExcel', Mage::helper('reports')->__('Excel'));
00094 
00095         return parent::_prepareColumns();
00096     }


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

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