Public Member Functions | |
__construct () | |
Protected Member Functions | |
_prepareCollection () | |
_prepareColumns () |
Definition at line 34 of file Grid.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 Mage_Adminhtml_Block_Report_Grid.
Definition at line 36 of file Grid.php.
00037 { 00038 parent::__construct(); 00039 $this->setId('gridCoupons'); 00040 $this->setSubReportSize(false); 00041 }
_prepareCollection | ( | ) | [protected] |
Prepare grid collection object
Validate from and to date
Getting and saving store ids for website & group
Reimplemented from Mage_Adminhtml_Block_Report_Grid.
Definition at line 43 of file Grid.php.
00044 { 00045 parent::_prepareCollection(); 00046 $this->getCollection()->initReport('reports/coupons_collection'); 00047 }
_prepareColumns | ( | ) | [protected] |
Reimplemented from Mage_Adminhtml_Block_Report_Grid.
Definition at line 49 of file Grid.php.
00050 { 00051 $this->addColumn('coupon_code', array( 00052 'header' => $this->__('Coupon Code'), 00053 'sortable' => false, 00054 'index' => 'coupon_code' 00055 )); 00056 00057 $this->addColumn('uses', array( 00058 'header' => $this->__('Number of Use'), 00059 'sortable' => false, 00060 'index' => 'uses', 00061 'total' => 'sum', 00062 'type' => 'number' 00063 )); 00064 00065 $currency_code = $this->getCurrentCurrencyCode(); 00066 00067 $this->addColumn('subtotal', array( 00068 'header' => $this->__('Subtotal Amount'), 00069 'sortable' => false, 00070 'type' => 'currency', 00071 'currency_code' => $currency_code, 00072 'index' => 'subtotal', 00073 'total' => 'sum', 00074 'renderer' =>'adminhtml/report_grid_column_renderer_currency' 00075 )); 00076 00077 $this->addColumn('discount', array( 00078 'header' => $this->__('Discount Amount'), 00079 'sortable' => false, 00080 'type' => 'currency', 00081 'currency_code' => $currency_code, 00082 'index' => 'discount', 00083 'total' => 'sum', 00084 'renderer' =>'adminhtml/report_grid_column_renderer_currency' 00085 )); 00086 00087 $this->addColumn('total', array( 00088 'header' => $this->__('Total Amount'), 00089 'sortable' => false, 00090 'type' => 'currency', 00091 'currency_code' => $currency_code, 00092 'index' => 'total', 00093 'total' => 'sum', 00094 'renderer' =>'adminhtml/report_grid_column_renderer_currency' 00095 )); 00096 00097 $this->addExportType('*/*/exportCouponsCsv', Mage::helper('reports')->__('CSV')); 00098 $this->addExportType('*/*/exportCouponsExcel', Mage::helper('reports')->__('Excel')); 00099 00100 return parent::_prepareColumns(); 00101 }