00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class Mage_Adminhtml_Block_Report_Product_Ordered_Grid extends Mage_Adminhtml_Block_Report_Grid
00035 {
00036
00037 public function __construct()
00038 {
00039 parent::__construct();
00040 $this->setId('gridOrderedProducts');
00041 }
00042
00043 protected function _prepareCollection()
00044 {
00045 parent::_prepareCollection();
00046 $this->getCollection()->initReport('reports/product_ordered_collection');
00047 }
00048
00049 protected function _prepareColumns()
00050 {
00051 $this->addColumn('name', array(
00052 'header' =>Mage::helper('reports')->__('Product Name'),
00053 'index' =>'name'
00054 ));
00055
00056 $this->addColumn('price', array(
00057 'header' =>Mage::helper('reports')->__('Price'),
00058 'width' =>'120px',
00059 'type' =>'currency',
00060 'currency_code' => $this->getCurrentCurrencyCode(),
00061 'index' =>'price'
00062 ));
00063
00064 $this->addColumn('ordered_qty', array(
00065 'header' =>Mage::helper('reports')->__('Quantity Ordered'),
00066 'width' =>'120px',
00067 'align' =>'right',
00068 'index' =>'ordered_qty',
00069 'total' =>'sum',
00070 'type' =>'number'
00071 ));
00072
00073 $this->addExportType('*/*/exportOrderedCsv', Mage::helper('reports')->__('CSV'));
00074 $this->addExportType('*/*/exportOrderedExcel', Mage::helper('reports')->__('Excel'));
00075
00076 return parent::_prepareColumns();
00077 }
00078 }