Skip to main content
added 101 characters in body
Source Link
Shoaib Munir
  • 9.6k
  • 10
  • 53
  • 108

please follow this

change _prepareCollection() function with this

please follow this
change _prepareCollection() function with this 

protected function _prepareCollection() { $collection = Mage::getResourceModel($this->_getCollectionClass()); $collection->getSelect()->join(array('invoice' => 'sales_flat_invoice'), 'invoice.entity_id = main_table.entity_id', null) ->columns('(invoice.grand_total - invoice.tax_amount) AS grand_excl_tax'); $this->setCollection($collection); return parent::_prepareCollection(); }
and add Column in _prepareColumns() function
$this->addColumn('grand_excl_tax', array( 'header' => Mage::helper('customer')->__('GrandTotal(excl. tax)'), 'index' => 'grand_excl_tax', 'filter_condition_callback' => array($this, '_applyMyFilter'), 'type' => 'currency', 'align' => 'right', 'currency' => 'order_currency_code', ));
and add this _applyMyFilter function for filter_condition_callback
protected function _applyMyFilter(Varien_Data_Collection_Db $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column) { $select = $collection->getSelect(); $field = $column->getIndex(); $value = $column->getFilter()->getValue(); $select->where("invoice.grand_total - invoice.tax_amount>?", $value['from']); $select->where("invoice.grand_total - invoice.tax_amount protected function _prepareCollection() { $collection = Mage::getResourceModel($this->_getCollectionClass()); $collection->getSelect()->join(array('invoice' => 'sales_flat_invoice'), 'invoice.entity_id = main_table.entity_id', null) ->columns('(invoice.grand_total - invoice.tax_amount) AS grand_excl_tax'); $this->setCollection($collection); return parent::_prepareCollection(); } <br> and add Column in _prepareColumns() function <br> $this->addColumn('grand_excl_tax', array( 'header' => Mage::helper('customer')->__('GrandTotal(excl. tax)'), 'index' => 'grand_excl_tax', 'filter_condition_callback' => array($this, '_applyMyFilter'), 'type' => 'currency', 'align' => 'right', 'currency' => 'order_currency_code', ));

and add this _applyMyFilter function for filter_condition_callback

protected function _applyMyFilter(Varien_Data_Collection_Db $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column)
{
    
    $select = $collection->getSelect();
    $field = $column->getIndex();
    $value = $column->getFilter()->getValue();
    $select->where("invoice.grand_total - invoice.tax_amount>?", $value['from']);
    $select->where("invoice.grand_total - invoice.tax_amount<?", $value['to']);
}
please follow this
change _prepareCollection() function with this 

protected function _prepareCollection() { $collection = Mage::getResourceModel($this->_getCollectionClass()); $collection->getSelect()->join(array('invoice' => 'sales_flat_invoice'), 'invoice.entity_id = main_table.entity_id', null) ->columns('(invoice.grand_total - invoice.tax_amount) AS grand_excl_tax'); $this->setCollection($collection); return parent::_prepareCollection(); }
and add Column in _prepareColumns() function
$this->addColumn('grand_excl_tax', array( 'header' => Mage::helper('customer')->__('GrandTotal(excl. tax)'), 'index' => 'grand_excl_tax', 'filter_condition_callback' => array($this, '_applyMyFilter'), 'type' => 'currency', 'align' => 'right', 'currency' => 'order_currency_code', ));
and add this _applyMyFilter function for filter_condition_callback
protected function _applyMyFilter(Varien_Data_Collection_Db $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column) { $select = $collection->getSelect(); $field = $column->getIndex(); $value = $column->getFilter()->getValue(); $select->where("invoice.grand_total - invoice.tax_amount>?", $value['from']); $select->where("invoice.grand_total - invoice.tax_amount

please follow this

change _prepareCollection() function with this

protected function _prepareCollection()
    {
        $collection = Mage::getResourceModel($this->_getCollectionClass());
        $collection->getSelect()->join(array('invoice' => 'sales_flat_invoice'),
    'invoice.entity_id = main_table.entity_id', null)
    ->columns('(invoice.grand_total - invoice.tax_amount) AS grand_excl_tax'); 
      
         $this->setCollection($collection);
         return parent::_prepareCollection();
         
    }
<br>
and add Column in _prepareColumns() function 

<br>
$this->addColumn('grand_excl_tax', array(
            'header'    => Mage::helper('customer')->__('GrandTotal(excl. tax)'),
            'index'     => 'grand_excl_tax',
            'filter_condition_callback' => array($this, '_applyMyFilter'),
            'type'      => 'currency',
            'align'     => 'right',
            'currency'  => 'order_currency_code',
        ));

and add this _applyMyFilter function for filter_condition_callback

protected function _applyMyFilter(Varien_Data_Collection_Db $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column)
{
    
    $select = $collection->getSelect();
    $field = $column->getIndex();
    $value = $column->getFilter()->getValue();
    $select->where("invoice.grand_total - invoice.tax_amount>?", $value['from']);
    $select->where("invoice.grand_total - invoice.tax_amount<?", $value['to']);
}
deleted 516 characters in body
Source Link

use protected function _applyMyFilter(Varien_Data_Collection_Db $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column) {

$select = $collection->getSelect();
$field = $column->getIndex();
$value = $column->getFilter()->getValue();
$select->where("invoice.grand_total - invoice.tax_amount>?", $value['from']);
$select->where("invoice.grand_total - invoice.tax_amount<?", $value['to']);
please follow this
change _prepareCollection() function with this 

protected function _prepareCollection() { $collection = Mage::getResourceModel($this->_getCollectionClass()); $collection->getSelect()->join(array('invoice' => 'sales_flat_invoice'), 'invoice.entity_id = main_table.entity_id', null) ->columns('(invoice.grand_total - invoice.tax_amount) AS grand_excl_tax'); $this->setCollection($collection); return parent::_prepareCollection(); }
and add Column in _prepareColumns() function
$this->addColumn('grand_excl_tax', array( 'header' => Mage::helper('customer')->__('GrandTotal(excl. tax)'), 'index' => 'grand_excl_tax', 'filter_condition_callback' => array($this, '_applyMyFilter'), 'type' => 'currency', 'align' => 'right', 'currency' => 'order_currency_code', ));
and add this _applyMyFilter function for filter_condition_callback
protected function _applyMyFilter(Varien_Data_Collection_Db $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column) { $select = $collection->getSelect(); $field = $column->getIndex(); $value = $column->getFilter()->getValue(); $select->where("invoice.grand_total - invoice.tax_amount>?", $value['from']); $select->where("invoice.grand_total - invoice.tax_amount

}

use protected function _applyMyFilter(Varien_Data_Collection_Db $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column) {

$select = $collection->getSelect();
$field = $column->getIndex();
$value = $column->getFilter()->getValue();
$select->where("invoice.grand_total - invoice.tax_amount>?", $value['from']);
$select->where("invoice.grand_total - invoice.tax_amount<?", $value['to']);

}

please follow this
change _prepareCollection() function with this 

protected function _prepareCollection() { $collection = Mage::getResourceModel($this->_getCollectionClass()); $collection->getSelect()->join(array('invoice' => 'sales_flat_invoice'), 'invoice.entity_id = main_table.entity_id', null) ->columns('(invoice.grand_total - invoice.tax_amount) AS grand_excl_tax'); $this->setCollection($collection); return parent::_prepareCollection(); }
and add Column in _prepareColumns() function
$this->addColumn('grand_excl_tax', array( 'header' => Mage::helper('customer')->__('GrandTotal(excl. tax)'), 'index' => 'grand_excl_tax', 'filter_condition_callback' => array($this, '_applyMyFilter'), 'type' => 'currency', 'align' => 'right', 'currency' => 'order_currency_code', ));
and add this _applyMyFilter function for filter_condition_callback
protected function _applyMyFilter(Varien_Data_Collection_Db $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column) { $select = $collection->getSelect(); $field = $column->getIndex(); $value = $column->getFilter()->getValue(); $select->where("invoice.grand_total - invoice.tax_amount>?", $value['from']); $select->where("invoice.grand_total - invoice.tax_amount
deleted 516 characters in body
Source Link

use protected function _applyMyFilter(Varien_Data_Collection_Db $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column) {

please follow this
change _prepareCollection() function with this 

protected function _prepareCollection() { $collection = Mage::getResourceModel($this->_getCollectionClass()); $collection->getSelect()->join(array('invoice' => 'sales_flat_invoice'), 'invoice.entity_id = main_table.entity_id', null) ->columns('(invoice.grand_total - invoice.tax_amount) AS grand_excl_tax'); $this->setCollection($collection); return parent::_prepareCollection(); }
and add Column in _prepareColumns() function
$this->addColumn('grand_excl_tax', array( 'header' => Mage::helper('customer')->__('GrandTotal(excl. tax)'), 'index' => 'grand_excl_tax', 'filter_condition_callback' => array($this, '_applyMyFilter'), 'type' => 'currency', 'align' => 'right', 'currency' => 'order_currency_code', ));
and add this _applyMyFilter function for filter_condition_callback
protected function _applyMyFilter(Varien_Data_Collection_Db $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column) { $select = $collection->getSelect(); $field = $column->getIndex(); $value = $column->getFilter()->getValue(); $select->where("invoice.grand_total - invoice.tax_amount>?", $value['from']); $select->where("invoice.grand_total - invoice.tax_amount $select = $collection->getSelect(); $field = $column->getIndex(); $value = $column->getFilter()->getValue(); $select->where("invoice.grand_total - invoice.tax_amount>?", $value['from']); $select->where("invoice.grand_total - invoice.tax_amount<?", $value['to']);

}

please follow this
change _prepareCollection() function with this 

protected function _prepareCollection() { $collection = Mage::getResourceModel($this->_getCollectionClass()); $collection->getSelect()->join(array('invoice' => 'sales_flat_invoice'), 'invoice.entity_id = main_table.entity_id', null) ->columns('(invoice.grand_total - invoice.tax_amount) AS grand_excl_tax'); $this->setCollection($collection); return parent::_prepareCollection(); }
and add Column in _prepareColumns() function
$this->addColumn('grand_excl_tax', array( 'header' => Mage::helper('customer')->__('GrandTotal(excl. tax)'), 'index' => 'grand_excl_tax', 'filter_condition_callback' => array($this, '_applyMyFilter'), 'type' => 'currency', 'align' => 'right', 'currency' => 'order_currency_code', ));
and add this _applyMyFilter function for filter_condition_callback
protected function _applyMyFilter(Varien_Data_Collection_Db $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column) { $select = $collection->getSelect(); $field = $column->getIndex(); $value = $column->getFilter()->getValue(); $select->where("invoice.grand_total - invoice.tax_amount>?", $value['from']); $select->where("invoice.grand_total - invoice.tax_amount

use protected function _applyMyFilter(Varien_Data_Collection_Db $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column) {

$select = $collection->getSelect();
$field = $column->getIndex();
$value = $column->getFilter()->getValue();
$select->where("invoice.grand_total - invoice.tax_amount>?", $value['from']);
$select->where("invoice.grand_total - invoice.tax_amount<?", $value['to']);

}

added 96 characters in body
Source Link
Loading
Source Link
Loading