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
00035 class Mage_Adminhtml_Block_Report_Product_Sold_Grid extends Mage_Adminhtml_Block_Report_Grid
00036 {
00037
00038
00039
00040
00041
00042 protected $_subReportSize = 0;
00043
00044
00045
00046
00047
00048 public function __construct()
00049 {
00050 parent::__construct();
00051 $this->setId('gridProductsSold');
00052 }
00053
00054
00055
00056
00057
00058
00059 protected function _prepareCollection()
00060 {
00061 parent::_prepareCollection();
00062 $this->getCollection()
00063 ->initReport('reports/product_sold_collection');
00064 return $this;
00065 }
00066
00067
00068
00069
00070
00071
00072 protected function _prepareColumns()
00073 {
00074 $this->addColumn('name', array(
00075 'header' =>Mage::helper('reports')->__('Product Name'),
00076 'index' =>'name'
00077 ));
00078
00079 $this->addColumn('ordered_qty', array(
00080 'header' =>Mage::helper('reports')->__('Quantity Ordered'),
00081 'width' =>'120px',
00082 'align' =>'right',
00083 'index' =>'ordered_qty',
00084 'total' =>'sum',
00085 'type' =>'number'
00086 ));
00087
00088 $this->addExportType('*/*/exportSoldCsv', Mage::helper('reports')->__('CSV'));
00089 $this->addExportType('*/*/exportSoldExcel', Mage::helper('reports')->__('Excel'));
00090
00091 return parent::_prepareColumns();
00092 }
00093 }