3

I want to be able to see the current stock for an item in the product ordered report. So you can see the month sell for that item and see how many I have left, all on the same screen.

I've Modified \app\code\core\Mage\Adminhtml\Block\Report\Product\Sold\Grid.php

adding:

 $this->addColumn('qty', array(
        'header'    =>Mage::helper('reports')->__('Stock Qty'),
        'width'     =>'120px',
        'align'     =>'right',
        'index'     =>'qty',
        'type'      =>'number'
    ));

However it will show an empty column

1 Answers1

0

Qty is a coulmn which corresponds to products while sales order grid corresponds to the sales tables. What you can do it :

1) Create a sales order attribute programatically. 2) Write an observer on sales_order_place_after and set the value of this attribute based on the product stock available after the order has been placed. 3) Inside Grid.php, add column name of your custom sales attribute instead of qty.

Mihir Bhende
  • 8,677
  • 1
  • 30
  • 37