示例#1
1
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('sales')->__('Period'), 'index' => 'period', 'width' => 100, 'sortable' => false, 'period_type' => $this->getPeriodType(), 'renderer' => 'adminhtml/report_sales_grid_column_renderer_date', 'totals_label' => Mage::helper('sales')->__('Total'), 'html_decorators' => array('nobr')));
     $this->addColumn('orders_count', array('header' => Mage::helper('sales')->__('Orders'), 'index' => 'orders_count', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('total_qty_ordered', array('header' => Mage::helper('sales')->__('Sales Items'), 'index' => 'total_qty_ordered', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('total_qty_invoiced', array('header' => Mage::helper('sales')->__('Items'), 'index' => 'total_qty_invoiced', 'type' => 'number', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns')));
     if ($this->getFilterData()->getStoreIds()) {
         $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
     }
     $currencyCode = $this->getCurrentCurrencyCode();
     $rate = $this->getRate($currencyCode);
     $this->addColumn('total_income_amount', array('header' => Mage::helper('sales')->__('Sales Total'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_income_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_revenue_amount', array('header' => Mage::helper('sales')->__('Revenue'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_revenue_amount', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_profit_amount', array('header' => Mage::helper('sales')->__('Profit'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_profit_amount', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_invoiced_amount', array('header' => Mage::helper('sales')->__('Invoiced'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_invoiced_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_paid_amount', array('header' => Mage::helper('sales')->__('Paid'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_paid_amount', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_refunded_amount', array('header' => Mage::helper('sales')->__('Refunded'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_refunded_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_tax_amount', array('header' => Mage::helper('sales')->__('Sales Tax'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_tax_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_tax_amount_actual', array('header' => Mage::helper('sales')->__('Tax'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_tax_amount_actual', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_shipping_amount', array('header' => Mage::helper('sales')->__('Sales Shipping'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_shipping_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_shipping_amount_actual', array('header' => Mage::helper('sales')->__('Shipping'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_shipping_amount_actual', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_discount_amount', array('header' => Mage::helper('sales')->__('Sales Discount'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_discount_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_discount_amount_actual', array('header' => Mage::helper('sales')->__('Discount'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_discount_amount_actual', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_canceled_amount', array('header' => Mage::helper('sales')->__('Canceled'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_canceled_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addExportType('*/*/exportSalesCsv', Mage::helper('adminhtml')->__('CSV'));
     $this->addExportType('*/*/exportSalesExcel', Mage::helper('adminhtml')->__('Excel XML'));
     return parent::_prepareColumns();
 }
示例#2
0
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('advancedreports')->__('Period'), 'index' => 'period', 'width' => 100, 'sortable' => false, 'period_type' => $this->getPeriodType(), 'renderer' => 'adminhtml/report_sales_grid_column_renderer_date', 'totals_label' => Mage::helper('advancedreports')->__('Total'), 'html_decorators' => array('nobr')));
     $this->addColumn('qty_ordered', array('header' => Mage::helper('advancedreports')->__('Quantity'), 'align' => 'right', 'index' => 'qty_ordered', 'type' => 'number', 'sortable' => false));
     $currencyCode = $this->getCurrentCurrencyCode();
     $this->addColumn('row_total', array('header' => Mage::helper('advancedreports')->__('Total'), 'align' => 'right', 'index' => 'row_total', 'currency_code' => $currencyCode, 'width' => '100px', 'type' => 'currency', 'total' => 'sum', 'sortable' => false));
     $this->addExportType('*/*/exportSalesByProductCsv', Mage::helper('advancedreports')->__('CSV'));
     $this->addExportType('*/*/exportSalesByProductExcel', Mage::helper('advancedreports')->__('Excel XML'));
     return parent::_prepareColumns();
 }
示例#3
0
 protected function _prepareColumns()
 {
     $this->addColumn('day', array('header' => Mage::helper('advancedreports')->__('Day of Week'), 'index' => 'day', 'type' => 'text', 'sortable' => false, 'totals_label' => Mage::helper('advancedreports')->__('Total'), 'html_decorators' => array('nobr')));
     $this->addColumn('percent', array('header' => Mage::helper('advancedreports')->__('Percent'), 'align' => 'right', 'index' => 'percent', 'type' => 'text', 'renderer' => 'MGS_Advancedreports_Block_Adminhtml_Report_Salesbydayofweek_Renderer_Percent', 'sortable' => false, 'totals_label' => Mage::helper('advancedreports')->__(null)));
     $this->addColumn('total_item_count', array('header' => Mage::helper('advancedreports')->__('Number of Orders'), 'align' => 'right', 'index' => 'total_item_count', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $currencyCode = $this->getCurrentCurrencyCode();
     $this->addColumn('grand_total', array('header' => Mage::helper('advancedreports')->__('Total'), 'align' => 'right', 'index' => 'grand_total', 'currency_code' => $currencyCode, 'width' => '100px', 'type' => 'currency', 'total' => 'sum', 'sortable' => false));
     $this->addExportType('*/*/exportSalesByDayOfWeekCsv', Mage::helper('advancedreports')->__('CSV'));
     $this->addExportType('*/*/exportSalesByDayOfWeekExcel', Mage::helper('advancedreports')->__('Excel XML'));
     return parent::_prepareColumns();
 }
示例#4
0
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('advancedreports')->__('Period'), 'width' => 100, 'index' => 'period', 'type' => 'text', 'sortable' => false, 'totals_label' => Mage::helper('advancedreports')->__('Total'), 'html_decorators' => array('nobr')));
     $this->addColumn('new_customers', array('header' => Mage::helper('advancedreports')->__('New Customers'), 'align' => 'right', 'index' => 'new_customers', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('returning_customers', array('header' => Mage::helper('advancedreports')->__('Returning Customers'), 'align' => 'right', 'index' => 'returning_customers', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('percent_of_new', array('header' => Mage::helper('advancedreports')->__('Percent of New Customers'), 'align' => 'right', 'index' => 'percent_of_new', 'type' => 'text', 'sortable' => false));
     $this->addColumn('percent_of_returning', array('header' => Mage::helper('advancedreports')->__('Percent of Returning Customers'), 'align' => 'right', 'index' => 'percent_of_returning', 'type' => 'text', 'sortable' => false));
     $this->addExportType('*/*/exportSalesByNewAndReturningCsv', Mage::helper('advancedreports')->__('CSV'));
     $this->addExportType('*/*/exportSalesByNewAndReturningExcel', Mage::helper('advancedreports')->__('Excel XML'));
     return parent::_prepareColumns();
 }
示例#5
0
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('adminhtml')->__('Period'), 'index' => 'period', 'type' => 'string', 'width' => 100, 'sortable' => false, 'totals_label' => Mage::helper('adminhtml')->__('Total'), 'subtotals_label' => Mage::helper('adminhtml')->__('SubTotal')));
     $this->addColumn('shipping_description', array('header' => Mage::helper('adminhtml')->__('Carrier/Method'), 'index' => 'shipping_description', 'sortable' => false));
     $this->addColumn('orders_count', array('header' => Mage::helper('adminhtml')->__('Number of Orders'), 'index' => 'orders_count', 'total' => 'sum', 'type' => 'number', 'width' => 100, 'sortable' => false));
     if ($this->getFilterData()->getStoreIds()) {
         $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
     }
     $this->addColumn('total_shipping', array('header' => Mage::helper('adminhtml')->__('Total Shipping'), 'type' => 'currency', 'currency_code' => $this->getCurrentCurrencyCode(), 'index' => 'total_shipping', 'total' => 'sum', 'sortable' => false));
     $this->addExportType('*/*/exportShippingCsv', Mage::helper('adminhtml')->__('CSV'));
     $this->addExportType('*/*/exportShippingExcel', Mage::helper('adminhtml')->__('Excel'));
     return parent::_prepareColumns();
 }
示例#6
0
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('sales')->__('Period'), 'index' => 'period', 'width' => '100', 'sortable' => false, 'period_type' => $this->getPeriodType(), 'renderer' => 'adminhtml/report_sales_grid_column_renderer_date', 'totals_label' => Mage::helper('sales')->__('Total'), 'subtotals_label' => Mage::helper('sales')->__('Subtotal'), 'html_decorators' => array('nobr')));
     $this->addColumn('code', array('header' => Mage::helper('sales')->__('Tax'), 'index' => 'code', 'type' => 'string', 'sortable' => false));
     $this->addColumn('percent', array('header' => Mage::helper('sales')->__('Rate'), 'index' => 'percent', 'type' => 'number', 'width' => '100', 'sortable' => false));
     $this->addColumn('orders_count', array('header' => Mage::helper('sales')->__('Number of Orders'), 'index' => 'orders_count', 'total' => 'sum', 'type' => 'number', 'width' => '100', 'sortable' => false));
     if ($this->getFilterData()->getStoreIds()) {
         $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
     }
     $this->addColumn('tax_base_amount_sum', array('header' => Mage::helper('sales')->__('Tax Amount'), 'type' => 'currency', 'currency_code' => $this->getCurrentCurrencyCode(), 'index' => 'tax_base_amount_sum', 'total' => 'sum', 'sortable' => false));
     $this->addExportType('*/*/exportTaxCsv', Mage::helper('adminhtml')->__('CSV'));
     $this->addExportType('*/*/exportTaxExcel', Mage::helper('adminhtml')->__('Excel XML'));
     return parent::_prepareColumns();
 }
示例#7
0
文件: Grid.php 项目: nemphys/magento2
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('Mage_Sales_Helper_Data')->__('Period'), 'index' => 'period', 'width' => 100, 'sortable' => false, 'period_type' => $this->getPeriodType(), 'renderer' => 'Mage_Adminhtml_Block_Report_Sales_Grid_Column_Renderer_Date', 'totals_label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total'), 'html_decorators' => array('nobr')));
     $this->addColumn('product_name', array('header' => Mage::helper('Mage_Sales_Helper_Data')->__('Product Name'), 'index' => 'product_name', 'type' => 'string', 'sortable' => false));
     if ($this->getFilterData()->getStoreIds()) {
         $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
     }
     $currencyCode = $this->getCurrentCurrencyCode();
     $this->addColumn('product_price', array('header' => Mage::helper('Mage_Sales_Helper_Data')->__('Price'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'product_price', 'sortable' => false, 'rate' => $this->getRate($currencyCode)));
     $this->addColumn('qty_ordered', array('header' => Mage::helper('Mage_Sales_Helper_Data')->__('Quantity Ordered'), 'index' => 'qty_ordered', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addExportType('*/*/exportBestsellersCsv', Mage::helper('Mage_Adminhtml_Helper_Data')->__('CSV'));
     $this->addExportType('*/*/exportBestsellersExcel', Mage::helper('Mage_Adminhtml_Helper_Data')->__('Excel XML'));
     return parent::_prepareColumns();
 }
示例#8
0
 /**
  * Custom columns preparation
  *
  * @return Mage_Adminhtml_Block_Widget_Grid
  */
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('adminhtml')->__('Period'), 'index' => 'period', 'width' => 100, 'sortable' => false, 'period_type' => $this->getPeriodType(), 'renderer' => 'adminhtml/report_sales_grid_column_renderer_date', 'totals_label' => Mage::helper('adminhtml')->__('Total'), 'html_decorators' => array('nobr')));
     $this->addColumn('product_name', array('header' => Mage::helper('adminhtml')->__('Product Name'), 'index' => 'product_name', 'type' => 'string', 'sortable' => false));
     if ($this->getFilterData()->getStoreIds()) {
         $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
     }
     $currencyCode = $this->getCurrentCurrencyCode();
     $this->addColumn('product_price', array('header' => Mage::helper('adminhtml')->__('Price'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'product_price', 'sortable' => false, 'rate' => $this->getRate($currencyCode)));
     $this->addColumn('views_num', array('header' => Mage::helper('adminhtml')->__('Number of Views'), 'index' => 'views_num', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addExportType('*/*/exportViewedCsv', Mage::helper('adminhtml')->__('CSV'));
     $this->addExportType('*/*/exportViewedExcel', Mage::helper('adminhtml')->__('Excel XML'));
     return parent::_prepareColumns();
 }
示例#9
0
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('sales')->__('Period'), 'index' => 'period', 'width' => 100, 'sortable' => false, 'period_type' => $this->getPeriodType(), 'renderer' => 'adminhtml/report_sales_grid_column_renderer_date', 'totals_label' => Mage::helper('sales')->__('Total'), 'html_decorators' => array('nobr')));
     $this->addColumn('orders_count', array('header' => Mage::helper('sales')->__('Number of Refunded Orders'), 'index' => 'orders_count', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     if ($this->getFilterData()->getStoreIds()) {
         $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
     }
     $currencyCode = $this->getCurrentCurrencyCode();
     $this->addColumn('refunded', array('header' => Mage::helper('sales')->__('Total Refunded'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'refunded', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('online_refunded', array('header' => Mage::helper('sales')->__('Online Refunded'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'online_refunded', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('offline_refunded', array('header' => Mage::helper('sales')->__('Offline Refunded'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'offline_refunded', 'total' => 'sum', 'sortable' => false));
     $this->addExportType('*/*/exportRefundedCsv', Mage::helper('adminhtml')->__('CSV'));
     $this->addExportType('*/*/exportRefundedExcel', Mage::helper('adminhtml')->__('Excel'));
     return parent::_prepareColumns();
 }
示例#10
0
 protected function getFilterData()
 {
     $date = Mage::getSingleton('core/date');
     $data = parent::getFilterData();
     if (!$data->hasData('from')) {
         $data->setData('from', $date->gmtDate(null, $date->gmtTimestamp() - 30 * 24 * 60 * 60));
     }
     if (!$data->hasData('to')) {
         $data->setData('to', $date->gmtDate(null, $date->gmtTimestamp()));
     }
     if (!$data->hasData('period_type')) {
         $data->setData('period_type', 'day');
     }
     return $data;
 }
示例#11
0
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('sales')->__('Period'), 'index' => 'period', 'width' => 100, 'sortable' => false, 'period_type' => $this->getPeriodType(), 'renderer' => 'adminhtml/report_sales_grid_column_renderer_date', 'totals_label' => Mage::helper('sales')->__('Total'), 'subtotals_label' => Mage::helper('sales')->__('Subtotal'), 'html_decorators' => array('nobr')));
     $this->addColumn('shipping_description', array('header' => Mage::helper('sales')->__('Carrier/Method'), 'index' => 'shipping_description', 'sortable' => false));
     $this->addColumn('orders_count', array('header' => Mage::helper('sales')->__('Number of Orders'), 'index' => 'orders_count', 'total' => 'sum', 'type' => 'number', 'width' => 100, 'sortable' => false));
     if ($this->getFilterData()->getStoreIds()) {
         $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
     }
     $currencyCode = $this->getCurrentCurrencyCode();
     $rate = $this->getRate($currencyCode);
     $this->addColumn('total_shipping', array('header' => Mage::helper('sales')->__('Total Sales Shipping'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_shipping', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_shipping_actual', array('header' => Mage::helper('sales')->__('Total Shipping'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_shipping_actual', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addExportType('*/*/exportShippingCsv', Mage::helper('adminhtml')->__('CSV'));
     $this->addExportType('*/*/exportShippingExcel', Mage::helper('adminhtml')->__('Excel XML'));
     return parent::_prepareColumns();
 }
示例#12
0
 /**
  * Preparing collection
  * Filter canceled statuses for orders in taxes
  *
  *@return Mage_Adminhtml_Block_Report_Sales_Tax_Grid
  */
 protected function _prepareCollection()
 {
     $filterData = $this->getFilterData();
     if (!$filterData->hasData('order_statuses')) {
         $orderConfig = Mage::getModel('sales/order_config');
         $statusValues = array();
         $canceledStatuses = $orderConfig->getStateStatuses(Mage_Sales_Model_Order::STATE_CANCELED);
         foreach ($orderConfig->getStatuses() as $code => $label) {
             if (!isset($canceledStatuses[$code])) {
                 $statusValues[] = $code;
             }
         }
         $filterData->setOrderStatuses($statusValues);
     }
     return parent::_prepareCollection();
 }
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('reports')->__('Period'), 'index' => 'period', 'width' => 100, 'sortable' => false, 'period_type' => $this->getPeriodType(), 'renderer' => 'adminhtml/report_sales_grid_column_renderer_date', 'totals_label' => Mage::helper('adminhtml')->__('Total'), 'subtotals_label' => Mage::helper('adminhtml')->__('SubTotal')));
     $this->addColumn('coupon_code', array('header' => Mage::helper('reports')->__('Coupon Code'), 'sortable' => false, 'index' => 'coupon_code'));
     $this->addColumn('coupon_uses', array('header' => Mage::helper('reports')->__('Number of Use'), 'sortable' => false, 'index' => 'coupon_uses', 'total' => 'sum', 'type' => 'number'));
     if ($this->getFilterData()->getStoreIds()) {
         $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
     }
     $currency_code = $this->getCurrentCurrencyCode();
     $this->addColumn('subtotal_amount', array('header' => Mage::helper('reports')->__('Subtotal Amount'), 'sortable' => false, 'type' => 'currency', 'currency_code' => $currency_code, 'total' => 'sum', 'index' => 'subtotal_amount'));
     $this->addColumn('discount_amount', array('header' => Mage::helper('reports')->__('Discount Amount'), 'sortable' => false, 'type' => 'currency', 'currency_code' => $currency_code, 'total' => 'sum', 'index' => 'discount_amount'));
     $this->addColumn('total_amount', array('header' => Mage::helper('reports')->__('Total Amount'), 'sortable' => false, 'type' => 'currency', 'currency_code' => $currency_code, 'total' => 'sum', 'index' => 'total_amount'));
     $this->addExportType('*/*/exportCouponsCsv', Mage::helper('reports')->__('CSV'));
     $this->addExportType('*/*/exportCouponsExcel', Mage::helper('reports')->__('Excel'));
     return parent::_prepareColumns();
 }
示例#14
0
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('sales')->__('Period'), 'index' => 'period', 'type' => 'string', 'width' => 100, 'sortable' => false, 'totals_label' => Mage::helper('adminhtml')->__('Total')));
     $this->addColumn('orders_count', array('header' => Mage::helper('reports')->__('Number of Orders'), 'index' => 'orders_count', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('orders_invoiced', array('header' => Mage::helper('reports')->__('Number of Invoiced Orders'), 'index' => 'orders_invoiced', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     if ($this->getFilterData()->getStoreIds()) {
         $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
     }
     $currency_code = $this->getCurrentCurrencyCode();
     $this->addColumn('invoiced', array('header' => Mage::helper('reports')->__('Total Invoiced'), 'type' => 'currency', 'currency_code' => $currency_code, 'index' => 'invoiced', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('invoiced_captured', array('header' => Mage::helper('reports')->__('Total Invoiced Captured'), 'type' => 'currency', 'currency_code' => $currency_code, 'index' => 'invoiced_captured', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('invoiced_not_captured', array('header' => Mage::helper('reports')->__('Total Invoiced not Captured'), 'type' => 'currency', 'currency_code' => $currency_code, 'index' => 'invoiced_not_captured', 'total' => 'sum', 'sortable' => false));
     $this->addExportType('*/*/exportInvoicedCsv', Mage::helper('reports')->__('CSV'));
     $this->addExportType('*/*/exportInvoicedExcel', Mage::helper('reports')->__('Excel'));
     return parent::_prepareColumns();
 }
示例#15
0
 protected function _prepareColumns()
 {
     $this->addColumn('coupon_code', array('header' => Mage::helper('advancedreports')->__('Coupon Code'), 'index' => 'coupon_code', 'type' => 'number', 'sortable' => false, 'renderer' => 'MGS_Advancedreports_Block_Adminhtml_Report_Salesbycouponcode_Renderer_Couponcode', 'totals_label' => Mage::helper('advancedreports')->__('Total'), 'html_decorators' => array('nobr')));
     $this->addColumn('total_item_count', array('header' => Mage::helper('advancedreports')->__('Orders'), 'align' => 'right', 'index' => 'total_item_count', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('total_qty_ordered', array('header' => Mage::helper('advancedreports')->__('Items'), 'align' => 'right', 'index' => 'total_qty_ordered', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $currencyCode = $this->getCurrentCurrencyCode();
     $this->addColumn('subtotal', array('header' => Mage::helper('advancedreports')->__('Subtotal'), 'align' => 'right', 'index' => 'subtotal', 'currency_code' => $currencyCode, 'width' => '100px', 'type' => 'currency', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('tax_amount', array('header' => Mage::helper('advancedreports')->__('Tax'), 'align' => 'right', 'index' => 'tax_amount', 'currency_code' => $currencyCode, 'width' => '100px', 'type' => 'currency', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('shipping_amount', array('header' => Mage::helper('advancedreports')->__('Shipping'), 'align' => 'right', 'index' => 'shipping_amount', 'currency_code' => $currencyCode, 'width' => '100px', 'type' => 'currency', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('discount_amount', array('header' => Mage::helper('advancedreports')->__('Discount'), 'align' => 'right', 'index' => 'discount_amount', 'currency_code' => $currencyCode, 'width' => '100px', 'type' => 'currency', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('grand_total', array('header' => Mage::helper('advancedreports')->__('Total'), 'align' => 'right', 'index' => 'grand_total', 'currency_code' => $currencyCode, 'width' => '100px', 'type' => 'currency', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('total_invoiced', array('header' => Mage::helper('advancedreports')->__('Invoiced'), 'align' => 'right', 'index' => 'total_invoiced', 'currency_code' => $currencyCode, 'width' => '100px', 'type' => 'currency', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('base_total_refunded', array('header' => Mage::helper('advancedreports')->__('Refunded'), 'align' => 'right', 'index' => 'base_total_refunded', 'currency_code' => $currencyCode, 'width' => '100px', 'type' => 'currency', 'total' => 'sum', 'sortable' => false));
     $this->addExportType('*/*/exportSalesByCouponCodeCsv', Mage::helper('advancedreports')->__('CSV'));
     $this->addExportType('*/*/exportSalesByCouponCodeExcel', Mage::helper('advancedreports')->__('Excel XML'));
     return parent::_prepareColumns();
 }
示例#16
0
文件: Grid.php 项目: relue/magento2
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('Mage_Sales_Helper_Data')->__('Period'), 'index' => 'period', 'width' => 100, 'sortable' => false, 'period_type' => $this->getPeriodType(), 'renderer' => 'Mage_Adminhtml_Block_Report_Sales_Grid_Column_Renderer_Date', 'totals_label' => Mage::helper('Mage_Sales_Helper_Data')->__('Total'), 'html_decorators' => array('nobr')));
     $this->addColumn('orders_count', array('header' => Mage::helper('Mage_Sales_Helper_Data')->__('Number of Orders'), 'index' => 'orders_count', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('orders_invoiced', array('header' => Mage::helper('Mage_Sales_Helper_Data')->__('Number of Invoiced Orders'), 'index' => 'orders_invoiced', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     if ($this->getFilterData()->getStoreIds()) {
         $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
     }
     $currencyCode = $this->getCurrentCurrencyCode();
     $rate = $this->getRate($currencyCode);
     $this->addColumn('invoiced', array('header' => Mage::helper('Mage_Sales_Helper_Data')->__('Total Invoiced'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'invoiced', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('invoiced_captured', array('header' => Mage::helper('Mage_Sales_Helper_Data')->__('Total Invoiced Paid'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'invoiced_captured', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('invoiced_not_captured', array('header' => Mage::helper('Mage_Sales_Helper_Data')->__('Total Invoiced not Paid'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'invoiced_not_captured', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addExportType('*/*/exportInvoicedCsv', Mage::helper('Mage_Adminhtml_Helper_Data')->__('CSV'));
     $this->addExportType('*/*/exportInvoicedExcel', Mage::helper('Mage_Adminhtml_Helper_Data')->__('Excel XML'));
     return parent::_prepareColumns();
 }
示例#17
0
文件: Grid.php 项目: relue/magento2
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Period'), 'index' => 'period', 'width' => 100, 'sortable' => false, 'period_type' => $this->getPeriodType(), 'renderer' => 'Mage_Adminhtml_Block_Report_Sales_Grid_Column_Renderer_Date', 'totals_label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Total'), 'subtotals_label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Subtotal'), 'html_decorators' => array('nobr')));
     $this->addColumn('coupon_code', array('header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Coupon Code'), 'sortable' => false, 'index' => 'coupon_code'));
     $this->addColumn('coupon_uses', array('header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Number of Uses'), 'sortable' => false, 'index' => 'coupon_uses', 'total' => 'sum', 'type' => 'number'));
     if ($this->getFilterData()->getStoreIds()) {
         $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
     }
     $currencyCode = $this->getCurrentCurrencyCode();
     $rate = $this->getRate($currencyCode);
     $this->addColumn('subtotal_amount', array('header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Sales Subtotal Amount'), 'sortable' => false, 'type' => 'currency', 'currency_code' => $currencyCode, 'total' => 'sum', 'index' => 'subtotal_amount', 'rate' => $rate));
     $this->addColumn('discount_amount', array('header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Sales Discount Amount'), 'sortable' => false, 'type' => 'currency', 'currency_code' => $currencyCode, 'total' => 'sum', 'index' => 'discount_amount', 'rate' => $rate));
     $this->addColumn('total_amount', array('header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Sales Total Amount'), 'sortable' => false, 'type' => 'currency', 'currency_code' => $currencyCode, 'total' => 'sum', 'index' => 'total_amount', 'rate' => $rate));
     $this->addColumn('subtotal_amount_actual', array('header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Subtotal Amount'), 'sortable' => false, 'type' => 'currency', 'currency_code' => $currencyCode, 'total' => 'sum', 'index' => 'subtotal_amount_actual', 'rate' => $rate));
     $this->addColumn('discount_amount_actual', array('header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Discount Amount'), 'sortable' => false, 'type' => 'currency', 'currency_code' => $currencyCode, 'total' => 'sum', 'index' => 'discount_amount_actual', 'rate' => $rate));
     $this->addColumn('total_amount_actual', array('header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Total Amount'), 'sortable' => false, 'type' => 'currency', 'currency_code' => $currencyCode, 'total' => 'sum', 'index' => 'total_amount_actual', 'rate' => $rate));
     $this->addExportType('*/*/exportCouponsCsv', Mage::helper('Mage_Adminhtml_Helper_Data')->__('CSV'));
     $this->addExportType('*/*/exportCouponsExcel', Mage::helper('Mage_Adminhtml_Helper_Data')->__('Excel XML'));
     return parent::_prepareColumns();
 }
 protected function _prepareCollection()
 {
     $filterData = $this->getFilterData();
     if ($filterData->getData('from') == null || $filterData->getData('to') == null) {
         $this->setCountTotals(false);
         $this->setCountSubTotals(false);
         return parent::_prepareCollection();
     }
     $storeIds = $this->_getStoreIds();
     $orderStatuses = $filterData->getData('order_statuses');
     if (is_array($orderStatuses)) {
         if (count($orderStatuses) == 1 && strpos($orderStatuses[0], ',') !== false) {
             $filterData->setData('order_statuses', explode(',', $orderStatuses[0]));
         }
     }
     $vendorIds = $this->_getVendorIds();
     //print_r($vendorIds);
     $resourceCollection = Mage::getResourceModel($this->getResourceCollectionName())->setPeriod($filterData->getData('period_type'))->setDateRange($filterData->getData('from', null), $filterData->getData('to', null))->addStoreFilter($storeIds)->addVendorFilter($vendorIds)->addOrderStatusFilter($filterData->getData('order_statuses'))->setAggregatedColumns($this->_getAggregatedColumns());
     if ($this->_isExport) {
         $this->setCollection($resourceCollection);
         return $this;
     }
     if ($filterData->getData('show_empty_rows', false)) {
         Mage::helper('reports')->prepareIntervalsCollection($this->getCollection(), $filterData->getData('from', null), $filterData->getData('to', null), $filterData->getData('period_type'));
     }
     if ($this->getCountSubTotals()) {
         $this->getSubTotals();
     }
     if ($this->getCountTotals()) {
         $totalsCollection = Mage::getResourceModel($this->getResourceCollectionName())->setPeriod($filterData->getData('period_type'))->setDateRange($filterData->getData('from', null), $filterData->getData('to', null))->addStoreFilter($storeIds)->addVendorFilter($vendorIds)->addOrderStatusFilter($filterData->getData('order_statuses'))->setAggregatedColumns($this->_getAggregatedColumns())->isTotals(true);
         foreach ($totalsCollection as $item) {
             $this->setTotals($item);
             break;
         }
     }
     $this->getCollection()->setColumnGroupBy($this->_columnGroupBy);
     $this->getCollection()->setResourceCollection($resourceCollection);
     //$grandParent = $this->getGrandParent();
     return $this;
 }
示例#19
0
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('sales')->__('Period'), 'index' => 'period', 'type' => 'string', 'width' => 100, 'sortable' => false, 'totals_label' => Mage::helper('adminhtml')->__('Total')));
     $this->addColumn('orders_count', array('header' => Mage::helper('sales')->__('Number of Orders'), 'index' => 'orders_count', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('total_qty_ordered', array('header' => Mage::helper('sales')->__('Items Ordered'), 'index' => 'total_qty_ordered', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     if ($this->getFilterData()->getStoreIds()) {
         $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
     }
     $currency_code = $this->getCurrentCurrencyCode();
     $this->addColumn('base_profit_amount', array('header' => Mage::helper('sales')->__('Profit'), 'type' => 'currency', 'currency_code' => $currency_code, 'index' => 'base_profit_amount', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('base_subtotal_amount', array('header' => Mage::helper('sales')->__('Subtotal'), 'type' => 'currency', 'currency_code' => $currency_code, 'index' => 'base_subtotal_amount', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('base_tax_amount', array('header' => Mage::helper('sales')->__('Tax'), 'type' => 'currency', 'currency_code' => $currency_code, 'index' => 'base_tax_amount', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('base_shipping_amount', array('header' => Mage::helper('sales')->__('Shipping'), 'type' => 'currency', 'currency_code' => $currency_code, 'index' => 'base_shipping_amount', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('base_discount_amount', array('header' => Mage::helper('sales')->__('Discounts'), 'type' => 'currency', 'currency_code' => $currency_code, 'index' => 'base_discount_amount', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('base_grand_total_amount', array('header' => Mage::helper('sales')->__('Total'), 'type' => 'currency', 'currency_code' => $currency_code, 'index' => 'base_grand_total_amount', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('base_invoiced_amount', array('header' => Mage::helper('sales')->__('Invoiced'), 'type' => 'currency', 'currency_code' => $currency_code, 'index' => 'base_invoiced_amount', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('base_refunded_amount', array('header' => Mage::helper('sales')->__('Refunded'), 'type' => 'currency', 'currency_code' => $currency_code, 'index' => 'base_refunded_amount', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('base_canceled_amount', array('header' => Mage::helper('sales')->__('Canceled'), 'type' => 'currency', 'currency_code' => $currency_code, 'index' => 'base_canceled_amount', 'total' => 'sum', 'sortable' => false));
     $this->addExportType('*/*/exportSalesCsv', Mage::helper('reports')->__('CSV'));
     $this->addExportType('*/*/exportSalesExcel', Mage::helper('reports')->__('Excel'));
     return parent::_prepareColumns();
 }
示例#20
0
 /**
  * Add price rule filter
  *
  * @param Mage_Reports_Model_Resource_Report_Collection_Abstract $collection
  * @param Varien_Object $filterData
  * @return Mage_Adminhtml_Block_Report_Grid_Abstract
  */
 protected function _addCustomFilter($collection, $filterData)
 {
     if ($filterData->getPriceRuleType()) {
         $rulesList = $filterData->getData('rules_list');
         if (isset($rulesList[0])) {
             $rulesIds = explode(',', $rulesList[0]);
             $collection->addRuleFilter($rulesIds);
         }
     }
     return parent::_addCustomFilter($filterData, $collection);
 }
 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('gorilla_report')->__('Period'), 'index' => 'period', 'width' => 100, 'sortable' => false, 'period_type' => $this->getPeriodType(), 'renderer' => 'adminhtml/report_sales_grid_column_renderer_date', 'totals_label' => Mage::helper('gorilla_report')->__('Total'), 'subtotals_label' => Mage::helper('gorilla_report')->__('Subtotal'), 'html_decorators' => array('nobr')));
     $this->addColumn('increment_id', array('header' => Mage::helper('gorilla_report')->__('Order #'), 'sortable' => false, 'index' => 'increment_id'));
     $this->addColumn('created_at', array('header' => Mage::helper('gorilla_report')->__('Order Date'), 'sortable' => false, 'index' => 'created_at'));
     $this->addColumn('customer_lastname', array('header' => Mage::helper('gorilla_report')->__('Customer Name'), 'sortable' => false, 'index' => 'customer_lastname', 'renderer' => 'gorilla_report/adminhtml_customer_renderer_fullname'));
     $this->addColumn('customer_email', array('header' => Mage::helper('gorilla_report')->__('Customer Email'), 'index' => 'customer_email', 'sortable' => false));
     //Coupon Name
     $this->addColumn('rule_name', array('header' => Mage::helper('gorilla_report')->__('Rule Name'), 'index' => 'rule_name', 'sortable' => false));
     $this->addColumn('coupon_code', array('header' => Mage::helper('gorilla_report')->__('Coupon Code'), 'index' => 'coupon_code', 'sortable' => false));
     $this->addColumn('rule_from_date', array('header' => Mage::helper('gorilla_report')->__('Start Date'), 'index' => 'rule_from_date', 'sortable' => false));
     $this->addColumn('rule_to_date', array('header' => Mage::helper('gorilla_report')->__('Date Expired'), 'index' => 'rule_to_date', 'sortable' => false));
     $this->addColumn('ship_city', array('header' => Mage::helper('gorilla_report')->__('City'), 'index' => 'ship_city', 'sortable' => false));
     $this->addColumn('ship_region', array('header' => Mage::helper('gorilla_report')->__('State'), 'index' => 'ship_region', 'sortable' => false));
     $this->addColumn('ship_zip', array('header' => Mage::helper('gorilla_report')->__('Zip'), 'index' => 'ship_zip', 'sortable' => false));
     $currencyCode = $this->getCurrentCurrencyCode();
     $this->addColumn('order_subtotal', array('header' => Mage::helper('gorilla_report')->__('Order Subtotal'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'order_subtotal', 'sortable' => false));
     $this->addColumn('order_discount', array('header' => Mage::helper('gorilla_report')->__('Order Discount'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'order_discount', 'sortable' => false, 'renderer' => 'gorilla_report/adminhtml_order_renderer_discount'));
     $this->addColumn('order_total', array('header' => Mage::helper('gorilla_report')->__('Order Total'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'order_total', 'sortable' => false));
     $this->addColumn('real_subtotal', array('header' => Mage::helper('gorilla_report')->__('Subtotal'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'real_subtotal', 'sortable' => false));
     $this->addColumn('real_discount', array('header' => Mage::helper('gorilla_report')->__('Discount'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'real_discount', 'sortable' => false, 'renderer' => 'gorilla_report/adminhtml_order_renderer_discount'));
     $this->addColumn('real_total', array('header' => Mage::helper('gorilla_report')->__('Total'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'order_total', 'sortable' => false));
     $this->addExportType('*/*/exportCouponsCsv', Mage::helper('adminhtml')->__('CSV'));
     $this->addExportType('*/*/exportCouponsExcel', Mage::helper('adminhtml')->__('Excel XML'));
     return Mage_Adminhtml_Block_Report_Grid_Abstract::_prepareColumns();
 }