Medma_Stock_Control - Version 2.0.2

Version Notes

Compatible with latest magento version

Download this release

Release Info

Developer Medma Infomatix
Extension Medma_Stock_Control
Version 2.0.2
Comparing to
See all releases


Code changes from version 2.0.1 to 2.0.2

app/code/local/Medma/Stockcontrol/Block/Adminhtml/Stockcontrol.php~ DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
- class Medma_Printcodes_Block_Adminhtml_Printcodes extends Mage_Adminhtml_Block_Widget_Grid_Container
3
- {
4
- public function __construct()
5
- {
6
- parent::__construct();
7
- $this->_controller = 'adminhtml_printcodes';
8
- $this->_blockGroup = 'printcodes';
9
- $this->_headerText = Mage::helper('printcodes')->__('Enter Print Code');
10
- //$this->_removeButton('add');
11
- //d($this);
12
-
13
- }
14
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Medma/Stockcontrol/Block/Adminhtml/Stockcontrol/Edit.php~ DELETED
@@ -1,118 +0,0 @@
1
- <?php
2
- class Medma_Stockcontrol_Block_Adminhtml_Stockcontrol_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
3
- {
4
- public function __construct()
5
- {
6
- parent::__construct();
7
- $this->_objectId = 'id';
8
- $this->_blockGroup = 'stockcontrol';
9
- $this->_controller = 'adminhtml_stockcontrol';
10
- $this->_formScripts[] = "
11
-
12
- function getSku(base_url,product_id,next_quantity_id,secret_key){
13
-
14
-
15
- //alert(base_url+product_id+next_quantity_id+secret_key);
16
- new Ajax.Request(base_url+'stockcontrol/adminhtml_stockcontrol/getSku/product_id/'+product_id+'/key/',
17
-
18
-
19
- {
20
-
21
-
22
- method:'Post',
23
-
24
-
25
- onSuccess: function(transport){
26
-
27
-
28
- var response = transport.responseText || 'no response text';
29
- //alert('success'+response);
30
-
31
- document.getElementById(next_quantity_id).value=response;
32
-
33
- },
34
-
35
-
36
- onFailure: function(){
37
-
38
-
39
-
40
-
41
-
42
- alert('Failure in Ajax');
43
-
44
-
45
- }
46
-
47
-
48
- });
49
-
50
-
51
- }
52
-
53
- function getPresentQty(base_url,product_id,next_quantity_id,secret_key){
54
-
55
-
56
- //alert(base_url+product_id+next_quantity_id+secret_key);
57
- new Ajax.Request(base_url+'stockcontrol/adminhtml_stockcontrol/getPresentQty/product_id/'+product_id+'/key/'+secret_key,
58
-
59
-
60
- {
61
-
62
-
63
- method:'Post',
64
-
65
-
66
- onSuccess: function(transport){
67
-
68
-
69
- var response = transport.responseText || 'no response text';
70
- //alert('success'+response);
71
-
72
- document.getElementById(next_quantity_id).value=response;
73
-
74
- },
75
-
76
-
77
- onFailure: function(){
78
-
79
-
80
-
81
-
82
-
83
- alert('Failure in Ajax');
84
-
85
-
86
- }
87
-
88
-
89
- });
90
-
91
-
92
- }
93
-
94
-
95
-
96
-
97
- ";
98
-
99
- }
100
-
101
-
102
- public function getHeaderText()
103
-
104
- {
105
-
106
- if( Mage::registry('stockcontrol_data') && Mage::registry('stockcontrol_data')->getId() ) {
107
-
108
- return Mage::helper('stockcontrol')->__("Edit Stock '%s'", $this->htmlEscape(Mage::registry('stockcontrol_data')->getName()));
109
-
110
-
111
- } else {
112
-
113
- return Mage::helper('stockcontrol')->__('Add Stock');
114
-
115
- }
116
-
117
- }
118
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Medma/Stockcontrol/Block/Adminhtml/Stockcontrol/Edit/Form.php~ DELETED
@@ -1,148 +0,0 @@
1
- <?php
2
-
3
- class Medma_Stockcontrol_Block_Adminhtml_Stockcontrol_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
- {
5
- protected function _prepareForm()
6
- {
7
- $form = new Varien_Data_Form(array(
8
- 'id' => 'edit_form',
9
- 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
10
- 'method' => 'post'));
11
-
12
- $form->setUseContainer(true);
13
- $this->setForm($form);
14
- $hlp = Mage::helper('stockcontrol');
15
-
16
-
17
-
18
- $collection = Mage::getResourceModel('stockcontrol/stockcontrol');
19
- /************************Code to get the base URL*******************/
20
-
21
-
22
-
23
- $getbase_url = $this->getBaseUrl();
24
-
25
-
26
-
27
- /******************************************************************/
28
-
29
-
30
-
31
- /*****Code to get the Secret Key of an controller Action in magento admin panel**********/
32
-
33
-
34
-
35
-
36
- $getPresentQty_key = Mage::getSingleton('adminhtml/url')->getSecretKey("adminhtml_stockcontrol","getPresentQtyAction");
37
-
38
-
39
-
40
- /******************************************************************/
41
-
42
-
43
- $products_model_coll=Mage::getModel('catalog/product')->getCollection();
44
-
45
- $products_values= array();
46
-
47
- $products_values[] = array(
48
-
49
- 'label' => 'Select Product',
50
-
51
- 'value' => ''
52
- );
53
- $operation_values= array();
54
- $operation_model=array('Stock In'=>'Stock In','Stock Out'=>'Stock Out');
55
- $operation_values[] = array(
56
-
57
- 'label' => 'Select Operation',
58
- 'value' => '',
59
-
60
- );
61
- foreach($operation_model as $key => $values)
62
- {
63
- $operation_values[] = array(
64
- 'label' => $values,
65
- 'value' => $key
66
- );
67
- }
68
-
69
- foreach($products_model_coll->getData() as $key => $values):
70
- $products_model = Mage::getModel('catalog/product')->load($values['entity_id']);
71
-
72
- $products_values[] = array(
73
- 'label' => $products_model->getName(),
74
- 'value' => $values['entity_id']
75
- );
76
-
77
- endforeach;
78
-
79
-
80
-
81
- $fldInfo = $form->addFieldset('stockcontrol_info', array('legend'=> $hlp->__('Stockcontrol')));
82
-
83
- $fldInfo->addField('product_id', 'select', array(
84
-
85
- 'label' => $hlp->__('Product Name'),
86
-
87
- 'class' => 'required-entry',
88
-
89
- 'name' => 'product_id',
90
-
91
- 'values' =>$products_values,
92
-
93
- 'onchange' => "getSku('$getbase_url',this.value,'sku',''), getPresentQty('$getbase_url',this.value,'present_qty','$getPresentQty_key');"
94
- ));
95
- $fldInfo->addField('sku', 'text', array(
96
- 'label' => $hlp->__('sku'),
97
- 'name' => 'sku',
98
- 'readonly' =>'true',
99
-
100
- ));
101
-
102
-
103
- $fldInfo->addField('present_qty', 'text', array(
104
- 'label' => $hlp->__('Present Qty'),
105
- 'name' => 'present_qty',
106
- 'readonly' =>'true',
107
-
108
- ));
109
- $fldInfo->addField('operation', 'select', array(
110
- 'label' => $hlp->__('Operation'),
111
- 'class' => 'required-entry',
112
- 'values' =>$operation_values,
113
- 'name' => 'operation',
114
-
115
- ));
116
- $fldInfo->addField('added_qty', 'text', array(
117
- 'label' => $hlp->__('Qty(Qty(Stock In/Stock Out)'),
118
- 'class' => 'required-entry',
119
- 'name' => 'added_qty',
120
-
121
- ));
122
- $fldInfo->addField('reason', 'textarea', array(
123
- 'label' => $hlp->__('Reason For Stock Adjustment'),
124
- 'class' => 'required-entry',
125
- 'name' => 'reason',
126
-
127
- ));
128
-
129
-
130
-
131
-
132
- ?>
133
-
134
- <?php
135
-
136
-
137
-
138
-
139
-
140
- if ( Mage::registry('stockcontrol_data') ) {
141
- $form->setValues(Mage::registry('stockcontrol_data')->getData());
142
- }
143
-
144
-
145
- return parent::_prepareForm();
146
-
147
- }
148
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Medma/Stockcontrol/Block/Adminhtml/Stockcontrol/Edit/Tab/Form.php~ DELETED
@@ -1,119 +0,0 @@
1
- <?php
2
- class Medma_Groups_Block_Adminhtml_Groups_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
3
- {
4
- protected function _prepareForm()
5
- {
6
- $form = new Varien_Data_Form(array(
7
- 'id' => 'edit_form',
8
- 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
9
- 'method' => 'post'));
10
-
11
- $form->setUseContainer(true);
12
- $this->setForm($form);
13
- $hlp = Mage::helper('brands');
14
-
15
- /*******************Code to display values from multiple tables*********************/
16
-
17
- $id = Mage::registry('brands_data')->getId();
18
-
19
- $brand_model = Mage::registry('brands_data')->getData();
20
-
21
- $power_model = Mage::getModel('brands/power')->getCollection()->addFieldToFilter('brand_id',array('eq'=>$id))->getData();
22
-
23
- // $diameter_model = Mage::getModel('brands/power')->getCollection()->addFieldToFilter('brand_id',array('eq'=>$id))->getData();
24
- //
25
- // $power_model = Mage::getModel('brands/power')->getCollection()->addFieldToFilter('brand_id',array('eq'=>$id))->getData();
26
- //
27
- // $power_model = Mage::getModel('brands/power')->getCollection()->addFieldToFilter('brand_id',array('eq'=>$id))->getData();
28
- //
29
- // $power_model = Mage::getModel('brands/power')->getCollection()->addFieldToFilter('brand_id',array('eq'=>$id))->getData();
30
-
31
- /*******************Code to display values from multiple tables*********************/
32
-
33
-
34
- $fldInfo = $form->addFieldset('brands_info', array('legend'=> $hlp->__('Brands Details')));
35
-
36
- // $fldInfo->addField('store_id', 'select', array(
37
- // 'label' => $hlp->__('Store View'),
38
- // 'class' => 'required-entry',
39
- // 'required' => true,
40
- // 'name' => 'store_id',
41
- // // 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm()
42
- // ));
43
- //
44
- // $fldInfo->addField('follow_up', 'select', array(
45
- // 'label' => $hlp->__('Follow Up'),
46
- // 'name' => 'follow_up',
47
- // 'options' => array(
48
- // 'first' => $hlp->__('First'),
49
- // 'second' => $hlp->__('Second'),
50
- // 'third' => $hlp->__('Third'),
51
- // ),
52
- // ));
53
-
54
- // $fldInfo->addField('sheduled_at', 'date', array(
55
- // 'label' => $hlp->__('Alert Will Be Sent On'),
56
- // 'image' => $this->getSkinUrl('images/grid-cal.gif'),
57
- // 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
58
- // 'name' => 'sheduled_at',
59
- // ));
60
- //
61
- // $fldInfo->addField('customer_email', 'text', array(
62
- // 'label' => $hlp->__('Customer E-mail'),
63
- // 'class' => 'required-entry validate-email',
64
- // 'required' => true,
65
- // 'name' => 'customer_email',
66
- // ));
67
- // $fldInfo->addField('brand_id', 'text', array(
68
- // 'label' => $hlp->__('Brand ID'),
69
- // 'class' => 'required-entry',
70
- // 'required' => true,
71
- // 'name' => 'brand_id',
72
- // ));
73
- $fldInfo->addField('brand_name', 'text', array(
74
- 'label' => $hlp->__('Brand Name'),
75
- 'class' => 'required-entry',
76
- 'required' => true,
77
- 'name' => 'brand_name',
78
- ));
79
-
80
- $fldInfo->addField('power_value', 'text', array(
81
- 'label' => $hlp->__('Power Value'),
82
- 'class' => 'required-entry',
83
- 'required' => true,
84
- 'name' => 'power_value',
85
- ));
86
- // $fldInfo->addField('power_value', 'select', array(
87
- // 'label' => $hlp->__('Power Value'),
88
- // 'options' => array(
89
- // 'first' => $hlp->__('First'),
90
- // 'second' => $hlp->__('Second'),
91
- // 'third' => $hlp->__('Third')),
92
- // 'name' => 'power_value',
93
- // ));
94
- //
95
- // $fldInfo->addField('products', 'textarea', array(
96
- // 'label' => $hlp->__('Produsts'),
97
- // 'class' => 'required-entry',
98
- // 'required' => true,
99
- // 'name' => 'products',
100
- // 'style' => 'width:35em;height:15em;',
101
- // ));
102
- // $fldInfo->addField('is_preprocessed', 'hidden', array(
103
- // 'name' => 'is_preprocessed',
104
- // 'value' => 1,
105
- // ));
106
-
107
- if ( Mage::registry('brands_data') ) {
108
- //$form->setValues(Mage::registry('brands_data')->getData());
109
- $form->setValues(array_merge($power_model[0],$brand_model));
110
-
111
-
112
- }
113
-
114
- return parent::_prepareForm();
115
- }
116
- }
117
-
118
- ?>
119
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Medma/Stockcontrol/Block/Adminhtml/Stockcontrol/Grid.php CHANGED
@@ -1,95 +1,97 @@
1
  <?php
 
2
  /**
3
  * @author Adjustware
4
- */
5
- class Medma_Stockcontrol_Block_Adminhtml_Stockcontrol_Grid extends Mage_Adminhtml_Block_Widget_Grid
6
- {
7
- public function __construct()
8
- {
9
  parent::__construct();
10
  $this->setId('stockcontrolGrid');
11
  $this->setDefaultSort('id');
12
- //$this->_removeButton('add_new');
13
-
14
- }
15
 
16
- protected function _prepareCollection()
17
- {
18
- $collection = Mage::getModel('stockcontrol/stockcontrol')->getCollection();
19
- $catalogTable = Mage::getSingleton('core/resource')->getTableName('catalog_product_flat_1');
20
-
21
- $collection->getSelect()->join(
22
- array('pc'=>$catalogTable),
23
- 'main_table.product_id = pc.entity_id',
24
- array('product_name'=>'pc.name'));
25
- $collection->getSelect()->join(
26
- array('cisi'=>$catalogTable),
27
- 'main_table.product_id = cisi.entity_id',
28
- array('sku'=>'cisi.sku'));
 
 
 
 
 
 
 
29
  $this->setCollection($collection);
30
  return parent::_prepareCollection();
31
- }
32
 
 
 
 
 
 
 
 
 
33
 
34
- protected function _prepareColumns()
35
- {
36
- $this->addColumn('product_id', array(
37
- 'header'=> Mage::helper('stockcontrol')->__('Product Name'),
38
- 'width' => '80px',
39
- 'type' => 'text',
40
- 'index' => 'product_name',
41
- 'filter_index' => 'main_table.product_name'
42
- ));
43
- $this->addColumn('sku', array(
44
- 'header'=> Mage::helper('stockcontrol')->__('Sku'),
45
- 'width' => '80px',
46
- 'type' => 'text',
47
- 'index' => 'sku'
48
- ));
49
-
50
- $this->addColumn('old_qty', array(
51
- 'header' => Mage::helper('stockcontrol')->__('Old Qty'),
52
- 'index' => 'present_qty',
53
- 'type' => 'text',
54
- 'width' => '100px',
55
- 'filter_index' => 'main_table.present_qty'
56
- ));
57
-
58
- $this->addColumn('added_qty', array(
59
- 'header' => Mage::helper('stockcontrol')->__('Qty(Stock In/Stock Out)'),
60
- 'index' => 'added_qty',
61
- 'type' => 'text',
62
- 'width' => '100px',
63
- ));
64
- $this->addColumn('present_qty', array(
65
- 'header' => Mage::helper('stockcontrol')->__('Present Qty'),
66
- 'index' => 'total_qty',
67
- 'type' => 'text',
68
- 'width' => '100px',
69
- ));
70
- $this->addColumn('operation', array(
71
- 'header' => Mage::helper('stockcontrol')->__('Operation'),
72
- 'index' => 'operation',
73
- 'type' => 'text',
74
- 'width' => '100px',
75
- ));
76
- $this->addColumn('qty_added_date', array(
77
- 'header' => Mage::helper('stockcontrol')->__('Qty(Stock In/Stock Out) Date'),
78
- 'index' => 'qty_added_date',
79
- 'type' => 'text',
80
- 'width' => '100px',
81
- ));
82
- $this->addColumn('added_by', array(
83
- 'header' => Mage::helper('stockcontrol')->__('Added By'),
84
- 'index' => 'added_by',
85
- 'type' => 'text',
86
- 'width' => '100px',
87
- ));
88
 
89
- return $this;
90
- }
 
 
 
 
 
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
 
93
-
 
94
 
95
  }
1
  <?php
2
+
3
  /**
4
  * @author Adjustware
5
+ */
6
+ class Medma_Stockcontrol_Block_Adminhtml_Stockcontrol_Grid extends Mage_Adminhtml_Block_Widget_Grid {
7
+
8
+ public function __construct() {
 
9
  parent::__construct();
10
  $this->setId('stockcontrolGrid');
11
  $this->setDefaultSort('id');
12
+ //$this->_removeButton('add_new');
13
+ }
 
14
 
15
+ protected function _prepareCollection() {
16
+ // if (Mage::helper('catalog/product_flat')->isEnabled()) {
17
+ // $collection = Mage::getModel('stockcontrol/stockcontrol')->getCollection();
18
+ // $catalogTable = Mage::getSingleton('core/resource')->getTableName('catalog_product_flat_1');
19
+ //
20
+ // $collection->getSelect()->join(
21
+ // array('pc' => $catalogTable), 'main_table.product_id = pc.entity_id', array('product_name' => 'pc.name'));
22
+ // $collection->getSelect()->join(
23
+ // array('cisi' => $catalogTable), 'main_table.product_id = cisi.entity_id', array('sku' => 'cisi.sku'));
24
+ // $this->setCollection($collection);
25
+ // return parent::_prepareCollection();
26
+ // }
27
+ // $everyStore = Mage::app()->getStores();
28
+ // foreach ($everyStore as $eachStore => $val) {
29
+ // $storeCode = Mage::app()->getStore($eachStore)->getCode();
30
+ // $storeName = Mage::app()->getStore($eachStore)->getName();
31
+ // $storeID = Mage::app()->getStore($eachStore)->getId();
32
+ // echo "Code : " . $storeCode . "</br>Name : " . $storeName . "</br>ID : " . $storeID . "</br>&nbsp</br>";
33
+ // }
34
+ $collection = Mage::getModel('stockcontrol/stockcontrol')->getCollection()->join(array('productTable' => 'catalog/product'), 'main_table.product_id = productTable.entity_id');
35
  $this->setCollection($collection);
36
  return parent::_prepareCollection();
37
+ }
38
 
39
+ protected function _prepareColumns() {
40
+ $this->addColumn('product_id', array(
41
+ 'header' => Mage::helper('stockcontrol')->__('Product Name'),
42
+ 'width' => '80px',
43
+ 'type' => 'text',
44
+ 'index' => 'product_id',
45
+ 'renderer' => 'stockcontrol/adminhtml_stockcontrol_render_product'
46
+ ));
47
 
48
+ $this->addColumn('sku', array(
49
+ 'header' => Mage::helper('stockcontrol')->__('Sku'),
50
+ 'width' => '80px',
51
+ 'type' => 'text',
52
+ 'index' => 'sku'
53
+ ));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
+ $this->addColumn('old_qty', array(
56
+ 'header' => Mage::helper('stockcontrol')->__('Old Qty'),
57
+ 'index' => 'present_qty',
58
+ 'type' => 'text',
59
+ 'width' => '100px',
60
+ 'filter_index' => 'main_table.present_qty'
61
+ ));
62
 
63
+ $this->addColumn('added_qty', array(
64
+ 'header' => Mage::helper('stockcontrol')->__('Qty(Stock In/Stock Out)'),
65
+ 'index' => 'added_qty',
66
+ 'type' => 'text',
67
+ 'width' => '100px',
68
+ ));
69
+ $this->addColumn('present_qty', array(
70
+ 'header' => Mage::helper('stockcontrol')->__('Present Qty'),
71
+ 'index' => 'total_qty',
72
+ 'type' => 'text',
73
+ 'width' => '100px',
74
+ ));
75
+ $this->addColumn('operation', array(
76
+ 'header' => Mage::helper('stockcontrol')->__('Operation'),
77
+ 'index' => 'operation',
78
+ 'type' => 'text',
79
+ 'width' => '100px',
80
+ ));
81
+ $this->addColumn('qty_added_date', array(
82
+ 'header' => Mage::helper('stockcontrol')->__('Qty(Stock In/Stock Out) Date'),
83
+ 'index' => 'qty_added_date',
84
+ 'type' => 'text',
85
+ 'width' => '100px',
86
+ ));
87
+ $this->addColumn('added_by', array(
88
+ 'header' => Mage::helper('stockcontrol')->__('Added By'),
89
+ 'index' => 'added_by',
90
+ 'type' => 'text',
91
+ 'width' => '100px',
92
+ ));
93
 
94
+ return $this;
95
+ }
96
 
97
  }
app/code/local/Medma/Stockcontrol/Block/Adminhtml/Stockcontrol/Grid.php~ DELETED
@@ -1,95 +0,0 @@
1
- <?php
2
- /**
3
- * @author Adjustware
4
- */
5
- class Medma_Stockcontrol_Block_Adminhtml_Stockcontrol_Grid extends Mage_Adminhtml_Block_Widget_Grid
6
- {
7
- public function __construct()
8
- {
9
- parent::__construct();
10
- $this->setId('stockcontrolGrid');
11
- $this->setDefaultSort('id');
12
- //$this->_removeButton('add_new');
13
-
14
- }
15
-
16
- protected function _prepareCollection()
17
- {
18
- $collection = Mage::getModel('stockcontrol/stockcontrol')->getCollection();
19
- $catalogTable = Mage::getSingleton('core/resource')->getTableName('catalog_product_flat_1');
20
-
21
- $collection->getSelect()->join(
22
- array('pc'=>$catalogTable),
23
- 'main_table.product_id = pc.entity_id',
24
- array('product_name'=>'pc.name'));
25
- $collection->getSelect()->join(
26
- array('cisi'=>$catalogTable),
27
- 'main_table.product_id = cisi.entity_id',
28
- array('sku'=>'cisi.sku'));
29
- $this->setCollection($collection);
30
- return parent::_prepareCollection();
31
- }
32
-
33
-
34
- protected function _prepareColumns()
35
- {
36
- $this->addColumn('product_id', array(
37
- 'header'=> Mage::helper('stockcontrol')->__('Product Name'),
38
- 'width' => '80px',
39
- 'type' => 'text',
40
- 'index' => 'product_name',
41
- 'filter_index' => 'main_table.product_name'
42
- ));
43
- $this->addColumn('sku', array(
44
- 'header'=> Mage::helper('stockcontrol')->__('Sku'),
45
- 'width' => '80px',
46
- 'type' => 'text',
47
- 'index' => 'sku'
48
- ));
49
-
50
- $this->addColumn('old_qty', array(
51
- 'header' => Mage::helper('stockcontrol')->__('Old Qty'),
52
- 'index' => 'present_qty',
53
- 'type' => 'text',
54
- 'width' => '100px',
55
- 'filter_index' => 'main_table.present_qty'
56
- ));
57
-
58
- $this->addColumn('added_qty', array(
59
- 'header' => Mage::helper('stockcontrol')->__('Qty(Stock In/Stock Out)'),
60
- 'index' => 'added_qty',
61
- 'type' => 'text',
62
- 'width' => '100px',
63
- ));
64
- $this->addColumn('present_qty', array(
65
- 'header' => Mage::helper('stockcontrol')->__('Present Qty'),
66
- 'index' => 'total_qty',
67
- 'type' => 'text',
68
- 'width' => '100px',
69
- ));
70
- $this->addColumn('operation', array(
71
- 'header' => Mage::helper('stockcontrol')->__('Operation'),
72
- 'index' => 'operation',
73
- 'type' => 'text',
74
- 'width' => '100px',
75
- ));
76
- $this->addColumn('qty_added_date', array(
77
- 'header' => Mage::helper('stockcontrol')->__('Qty(Stock In/Stock Out) Date'),
78
- 'index' => 'qty_added_date',
79
- 'type' => 'text',
80
- 'width' => '100px',
81
- ));
82
- $this->addColumn('operation', array(
83
- 'header' => Mage::helper('stockcontrol')->__('Operation'),
84
- 'index' => 'operation',
85
- 'type' => 'text',
86
- 'width' => '100px',
87
- ));
88
-
89
- return $this;
90
- }
91
-
92
-
93
-
94
-
95
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Medma/Stockcontrol/Block/Adminhtml/Stockcontrol/Render/Product.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Medma_Stockcontrol_Block_Adminhtml_Stockcontrol_Render_Product extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row){
5
+ $product_id = $row->getData($this->getColumn()->getIndex());
6
+ return Mage::getModel('catalog/product')->load($product_id)->getName();
7
+ }
8
+
9
+ }
10
+
11
+ ?>
app/code/local/Medma/Stockcontrol/Block/Stockcontrol.php~ DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- class Medma_Printcodes_Block_Printcodes extends Mage_Core_Block_Template
3
- {
4
- protected function _toHtml()
5
- {
6
- // return 'Weldone';
7
- }
8
- public function pqr(){
9
- return 'neelima';
10
- }
11
- }
12
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Medma/Stockcontrol/controllers/Adminhtml/StockcontrolController.php CHANGED
@@ -1,176 +1,175 @@
1
  <?php
2
 
3
- class Medma_Stockcontrol_Adminhtml_StockcontrolController extends Mage_Adminhtml_Controller_action
4
- {
5
-
6
- public function preDispatch(){
7
- parent::preDispatch();
8
-
9
- #register domain event starts
10
-
11
- $generalEmail = Mage::getStoreConfig('trans_email/ident_general/email');
12
- $domainName = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
13
-
14
-
15
- Mage::dispatchEvent('medma_domain_authentication',
16
- array(
17
- 'email' => $generalEmail,
18
- 'domain_name'=>$domainName,
19
- )
20
-
21
- );
22
- #register domain event ends
23
- }
24
-
25
- public function indexAction() {
26
-
27
-
28
- $this->loadLayout();
29
- $this->_setActiveMenu('catalog/stockcontrol');
30
- //$this->_addBreadcrumb($this->__('Manage Grouped Product Discount Rule'), $this->__('Discount'));
31
- $this->_addContent($this->getLayout()->createBlock('stockcontrol/adminhtml_stockcontrol'));
32
- $this->renderLayout();
33
-
34
- }
35
-
36
- public function editAction() {
37
- $id = $this->getRequest()->getParam('id');
38
-
39
- $model = Mage::getModel('stockcontrol/stockcontrol')->load($id);
40
-
41
- if ($model->getId() || $id == 0) {
42
- $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
43
- if (!empty($data)) {
44
- $model->setData($data);
45
- }
46
-
47
- Mage::register('stockcontrol_data', $model);
48
- $this->loadLayout();
49
- $this->_setActiveMenu('catalog/stockcontrol');
50
-
51
- $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
52
-
53
- $this->_addContent($this->getLayout()->createBlock('stockcontrol/adminhtml_stockcontrol_edit'));
54
-
55
- $this->renderLayout();
56
- } else {
57
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('stockcontrol')->__('Item does not exist'));
58
- $this->_redirect('*/*/');
59
- }
60
- }
61
-
62
-
63
-
64
-
65
- public function newAction() {
66
- $this->editAction();
67
- }
68
-
69
- public function saveAction() {
70
- $id= $this->getRequest()->getParam('id');
71
- $user = Mage::getSingleton('admin/session');
72
- $userId = $user->getUser()->getUserId();
73
- $model_user= Mage::getModel('admin/user')->load($userId);
74
- $addedby = $model_user['username'];
75
-
76
-
77
- $model= Mage::getModel('stockcontrol/stockcontrol');
78
-
79
- if ($data = $this->getRequest()->getPost()) {
80
- if($data['operation']=='Stock In'){
81
- $total_qty=$data['present_qty']+$data['added_qty'];
82
- }elseif($data['operation']=='Stock Out'){
83
- if($data['present_qty']<='0'){
84
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('stockcontrol')->__('Quantity is less to perform Stock Out operation'));
85
- $this->_redirect('*/*/');
86
- return;
87
- }else{
88
- $total_qty=$data['present_qty']-$data['added_qty'];
89
- }
90
- }
91
- $model_product= Mage::getModel('catalog/product');
92
- $_product = $model_product->load($data['product_id']);
93
- $stockData = $_product->getStockData();
94
- $stockData['qty'] = $total_qty;
95
- if($total_qty>0){
96
- $stockData['is_in_stock'] = 1;
97
- }else{
98
- $stockData['is_in_stock'] = 0;
99
- }
100
- $_product->setStockData($stockData);
101
- $_product->save();
102
- $user = Mage::getSingleton('admin/session')->getData();
103
- $userId = $user['user']['user_id'];
104
- $data['total_qty']=$total_qty;
105
- $data['added_by']=$userId ;
106
- // $stocklevel = (int)Mage::getModel('cataloginventory/stock_item')
107
- // ->loadByProduct($_product)->getQty();
108
- // echo $stocklevel;exit;
109
- try {
110
- $data['added_by']=$addedby;
111
- $model->setData($data)->setId($id);
112
- $model->save();
113
-
114
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('stockcontrol')->__('Quantity Update Operation Perform successfully'));
115
-
116
- Mage::getSingleton('adminhtml/session')->setFormData(false);
117
-
118
- $this->_redirect('*/*/');
119
- return;
120
- } catch (Exception $e) {
121
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
122
- Mage::getSingleton('adminhtml/session')->setFormData($data);
123
- $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
124
- return;
125
  }
126
- }
127
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('stockcontrol')->__('Unable to find item to save'));
128
- $this->_redirect('*/*/');
129
- }
130
- public function deleteAction() {
131
- if( $this->getRequest()->getParam('id') > 0 ) {
132
- try {
133
- $model = Mage::getModel('stockcontrol/stockcontrol');
134
-
135
- $model->setId($this->getRequest()->getParam('id'))
136
- ->delete();
137
-
138
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
139
- $this->_redirect('*/*/');
140
- } catch (Exception $e) {
141
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
142
- $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
143
- }
144
- }
145
- $this->_redirect('*/*/');
146
- }
147
-
148
- public function getPresentQtyAction(){
149
- $product_id = $this->getRequest()->getParam('product_id');
150
-
151
- $model = Mage::getModel('catalog/product');
152
- $_product = $model->load($product_id);
153
- $stocklevel = (int)Mage::getModel('cataloginventory/stock_item')
154
- ->loadByProduct($_product)->getQty();
155
-
156
-
157
- echo $stocklevel;
158
- }
159
-
160
- /*
161
- This function use for get SKU
162
- */
163
- public function getSkuuAction(){
164
-
165
- $product_id = $this->getRequest()->getParam('product_id');
166
-
167
- $model = Mage::getModel('catalog/product');
168
- $_product = $model->load($product_id);
169
- $prdsku = $_product->getSku();
170
-
171
-
172
- echo $prdsku;
173
- }
174
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
 
176
  }
1
  <?php
2
 
3
+ class Medma_Stockcontrol_Adminhtml_StockcontrolController extends Mage_Adminhtml_Controller_action {
4
+
5
+ public function preDispatch() {
6
+ parent::preDispatch();
7
+
8
+ #register domain event starts
9
+
10
+ $generalEmail = Mage::getStoreConfig('trans_email/ident_general/email');
11
+ $domainName = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
12
+
13
+
14
+ Mage::dispatchEvent('medma_domain_authentication', array(
15
+ 'email' => $generalEmail,
16
+ 'domain_name' => $domainName,
17
+ )
18
+ );
19
+ #register domain event ends
20
+ }
21
+
22
+ public function indexAction() {
23
+
24
+
25
+ $this->loadLayout();
26
+ $this->_setActiveMenu('catalog/stockcontrol');
27
+ //$this->_addBreadcrumb($this->__('Manage Grouped Product Discount Rule'), $this->__('Discount'));
28
+ $this->_addContent($this->getLayout()->createBlock('stockcontrol/adminhtml_stockcontrol'));
29
+ $this->renderLayout();
30
+ }
31
+
32
+ public function editAction() {
33
+ $id = $this->getRequest()->getParam('id');
34
+
35
+ $model = Mage::getModel('stockcontrol/stockcontrol')->load($id);
36
+
37
+ if ($model->getId() || $id == 0) {
38
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
39
+ if (!empty($data)) {
40
+ $model->setData($data);
41
+ }
42
+
43
+ Mage::register('stockcontrol_data', $model);
44
+ $this->loadLayout();
45
+ $this->_setActiveMenu('catalog/stockcontrol');
46
+
47
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
48
+
49
+ $this->_addContent($this->getLayout()->createBlock('stockcontrol/adminhtml_stockcontrol_edit'));
50
+
51
+ $this->renderLayout();
52
+ } else {
53
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('stockcontrol')->__('Item does not exist'));
54
+ $this->_redirect('*/*/');
55
+ }
56
+ }
57
+
58
+ public function newAction() {
59
+ $this->editAction();
60
+ }
61
+
62
+ public function saveAction() {
63
+ $id = $this->getRequest()->getParam('id');
64
+ $user = Mage::getSingleton('admin/session');
65
+ $userId = $user->getUser()->getUserId();
66
+ $model_user = Mage::getModel('admin/user')->load($userId);
67
+ $addedby = $model_user['username'];
68
+
69
+
70
+ $model = Mage::getModel('stockcontrol/stockcontrol');
71
+
72
+ if ($data = $this->getRequest()->getPost()) {
73
+ if ($data['operation'] == 'Stock In') {
74
+ $total_qty = $data['present_qty'] + $data['added_qty'];
75
+ } elseif ($data['operation'] == 'Stock Out') {
76
+ if ($data['present_qty'] <= '0') {
77
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('stockcontrol')->__('Quantity is less to perform Stock Out operation'));
78
+ $this->_redirect('*/*/');
79
+ return;
80
+ } else {
81
+ $total_qty = $data['present_qty'] - $data['added_qty'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  }
83
+ }
84
+
85
+ $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($data['product_id']);
86
+ $stockData['qty'] = $total_qty;
87
+ if ($total_qty > 0) {
88
+ $stockData['is_in_stock'] = 1;
89
+ } else {
90
+ $stockData['is_in_stock'] = 0;
91
+ }
92
+
93
+ foreach ($stockData as $field => $value) {
94
+ $stockItem->setData($field, $value ? $value : 0);
95
+ }
96
+ $stockItem->save();
97
+
98
+ // Init the object again after it has been saved so we get the full object
99
+ $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($data['product_id']);
100
+ $stockItem->setData('qty', $stockData['qty']);
101
+ $stockItem->save();
102
+
103
+ $user = Mage::getSingleton('admin/session')->getData();
104
+ $userId = $user['user']['user_id'];
105
+ $data['total_qty'] = $total_qty;
106
+ $data['added_by'] = $userId;
107
+ try {
108
+ $data['added_by'] = $addedby;
109
+ $model->setData($data)->setId($id);
110
+ $model->save();
111
+
112
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('stockcontrol')->__('Quantity Update Operation Perform successfully'));
113
+
114
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
115
+
116
+ $this->_redirect('*/*/');
117
+ return;
118
+ } catch (Exception $e) {
119
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
120
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
121
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
122
+ return;
123
+ }
124
+ }
125
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('stockcontrol')->__('Unable to find item to save'));
126
+ $this->_redirect('*/*/');
127
+ }
128
+
129
+ public function deleteAction() {
130
+ if ($this->getRequest()->getParam('id') > 0) {
131
+ try {
132
+ $model = Mage::getModel('stockcontrol/stockcontrol');
133
+
134
+ $model->setId($this->getRequest()->getParam('id'))
135
+ ->delete();
136
+
137
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
138
+ $this->_redirect('*/*/');
139
+ } catch (Exception $e) {
140
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
141
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
142
+ }
143
+ }
144
+ $this->_redirect('*/*/');
145
+ }
146
+
147
+ public function getPresentQtyAction() {
148
+ $product_id = $this->getRequest()->getParam('product_id');
149
+
150
+ $model = Mage::getModel('catalog/product');
151
+ $_product = $model->load($product_id);
152
+ $stocklevel = (int) Mage::getModel('cataloginventory/stock_item')
153
+ ->loadByProduct($_product)->getQty();
154
+
155
+
156
+ echo $stocklevel;
157
+ }
158
+
159
+ /*
160
+ This function use for get SKU
161
+ */
162
+
163
+ public function getSkuuAction() {
164
+
165
+ $product_id = $this->getRequest()->getParam('product_id');
166
+
167
+ $model = Mage::getModel('catalog/product');
168
+ $_product = $model->load($product_id);
169
+ $prdsku = $_product->getSku();
170
+
171
+
172
+ echo $prdsku;
173
+ }
174
 
175
  }
app/code/local/Medma/Stockcontrol/controllers/Adminhtml/StockcontrolController.php~ DELETED
@@ -1,156 +0,0 @@
1
- <?php
2
-
3
- class Medma_Stockcontrol_Adminhtml_StockcontrolController extends Mage_Adminhtml_Controller_action
4
- {
5
- public function indexAction() {
6
-
7
-
8
- $this->loadLayout();
9
- $this->_setActiveMenu('catalog/stockcontrol');
10
- //$this->_addBreadcrumb($this->__('Manage Grouped Product Discount Rule'), $this->__('Discount'));
11
- $this->_addContent($this->getLayout()->createBlock('stockcontrol/adminhtml_stockcontrol'));
12
- $this->renderLayout();
13
-
14
- }
15
-
16
- public function editAction() {
17
- $id = $this->getRequest()->getParam('id');
18
-
19
- $model = Mage::getModel('stockcontrol/stockcontrol')->load($id);
20
-
21
- if ($model->getId() || $id == 0) {
22
- $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
23
- if (!empty($data)) {
24
- $model->setData($data);
25
- }
26
-
27
- Mage::register('stockcontrol_data', $model);
28
- $this->loadLayout();
29
- $this->_setActiveMenu('catalog/stockcontrol');
30
-
31
- $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
32
-
33
- $this->_addContent($this->getLayout()->createBlock('stockcontrol/adminhtml_stockcontrol_edit'));
34
-
35
- $this->renderLayout();
36
- } else {
37
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('stockcontrol')->__('Item does not exist'));
38
- $this->_redirect('*/*/');
39
- }
40
- }
41
-
42
-
43
-
44
-
45
- public function newAction() {
46
- $this->editAction();
47
- }
48
-
49
- public function saveAction() {
50
- $id= $this->getRequest()->getParam('id');
51
- $user = Mage::getSingleton('admin/session');
52
- $userId = $user->getUser()->getUserId();
53
- $model_user= Mage::getModel('admin/user')->load($userId);
54
- $addedby = $model_user['username'];
55
-
56
-
57
- $model= Mage::getModel('stockcontrol/stockcontrol');
58
-
59
- if ($data = $this->getRequest()->getPost()) {
60
- if($data['operation']=='Stock In'){
61
- $total_qty=$data['present_qty']+$data['added_qty'];
62
- }elseif($data['operation']=='Stock Out'){
63
- if($data['present_qty']<='0'){
64
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('stockcontrol')->__('Quantity is less to perform Stock Out operation'));
65
- $this->_redirect('*/*/');
66
- return;
67
- }else{
68
- $total_qty=$data['present_qty']-$data['added_qty'];
69
- }
70
- }
71
- $model_product= Mage::getModel('catalog/product');
72
- $_product = $model_product->load($data['product_id']);
73
- $stockData = $_product->getStockData();
74
- $stockData['qty'] = $total_qty;
75
- if($total_qty>0){
76
- $stockData['is_in_stock'] = 1;
77
- }else{
78
- $stockData['is_in_stock'] = 0;
79
- }
80
- $_product->setStockData($stockData);
81
- $_product->save();
82
- $user = Mage::getSingleton('admin/session')->getData();
83
- $userId = $user['user']['user_id'];
84
- $data['total_qty']=$total_qty;
85
- $data['added_by']=$userId ;
86
- // $stocklevel = (int)Mage::getModel('cataloginventory/stock_item')
87
- // ->loadByProduct($_product)->getQty();
88
- // echo $stocklevel;exit;
89
- try {
90
- $data['added_by']=$addedby;
91
- $model->setData($data)->setId($id);
92
- $model->save();
93
-
94
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('stockcontrol')->__('Quantity Update Operation Perform successfully'));
95
-
96
- Mage::getSingleton('adminhtml/session')->setFormData(false);
97
-
98
- $this->_redirect('*/*/');
99
- return;
100
- } catch (Exception $e) {
101
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
102
- Mage::getSingleton('adminhtml/session')->setFormData($data);
103
- $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
104
- return;
105
- }
106
- }
107
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('stockcontrol')->__('Unable to find item to save'));
108
- $this->_redirect('*/*/');
109
- }
110
- public function deleteAction() {
111
- if( $this->getRequest()->getParam('id') > 0 ) {
112
- try {
113
- $model = Mage::getModel('stockcontrol/stockcontrol');
114
-
115
- $model->setId($this->getRequest()->getParam('id'))
116
- ->delete();
117
-
118
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
119
- $this->_redirect('*/*/');
120
- } catch (Exception $e) {
121
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
122
- $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
123
- }
124
- }
125
- $this->_redirect('*/*/');
126
- }
127
-
128
- public function getPresentQtyAction(){
129
- $product_id = $this->getRequest()->getParam('product_id');
130
-
131
- $model = Mage::getModel('catalog/product');
132
- $_product = $model->load($product_id);
133
- $stocklevel = (int)Mage::getModel('cataloginventory/stock_item')
134
- ->loadByProduct($_product)->getQty();
135
-
136
-
137
- echo $stocklevel;
138
- }
139
-
140
- /*
141
- This function use for get sku
142
- */
143
- public function getSkuuAction(){
144
-
145
- $product_id = $this->getRequest()->getParam('product_id');
146
-
147
- $model = Mage::getModel('catalog/product');
148
- $_product = $model->load($product_id);
149
- $prdsku = $_product->getSku();
150
-
151
-
152
- echo $prdsku;
153
- }
154
-
155
-
156
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Medma/Stockcontrol/sql/stockcontrol_setup/mysql4-install-0.1.0.php~ DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- $installer->run("
8
-
9
-
10
- CREATE TABLE IF NOT EXISTS {$this->getTable('stockcontrol')} (
11
- `stock_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
12
- `product_id` int(11) unsigned NOT NULL,
13
- `present_qty` varchar(255) NOT NULL DEFAULT '',
14
- `added_qty` varchar(255) NOT NULL DEFAULT '',
15
- `total_qty` varchar(255) NOT NULL,
16
- `operation` varchar(255) NOT NULL,
17
- `qty_added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
18
- `added_by` varchar(255) NOT NULL,
19
- PRIMARY KEY (`stock_id`)
20
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
21
-
22
- ");
23
-
24
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,22 +1,20 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Medma_Stock_Control</name>
4
- <version>2.0.1</version>
5
  <stability>stable</stability>
6
- <license uri="http://opensource.org/licenses/OSL-3.0">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>This extension provides an additional feature for updating the stock of the products.</summary>
10
  <description>This extension provides an additional feature for updating the stock of the products in Magento Admin Panel.&#xD;
11
  &#xD;
12
- &#xD;
13
- &#xD;
14
  This extension is mainly used where Stock updates are being done by other operators than the Admin. This extension also tracks which Admin user updated which products and this provides the facility for the Administrator to track the errors in Stock update.</description>
15
- <notes>This is a latest release of the extension.</notes>
16
- <authors><author><name>Medma_Infomatix</name><user>Medma_Infomatix</user><email>gaurav@medma.in</email></author></authors>
17
- <date>2014-01-21</date>
18
- <time>08:09:04</time>
19
- <contents><target name="magelocal"><dir name="Medma"><dir name="Stockcontrol"><dir><dir name="Block"><dir name="Adminhtml"><dir name="Stockcontrol"><dir name="Edit"><file name="Form.php" hash="acac90ea71e8bd6caf23b01d7cf0ab63"/><file name="Form.php~" hash="936434b73510746519da485925491e70"/><dir name="Tab"><file name="Form.php" hash="dfd11760871042496386ae18c5ae9bff"/><file name="Form.php~" hash="baa38642837860829ae4330426ae88bb"/></dir><file name="Tabs.php" hash="da26b4d3c6030d4c8ea46e3bfef42c07"/></dir><file name="Edit.php" hash="b8945c90063845a5c01e1ec9866e7e60"/><file name="Edit.php~" hash="df952cd927fc2d09253de57f3a505e72"/><file name="Grid.php" hash="8a129b2e4db041868f21ed68ff269c7d"/><file name="Grid.php~" hash="c1fe1bd9394a43f8c188075a59e92dd2"/></dir><file name="Stockcontrol.php" hash="26905c050ba2f9d49c521e676015acdc"/><file name="Stockcontrol.php~" hash="9db80488257bd92314be28ce7f3f8ece"/></dir><file name="Stockcontrol.php" hash="b27ea72a7b1a39c152c35dd40cb92666"/><file name="Stockcontrol.php~" hash="6843b73e90c114bf2de8545958c93947"/></dir><dir name="Helper"><file name="Data.php" hash="cd53ffe2d92f8ef59aef9ae6fc5f0e32"/><file name="Data.php~" hash="8ea6f23e9f926e8bafa179ab916057cf"/></dir><dir name="Model"><file name="Authenticate.php" hash="10505b591e6dcd5ef8d787b4403804b2"/><dir name="Mysql4"><dir name="Stockcontrol"><file name="Collection.php" hash="c3514b030650f22f78b57c106c4ab0e5"/><file name="Collection.php~" hash="94baeb8e35cfe94c8e26a776c6974f33"/></dir><file name="Stockcontrol.php" hash="5c92de9f6d97358416e45bd10b8da1c1"/><file name="Stockcontrol.php~" hash="92cb8352ecd2d8726c0f892f2d3c2377"/></dir><file name="Stockcontrol.php" hash="abaa8b60c5557b28812e096bacd9f832"/><file name="Stockcontrol.php~" hash="b9dd52b6f70e8f54d5603307a60b19cb"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="StockcontrolController.php" hash="b18e37f26dc7a63f0e1e4c6ce7e43861"/><file name="StockcontrolController.php~" hash="a6bf5fffb04549de0580b28f195cff4b"/></dir></dir><dir name="etc"><file name="config.xml" hash="bc9bd7d12d81b72158f2983d3d0f6dd7"/></dir><dir name="sql"><dir name="stockcontrol_setup"><file name="mysql4-install-0.1.0.php" hash="46b70cbc4d70cf057301f0ac35ecd919"/><file name="mysql4-install-0.1.0.php~" hash="efcb4ae5f95e3e50c6bbe53d71081f6a"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="bf0c61c6a10bf02294bc9bd1ba3d2292"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Medma_Stockcontrol.xml" hash="5661fa743ccc78a1af4f0679d6685c29"/></dir></target></contents>
20
  <compatible/>
21
- <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
22
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Medma_Stock_Control</name>
4
+ <version>2.0.2</version>
5
  <stability>stable</stability>
6
+ <license>OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>This extension provides an additional feature for updating the stock of the products.</summary>
10
  <description>This extension provides an additional feature for updating the stock of the products in Magento Admin Panel.&#xD;
11
  &#xD;
 
 
12
  This extension is mainly used where Stock updates are being done by other operators than the Admin. This extension also tracks which Admin user updated which products and this provides the facility for the Administrator to track the errors in Stock update.</description>
13
+ <notes>Compatible with latest magento version</notes>
14
+ <authors><author><name>Medma</name><user>Medma_Infomatix</user><email>gaurav@medma.in</email></author></authors>
15
+ <date>2015-07-06</date>
16
+ <time>06:47:36</time>
17
+ <contents><target name="magelocal"><dir name="Medma"><dir name="Stockcontrol"><dir name="Block"><dir name="Adminhtml"><dir name="Stockcontrol"><dir name="Edit"><file name="Form.php" hash="acac90ea71e8bd6caf23b01d7cf0ab63"/><dir name="Tab"><file name="Form.php" hash="dfd11760871042496386ae18c5ae9bff"/></dir><file name="Tabs.php" hash="da26b4d3c6030d4c8ea46e3bfef42c07"/></dir><file name="Edit.php" hash="b8945c90063845a5c01e1ec9866e7e60"/><file name="Grid.php" hash="59dedbd6b8c1ab4430c76e6bb75869be"/><dir name="Render"><file name="Product.php" hash="5e288856c5e39dd349fbed54b2c64732"/></dir></dir><file name="Stockcontrol.php" hash="26905c050ba2f9d49c521e676015acdc"/></dir><file name="Stockcontrol.php" hash="b27ea72a7b1a39c152c35dd40cb92666"/></dir><dir name="Helper"><file name="Data.php" hash="cd53ffe2d92f8ef59aef9ae6fc5f0e32"/><file name="Data.php~" hash="8ea6f23e9f926e8bafa179ab916057cf"/></dir><dir name="Model"><file name="Authenticate.php" hash="10505b591e6dcd5ef8d787b4403804b2"/><dir name="Mysql4"><dir name="Stockcontrol"><file name="Collection.php" hash="c3514b030650f22f78b57c106c4ab0e5"/><file name="Collection.php~" hash="94baeb8e35cfe94c8e26a776c6974f33"/></dir><file name="Stockcontrol.php" hash="5c92de9f6d97358416e45bd10b8da1c1"/><file name="Stockcontrol.php~" hash="92cb8352ecd2d8726c0f892f2d3c2377"/></dir><file name="Stockcontrol.php" hash="abaa8b60c5557b28812e096bacd9f832"/><file name="Stockcontrol.php~" hash="b9dd52b6f70e8f54d5603307a60b19cb"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="StockcontrolController.php" hash="b90591b4d59a01672380d8426578f34f"/></dir></dir><dir name="etc"><file name="config.xml" hash="bc9bd7d12d81b72158f2983d3d0f6dd7"/></dir><dir name="sql"><dir name="stockcontrol_setup"><file name="mysql4-install-0.1.0.php" hash="46b70cbc4d70cf057301f0ac35ecd919"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="bf0c61c6a10bf02294bc9bd1ba3d2292"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Medma_Stockcontrol.xml" hash="5661fa743ccc78a1af4f0679d6685c29"/></dir></target></contents>
18
  <compatible/>
19
+ <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>