Mv_Megaventory - Version 2.1.0

Version Notes

This update includes the following feature additions:
(A) If a custom product attribute has been added in Magento to “link” products
to supplier entities, this information (the supplier of the product)
will also be pushed to Megaventory either during the initial setup wizard or at any time a Magento product is saved/updated.
(B) The Notify for Quantity Below (Stock Alert level) figure is automatically synced between Magento and Megaventory
Moreover, a few bugs have been fixed and various code optimizations have been applied.

Download this release

Release Info

Developer Megaventory Megaventory
Extension Mv_Megaventory
Version 2.1.0
Comparing to
See all releases


Code changes from version 2.0.1 to 2.1.0

app/code/local/Mv/Megaventory/Block/Adminhtml/Megaventorysettings.php CHANGED
@@ -5,7 +5,8 @@ class Mv_Megaventory_Block_Adminhtml_Megaventorysettings extends Mage_Core_Block
5
  private $_settings;
6
  private $_inventories;
7
  private $_taxes;
8
- private $_currencies;
 
9
  private $_mvConnectivity = false;
10
 
11
  public function __construct()
@@ -14,6 +15,11 @@ class Mv_Megaventory_Block_Adminhtml_Megaventorysettings extends Mage_Core_Block
14
  $this->_inventories = Mage::helper('megaventory/inventories')->getInventories();
15
  $this->_taxes = Mage::helper('megaventory/taxes')->getTaxes();
16
  $this->_mvConnectivity = Mv_Megaventory_Helper_Common::checkConnectivity();
 
 
 
 
 
17
  parent::__construct();
18
  }
19
 
@@ -40,9 +46,14 @@ class Mv_Megaventory_Block_Adminhtml_Megaventorysettings extends Mage_Core_Block
40
  return $this->_taxes;
41
  }
42
 
43
- public function getCurrencies()
44
  {
45
- return $this->_currencies;
 
 
 
 
 
46
  }
47
 
48
  public function connectivityOk()
@@ -50,4 +61,36 @@ class Mv_Megaventory_Block_Adminhtml_Megaventorysettings extends Mage_Core_Block
50
  return $this->_mvConnectivity;
51
  }
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  }
5
  private $_settings;
6
  private $_inventories;
7
  private $_taxes;
8
+ private $_defaultMagentoCurrency;
9
+ private $_defaultMegaventoryCurrency;
10
  private $_mvConnectivity = false;
11
 
12
  public function __construct()
15
  $this->_inventories = Mage::helper('megaventory/inventories')->getInventories();
16
  $this->_taxes = Mage::helper('megaventory/taxes')->getTaxes();
17
  $this->_mvConnectivity = Mv_Megaventory_Helper_Common::checkConnectivity();
18
+
19
+ $this->_defaultMegaventoryCurrency = $this->setDefaultMegaventoryCurrency();
20
+
21
+ $this->_defaultMagentoCurrency = Mage::getStoreConfig('currency/options/default');
22
+
23
  parent::__construct();
24
  }
25
 
46
  return $this->_taxes;
47
  }
48
 
49
+ public function getDefaultMagentoCurrency()
50
  {
51
+ return $this->_defaultMagentoCurrency;
52
+ }
53
+
54
+ public function getDefaultMegaventoryCurrency()
55
+ {
56
+ return $this->_defaultMegaventoryCurrency;
57
  }
58
 
59
  public function connectivityOk()
61
  return $this->_mvConnectivity;
62
  }
63
 
64
+ public function checkBaseCurrencies()
65
+ {
66
+ if ($this->_defaultMagentoCurrency != $this->_defaultMegaventoryCurrency)
67
+ return false;
68
+
69
+ return true;
70
+ }
71
+
72
+ private function setDefaultMegaventoryCurrency()
73
+ {
74
+ if ($this->_mvConnectivity !== true)
75
+ return false;
76
+
77
+ $apikey = Mage::getStoreConfig('megaventory/general/apikey');
78
+ $apiurl = Mage::getStoreConfig('megaventory/general/apiurl');
79
+
80
+
81
+ $data = array
82
+ (
83
+ 'APIKEY' => $apikey,
84
+ 'query' => 'mv.CurrencyIsDefault = 1'
85
+ );
86
+
87
+ $megaventoryHelper = Mage::helper('megaventory');
88
+ $json_result = $megaventoryHelper->makeJsonRequest($data ,'CurrencyGet',0,$apiurl);
89
+
90
+ $errorCode = $json_result['ResponseStatus']['ErrorCode'];
91
+ if ($errorCode != '0')
92
+ return false;
93
+
94
+ return $json_result['mvCurrencies'][0]['CurrencyCode'];
95
+ }
96
  }
app/code/local/Mv/Megaventory/Helper/Category.php CHANGED
@@ -83,14 +83,14 @@ class Mv_Megaventory_Helper_Category extends Mage_Core_Helper_Abstract
83
  }
84
  if ($isLastPage){
85
  //$megaventoryHelper->sendProgress(22, $total.'/'.$totalCollectionSize.' categories synchronized'.Mage::registry('tickImage'), '0', 'categories',true);
86
- $message = $total.'/'.$totalCollectionSize.' categories synchronized'.Mage::registry('tickImage');
87
  if ($total != $totalCollectionSize){
88
  $dif = $totalCollectionSize-$total;
89
  $logUrl = Mage::helper("adminhtml")->getUrl("megaventory/index/log");
90
  if ($dif == 1)
91
- $message .= '<br>'.$dif.' category was not synchronized. Check <a href="'.$logUrl.'" target="_blank">Megaventory Log</a> for details'.Mage::registry('errorImage');
92
  else
93
- $message .= '<br>'.$dif.' categories were not synchronized. Check <a href="'.$logUrl.'" target="_blank">Megaventory Log</a> for details'.Mage::registry('errorImage');
94
  }
95
  $megaventoryHelper->sendProgress(21, $message, $page, 'categories', true);
96
 
83
  }
84
  if ($isLastPage){
85
  //$megaventoryHelper->sendProgress(22, $total.'/'.$totalCollectionSize.' categories synchronized'.Mage::registry('tickImage'), '0', 'categories',true);
86
+ $message = $total.'/'.$totalCollectionSize.' categories imported'.Mage::registry('tickImage');
87
  if ($total != $totalCollectionSize){
88
  $dif = $totalCollectionSize-$total;
89
  $logUrl = Mage::helper("adminhtml")->getUrl("megaventory/index/log");
90
  if ($dif == 1)
91
+ $message .= '<br>'.$dif.' category was not imported. Check <a href="'.$logUrl.'" target="_blank">Megaventory Log</a> for details'.Mage::registry('errorImage');
92
  else
93
+ $message .= '<br>'.$dif.' categories were not imported. Check <a href="'.$logUrl.'" target="_blank">Megaventory Log</a> for details'.Mage::registry('errorImage');
94
  }
95
  $megaventoryHelper->sendProgress(21, $message, $page, 'categories', true);
96
 
app/code/local/Mv/Megaventory/Helper/Inventories.php CHANGED
@@ -356,6 +356,73 @@ class Mv_Megaventory_Helper_Inventories extends Mage_Core_Helper_Abstract
356
  return false;
357
  }
358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
359
  public function updateCountsInStock($inventoryId, $bCount){
360
  $inventory = Mage::getModel('megaventory/inventories')->load($inventoryId);
361
  $bCount == 'true' ? $countsInStock = '1' : $countsInStock = '0';
@@ -507,8 +574,15 @@ class Mv_Megaventory_Helper_Inventories extends Mage_Core_Helper_Abstract
507
  $inventoryStockData['stocknonreceivedqty'] = $warehouseStock['StockNonReceivedPOs'];
508
  $inventoryStockData['stockwipcomponentqty'] = 0;
509
  $inventoryStockData['stocknonreceivedwoqty'] = $warehouseStock['StockNonReceivedWOs'];
510
- $inventoryStockData['stockalarmqty'] = $warehouseStock['StockAlertLevel'];
511
- $inventory = Mage::getModel('megaventory/inventories')->load($warehouseStock['warehouseID'], 'megaventory_id');
 
 
 
 
 
 
 
512
  $inventoryId = $inventory->getData('id');
513
  $this->updateInventoryProductStock($pId,$inventoryId,$inventoryStockData);
514
 
356
  return false;
357
  }
358
 
359
+ public function updateInventoryProductAlertValue($productId, $inventoryId, $alertValue){
360
+
361
+ if (isset($productId) && isset($inventoryId))
362
+ {
363
+ $productStock = Mage::getModel('megaventory/productstocks')
364
+ ->loadInventoryProductstock($inventoryId, $productId);
365
+
366
+ $productStock->setProduct_id($productId);
367
+ $productStock->setInventory_id($inventoryId);
368
+ $productStock->setStockalarmqty($alertValue);
369
+ $productStock->save();
370
+
371
+ $stockItem = Mage::getModel ( 'cataloginventory/stock_item' )->loadByProduct($productId);
372
+
373
+ $productStockCollection = Mage::getModel ( 'megaventory/productstocks' )->loadProductstocks ($productId);
374
+
375
+ $totalAlertQuantity = 0;
376
+ foreach ( $productStockCollection as $key => $productStock ) {
377
+ $inventoryAlertQty = $productStock ['stockalarmqty'];
378
+
379
+ $inventory = Mage::getModel ( 'megaventory/inventories' )->load ( $inventoryId );
380
+ if ($inventory == false)
381
+ continue;
382
+
383
+ if ($inventory->getCounts_in_total_stock () == '1') {
384
+ $totalAlertQuantity += $inventoryAlertQty;
385
+ }
386
+ Mage::log ( 'total stock after update = ' . $totalStock, null, 'api.log', true );
387
+ Mage::log ( 'total alert quantity after update = ' . $totalAlertQuantity, null, 'api.log', true );
388
+ }
389
+
390
+ //update notify quantity
391
+ $useConfigNotify = $stockItem->getData('use_config_notify_stock_qty');
392
+ $configValue = Mage::getStoreConfig('cataloginventory/item_options/notify_stock_qty');
393
+
394
+ if ($useConfigNotify == '1'){
395
+ if (isset($configValue)){
396
+ if ($configValue != $totalAlertQuantity){
397
+ $stockItem->setData('use_config_notify_stock_qty',0);
398
+ }
399
+ }
400
+ }
401
+ else
402
+ {
403
+ if (isset($configValue)){
404
+ if ($configValue == $totalAlertQuantity){
405
+ $stockItem->setData('use_config_notify_stock_qty',1);
406
+ }
407
+ }
408
+ }
409
+
410
+ $stockItem->setData('notify_stock_qty',$totalAlertQuantity);
411
+ $stockItem->save();
412
+ //end of notify quantity
413
+
414
+ return array(
415
+ 'totalAlertQuantity' => $totalAlertQuantity,
416
+ 'isConfig' => ($totalAlertQuantity == $configValue) ? true : false
417
+ );
418
+ }
419
+
420
+ return array(
421
+ 'totalAlertQuantity' => 0,
422
+ 'isConfig' => false
423
+ );
424
+ }
425
+
426
  public function updateCountsInStock($inventoryId, $bCount){
427
  $inventory = Mage::getModel('megaventory/inventories')->load($inventoryId);
428
  $bCount == 'true' ? $countsInStock = '1' : $countsInStock = '0';
574
  $inventoryStockData['stocknonreceivedqty'] = $warehouseStock['StockNonReceivedPOs'];
575
  $inventoryStockData['stockwipcomponentqty'] = 0;
576
  $inventoryStockData['stocknonreceivedwoqty'] = $warehouseStock['StockNonReceivedWOs'];
577
+ $inventoryStockData['stockalarmqty'] = $warehouseStock['StockAlertLevel'];
578
+
579
+ //warehouseID changed in megaventory API v2
580
+ //we need to be compliant with both versions
581
+ $locationId = $warehouseStock['warehouseID'];
582
+ if (!isset($locationId)){ //v2 api
583
+ $locationId = $warehouseStock['InventoryLocationID'];
584
+ }
585
+ $inventory = Mage::getModel('megaventory/inventories')->load($locationId, 'megaventory_id');
586
  $inventoryId = $inventory->getData('id');
587
  $this->updateInventoryProductStock($pId,$inventoryId,$inventoryStockData);
588
 
app/code/local/Mv/Megaventory/Helper/Order.php CHANGED
@@ -406,7 +406,7 @@ class Mv_Megaventory_Helper_Order extends Mage_Core_Helper_Abstract
406
 
407
  $errorCode = $json_result['ResponseStatus']['ErrorCode'];
408
  if ($errorCode == '0'){//no errors
409
- $orderAdded->setData('mv_salesorder_id',$json_result['result']['SalesOrderNo']);
410
  $orderAdded->setData('mv_inventory_id',$inventory->getData('id'));
411
  $orderAdded->save();
412
 
406
 
407
  $errorCode = $json_result['ResponseStatus']['ErrorCode'];
408
  if ($errorCode == '0'){//no errors
409
+ $orderAdded->setData('mv_salesorder_id',$json_result['mvSalesOrder']['SalesOrderNo']);
410
  $orderAdded->setData('mv_inventory_id',$inventory->getData('id'));
411
  $orderAdded->save();
412
 
app/code/local/Mv/Megaventory/Helper/Product.php CHANGED
@@ -27,14 +27,6 @@ class Mv_Megaventory_Helper_Product extends Mage_Core_Helper_Abstract
27
  $productType = $product->getType_id();
28
  if ($productType == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE || $productType == Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL)
29
  {
30
- //$stock_data = $product->getStockData();
31
- /* $stockItem = $product->getStock_item();
32
- $quantity = '0';
33
- if (isset($stockItem))
34
- $quantity = $stockItem->getQty();
35
-
36
- else if (isset($product['quantity']))
37
- $quantity = $product['quantity']; */
38
 
39
  $productId = $product->getEntityId();
40
  $megaVentoryId = $product->getData('mv_product_id');
@@ -57,6 +49,80 @@ class Mv_Megaventory_Helper_Product extends Mage_Core_Helper_Abstract
57
  if (!empty($product['cost']))
58
  $cost = $product['cost'];
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
  $version = '';
62
  $parentIds = Mage::getResourceSingleton('catalog/product_type_configurable') ->getParentIdsByChild($productId);
@@ -172,7 +238,7 @@ class Mv_Megaventory_Helper_Product extends Mage_Core_Helper_Abstract
172
  'ProductCustomField1'=>$attributeSetName,
173
  'ProductCustomField2'=>'',
174
  'ProductCustomField3'=>'',
175
- 'ProductMainSupplierID'=>'0',
176
  'ProductMainSupplierPrice'=>'0',
177
  'ProductMainSupplierSKU'=>'',
178
  'ProductMainSupplierDescription'=>'',
@@ -181,7 +247,6 @@ class Mv_Megaventory_Helper_Product extends Mage_Core_Helper_Abstract
181
  'mvRecordAction'=>$mvRecordAction
182
  );
183
 
184
- $helper = Mage::helper('megaventory');
185
  $json_result = $helper->makeJsonRequest($data ,'ProductUpdate',$productId);
186
 
187
 
@@ -190,6 +255,7 @@ class Mv_Megaventory_Helper_Product extends Mage_Core_Helper_Abstract
190
  if (strcmp('Insert', $mvRecordAction) == 0){
191
  $this->updateProduct($productId,$json_result['mvProduct']['ProductID']);
192
  }
 
193
  return $json_result['mvProduct']['ProductID'];
194
  }
195
  else
@@ -493,10 +559,10 @@ class Mv_Megaventory_Helper_Product extends Mage_Core_Helper_Abstract
493
  }
494
  }
495
  if ($isLastPage){
496
- $message = $total.'/'.$totalCollectionSize.' products synchronized'.Mage::registry('tickImage');
497
  if ($total != $totalCollectionSize){
498
  $logUrl = Mage::helper("adminhtml")->getUrl("megaventory/index/log");
499
- $message .= '<br>'.$totalCollectionSize-$total.' product(s) were not synchronized. Check <a href="'.$logUrl.'" target="_blank">Megaventory Log</a> for details'.Mage::registry('errorImage');
500
  }
501
  $megaventoryHelper->sendProgress(31, $message, $page, 'products', true);
502
  return false;
@@ -539,6 +605,80 @@ class Mv_Megaventory_Helper_Product extends Mage_Core_Helper_Abstract
539
  else
540
  $cost = $product['cost'];
541
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
542
  $version = '';
543
  $parentIds = Mage::getResourceSingleton('catalog/product_type_configurable') ->getParentIdsByChild($productId);
544
  if (isset($parentIds) && isset($parentIds[0]))
@@ -641,7 +781,7 @@ class Mv_Megaventory_Helper_Product extends Mage_Core_Helper_Abstract
641
  'ProductCustomField1'=>$attributeSetName,
642
  'ProductCustomField2'=>'',
643
  'ProductCustomField3'=>'',
644
- 'ProductMainSupplierID'=>'0',
645
  'ProductMainSupplierPrice'=>'0',
646
  'ProductMainSupplierSKU'=>'',
647
  'ProductMainSupplierDescription'=>'',
@@ -650,14 +790,61 @@ class Mv_Megaventory_Helper_Product extends Mage_Core_Helper_Abstract
650
  'mvRecordAction'=>$mvRecordAction
651
  );
652
 
653
- $helper = Mage::helper('megaventory');
654
  $json_result = $helper->makeJsonRequest($data ,'ProductUpdate',$productId);
655
 
656
 
657
  $errorCode = $json_result['ResponseStatus']['ErrorCode'];
658
  if ($errorCode == '0'){//no errors
659
  if (strcmp('Insert', $mvRecordAction) == 0){
660
- $this->updateProduct($productId,$json_result['mvProduct']['ProductID']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
661
  }
662
  }
663
  else
@@ -665,9 +852,60 @@ class Mv_Megaventory_Helper_Product extends Mage_Core_Helper_Abstract
665
  $entityId = $json_result['entityID']; //if product exists just sync them
666
  if (!empty($entityId) && $entityId > 0){
667
  $this->updateProduct($productId,$entityId);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
668
  return 1;
669
  }
670
- }
 
 
671
 
672
  return $errorCode;
673
  }
27
  $productType = $product->getType_id();
28
  if ($productType == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE || $productType == Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL)
29
  {
 
 
 
 
 
 
 
 
30
 
31
  $productId = $product->getEntityId();
32
  $megaVentoryId = $product->getData('mv_product_id');
49
  if (!empty($product['cost']))
50
  $cost = $product['cost'];
51
 
52
+ $helper = Mage::helper('megaventory');
53
+
54
+ //pass supplier on the fly
55
+ $mvSupplierId = '';
56
+
57
+ $supplierAttributeCode = Mage::getStoreConfig('megaventory/general/supplierattributecode');
58
+
59
+ if (isset($supplierAttributeCode)){
60
+ $attribute = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product',$supplierAttributeCode);
61
+ $frontendInput = $attribute->getFrontendInput();
62
+
63
+ $magentoSupplierId = $product->getData($supplierAttributeCode);
64
+
65
+ if ($frontendInput == 'text')
66
+ $supplierName = $magentoSupplierId;
67
+ else if ($frontendInput == 'select')
68
+ $supplierName = $product->getAttributeText($supplierAttributeCode);
69
+
70
+ if (isset($magentoSupplierId) && ($frontendInput == 'text' || $frontendInput == 'select')){
71
+
72
+ Mage::log('supplier name = '.$supplierName,null,'megaventory.log');
73
+
74
+ if ($supplierName){
75
+
76
+ $supplierData = array
77
+ (
78
+ 'APIKEY' => Mage::getStoreConfig('megaventory/general/apikey'),
79
+ 'query'=> 'mv.SupplierClientName = "'.$supplierName.'"'
80
+ );
81
+
82
+ $json_result = $helper->makeJsonRequest($supplierData ,'SupplierClientGet');
83
+ $errorCode = $json_result['ResponseStatus']['ErrorCode'];
84
+ if ($errorCode == '0'){//no errors
85
+
86
+ //supplier exists
87
+ if (count($json_result['mvSupplierClients']) > 0){
88
+ $mvSupplierId = $json_result['mvSupplierClients'][0]['SupplierClientID'];
89
+ }
90
+ else //supplier is new
91
+ {
92
+ $supplierData = array
93
+ (
94
+ 'APIKEY' => Mage::getStoreConfig('megaventory/general/apikey'),
95
+ 'mvSupplierClient' => array (
96
+ 'SupplierClientID' => 0,
97
+ 'SupplierClientType' => '1',
98
+ 'SupplierClientName' => $supplierName,
99
+ 'SupplierClientBillingAddress' => '',
100
+ 'SupplierClientShippingAddress1' => '',
101
+ 'SupplierClientShippingAddress2' => '',
102
+ 'SupplierClientPhone1' => '',
103
+ 'SupplierClientPhone2' => '',
104
+ 'SupplierClientFax' => '',
105
+ 'SupplierClientIM' => '',
106
+ 'SupplierClientEmail' => '',
107
+ 'SupplierClientTaxID' => '',
108
+ 'SupplierClientComments' => '',
109
+ ),
110
+ 'mvRecordAction' => 'Insert'
111
+ );
112
+
113
+ $json_result = $helper->makeJsonRequest($supplierData, 'SupplierClientUpdate',0);
114
+
115
+ $errorCode = $json_result['ResponseStatus']['ErrorCode'];
116
+ if ($errorCode == '0'){//no errors
117
+ $mvSupplierId = $json_result['mvSupplierClient']['SupplierClientID'];
118
+ }
119
+ }
120
+ }
121
+
122
+ Mage::log('mv supplier id = '.$mvSupplierId,null,'megaventory.log');
123
+ }
124
+ }
125
+ }
126
 
127
  $version = '';
128
  $parentIds = Mage::getResourceSingleton('catalog/product_type_configurable') ->getParentIdsByChild($productId);
238
  'ProductCustomField1'=>$attributeSetName,
239
  'ProductCustomField2'=>'',
240
  'ProductCustomField3'=>'',
241
+ 'ProductMainSupplierID'=>$mvSupplierId,
242
  'ProductMainSupplierPrice'=>'0',
243
  'ProductMainSupplierSKU'=>'',
244
  'ProductMainSupplierDescription'=>'',
247
  'mvRecordAction'=>$mvRecordAction
248
  );
249
 
 
250
  $json_result = $helper->makeJsonRequest($data ,'ProductUpdate',$productId);
251
 
252
 
255
  if (strcmp('Insert', $mvRecordAction) == 0){
256
  $this->updateProduct($productId,$json_result['mvProduct']['ProductID']);
257
  }
258
+
259
  return $json_result['mvProduct']['ProductID'];
260
  }
261
  else
559
  }
560
  }
561
  if ($isLastPage){
562
+ $message = $total.'/'.$totalCollectionSize.' products imported'.Mage::registry('tickImage');
563
  if ($total != $totalCollectionSize){
564
  $logUrl = Mage::helper("adminhtml")->getUrl("megaventory/index/log");
565
+ $message .= '<br>'.$totalCollectionSize-$total.' product(s) were not imported. Check <a href="'.$logUrl.'" target="_blank">Megaventory Log</a> for details'.Mage::registry('errorImage');
566
  }
567
  $megaventoryHelper->sendProgress(31, $message, $page, 'products', true);
568
  return false;
605
  else
606
  $cost = $product['cost'];
607
 
608
+ //pass supplier on the fly
609
+ $helper = Mage::helper('megaventory');
610
+ $mvSupplierId = '';
611
+
612
+ $supplierAttributeCode = Mage::getStoreConfig('megaventory/general/supplierattributecode');
613
+
614
+ if (isset($supplierAttributeCode)){
615
+ $attribute = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product',$supplierAttributeCode);
616
+ $frontendInput = $attribute->getFrontendInput();
617
+
618
+ $magentoSupplierId = $product->getData($supplierAttributeCode);
619
+
620
+ if ($frontendInput == 'text')
621
+ $supplierName = $magentoSupplierId;
622
+ else if ($frontendInput == 'select')
623
+ $supplierName = $product->getAttributeText($supplierAttributeCode);
624
+
625
+ if (isset($magentoSupplierId) && ($frontendInput == 'text' || $frontendInput == 'select')){
626
+
627
+ Mage::log('supplier name = '.$supplierName,null,'megaventory.log');
628
+
629
+ if ($supplierName){
630
+
631
+ $supplierData = array
632
+ (
633
+ 'APIKEY' => Mage::getStoreConfig('megaventory/general/apikey'),
634
+ 'query'=> 'mv.SupplierClientName = "'.$supplierName.'"'
635
+ );
636
+
637
+ $json_result = $helper->makeJsonRequest($supplierData ,'SupplierClientGet');
638
+ $errorCode = $json_result['ResponseStatus']['ErrorCode'];
639
+ if ($errorCode == '0'){//no errors
640
+
641
+ //supplier exists
642
+ if (count($json_result['mvSupplierClients']) > 0){
643
+ $mvSupplierId = $json_result['mvSupplierClients'][0]['SupplierClientID'];
644
+ }
645
+ else //supplier is new
646
+ {
647
+ $supplierData = array
648
+ (
649
+ 'APIKEY' => Mage::getStoreConfig('megaventory/general/apikey'),
650
+ 'mvSupplierClient' => array (
651
+ 'SupplierClientID' => 0,
652
+ 'SupplierClientType' => '1',
653
+ 'SupplierClientName' => $supplierName,
654
+ 'SupplierClientBillingAddress' => '',
655
+ 'SupplierClientShippingAddress1' => '',
656
+ 'SupplierClientShippingAddress2' => '',
657
+ 'SupplierClientPhone1' => '',
658
+ 'SupplierClientPhone2' => '',
659
+ 'SupplierClientFax' => '',
660
+ 'SupplierClientIM' => '',
661
+ 'SupplierClientEmail' => '',
662
+ 'SupplierClientTaxID' => '',
663
+ 'SupplierClientComments' => '',
664
+ ),
665
+ 'mvRecordAction' => 'Insert'
666
+ );
667
+
668
+ $json_result = $helper->makeJsonRequest($supplierData, 'SupplierClientUpdate',0);
669
+
670
+ $errorCode = $json_result['ResponseStatus']['ErrorCode'];
671
+ if ($errorCode == '0'){//no errors
672
+ $mvSupplierId = $json_result['mvSupplierClient']['SupplierClientID'];
673
+ }
674
+ }
675
+ }
676
+
677
+ Mage::log('mv supplier id = '.$mvSupplierId,null,'megaventory.log');
678
+ }
679
+ }
680
+ }
681
+
682
  $version = '';
683
  $parentIds = Mage::getResourceSingleton('catalog/product_type_configurable') ->getParentIdsByChild($productId);
684
  if (isset($parentIds) && isset($parentIds[0]))
781
  'ProductCustomField1'=>$attributeSetName,
782
  'ProductCustomField2'=>'',
783
  'ProductCustomField3'=>'',
784
+ 'ProductMainSupplierID'=> $mvSupplierId,
785
  'ProductMainSupplierPrice'=>'0',
786
  'ProductMainSupplierSKU'=>'',
787
  'ProductMainSupplierDescription'=>'',
790
  'mvRecordAction'=>$mvRecordAction
791
  );
792
 
 
793
  $json_result = $helper->makeJsonRequest($data ,'ProductUpdate',$productId);
794
 
795
 
796
  $errorCode = $json_result['ResponseStatus']['ErrorCode'];
797
  if ($errorCode == '0'){//no errors
798
  if (strcmp('Insert', $mvRecordAction) == 0){
799
+ $this->updateProduct($productId,$json_result['mvProduct']['ProductID']);
800
+ $mvProductId = $json_result['mvProduct']['ProductID'];
801
+
802
+ //update alert level
803
+ $stockItem = $product->getStock_item();
804
+ $quantity = '0';
805
+ $alertLevel = 0;
806
+
807
+ if (isset($stockItem)){
808
+ $useConfigNotify = $stockItem->getData('use_config_notify_stock_qty');
809
+ if ($useConfigNotify == '1'){
810
+ //get config value
811
+ $configValue = Mage::getStoreConfig('cataloginventory/item_options/notify_stock_qty');
812
+ if (isset($configValue))
813
+ $alertLevel = $configValue;
814
+ else
815
+ $alertLevel = 0;
816
+ }
817
+ else{
818
+ $alertLevel = $stockItem->getData('notify_stock_qty');
819
+ }
820
+ }
821
+
822
+ $inventory = Mage::getModel('megaventory/inventories')->loadDefault();
823
+
824
+ $alertData = array
825
+ (
826
+ 'APIKEY' => Mage::getStoreConfig('megaventory/general/apikey'),
827
+ 'mvProductStockAlertsAndSublocationsList'=> array
828
+ (
829
+ 'productID' => $mvProductId,
830
+ 'mvInventoryLocationStockAlertAndSublocations' => array(
831
+ 'InventoryLocationID' => $inventory->getData('megaventory_id'),
832
+ 'StockAlertLevel' => $alertLevel
833
+ )
834
+
835
+ )
836
+ );
837
+
838
+ $helper->makeJsonRequest($alertData ,'InventoryLocationStockAlertAndSublocationsUpdate');
839
+
840
+ $productStock = Mage::getModel('megaventory/productstocks')
841
+ ->loadInventoryProductstock($inventory->getId(), $product->getId());
842
+
843
+ $productStock->setProduct_id($productId);
844
+ $productStock->setInventory_id($inventory->getId());
845
+ $productStock->setStockalarmqty($alertLevel);
846
+ $productStock->save();
847
+
848
  }
849
  }
850
  else
852
  $entityId = $json_result['entityID']; //if product exists just sync them
853
  if (!empty($entityId) && $entityId > 0){
854
  $this->updateProduct($productId,$entityId);
855
+ $mvProductId = $entityId;
856
+
857
+ //update alert level
858
+ $stockItem = $product->getStock_item();
859
+ $quantity = '0';
860
+ $alertLevel = 0;
861
+
862
+ if (isset($stockItem)){
863
+ $useConfigNotify = $stockItem->getData('use_config_notify_stock_qty');
864
+ if ($useConfigNotify == '1'){
865
+ //get config value
866
+ $configValue = Mage::getStoreConfig('cataloginventory/item_options/notify_stock_qty');
867
+ if (isset($configValue))
868
+ $alertLevel = $configValue;
869
+ else
870
+ $alertLevel = 0;
871
+ }
872
+ else{
873
+ $alertLevel = $stockItem->getData('notify_stock_qty');
874
+ }
875
+ }
876
+
877
+ $inventory = Mage::getModel('megaventory/inventories')->loadDefault();
878
+
879
+ $alertData = array
880
+ (
881
+ 'APIKEY' => Mage::getStoreConfig('megaventory/general/apikey'),
882
+ 'mvProductStockAlertsAndSublocationsList'=> array
883
+ (
884
+ 'productID' => $mvProductId,
885
+ 'mvInventoryLocationStockAlertAndSublocations' => array(
886
+ 'InventoryLocationID' => $inventory->getData('megaventory_id'),
887
+ 'StockAlertLevel' => $alertLevel
888
+ )
889
+
890
+ )
891
+ );
892
+
893
+ $helper->makeJsonRequest($alertData ,'InventoryLocationStockAlertAndSublocationsUpdate');
894
+
895
+ $productStock = Mage::getModel('megaventory/productstocks')
896
+ ->loadInventoryProductstock($inventory->getId(), $product->getId());
897
+
898
+ $productStock->setProduct_id($productId);
899
+ $productStock->setInventory_id($inventory->getId());
900
+ $productStock->setStockalarmqty($alertLevel);
901
+ $productStock->save();
902
+
903
+
904
  return 1;
905
  }
906
+ }
907
+
908
+
909
 
910
  return $errorCode;
911
  }
app/code/local/Mv/Megaventory/Model/Category/Observer.php CHANGED
@@ -19,9 +19,9 @@ class Mv_Megaventory_Model_Category_Observer {
19
  $action = 'Insert';
20
  }
21
 
22
-
23
- if ($category->getIsActive())
24
- {
25
 
26
  $helper = Mage::helper('megaventory');
27
 
@@ -62,17 +62,17 @@ class Mv_Megaventory_Model_Category_Observer {
62
  {
63
  $this->updateCategoriesRecursively($category);
64
  }
65
- }
66
- else //if user disables a category
67
  //we should delete the megaventory category
68
- {
69
  //no update just delete the current category not
70
  //its children
71
- if (strcmp ( $action, "Update" ) == 0)
72
  {
73
  $this->deleteCategory($category);
74
  }
75
- }
76
 
77
  }
78
 
19
  $action = 'Insert';
20
  }
21
 
22
+ //deprecated as of v 2.1
23
+ //if ($category->getIsActive())
24
+ //{
25
 
26
  $helper = Mage::helper('megaventory');
27
 
62
  {
63
  $this->updateCategoriesRecursively($category);
64
  }
65
+ //}
66
+ //else //if user disables a category
67
  //we should delete the megaventory category
68
+ //{
69
  //no update just delete the current category not
70
  //its children
71
+ /* if (strcmp ( $action, "Update" ) == 0)
72
  {
73
  $this->deleteCategory($category);
74
  }
75
+ } */
76
 
77
  }
78
 
app/code/local/Mv/Megaventory/Model/Services/Api.php CHANGED
@@ -83,10 +83,12 @@ class Mv_Megaventory_Model_Services_Api extends Mage_Api_Model_Resource_Abstract
83
  Mage::log ( 'product id in inventory stock = ' . $pId, null, 'api.log', true );
84
  $productStockCollection = Mage::getModel ( 'megaventory/productstocks' )->loadProductstocks ( $pId );
85
  $totalStock = 0;
 
86
  foreach ( $productStockCollection as $key => $productStock ) {
87
  $inventoryStock = $productStock ['stockqty'];
88
  $inventoryNonShippedStock = $productStock ['stocknonshippedqty'];
89
  $inventoryNonAllocatedWOStock = $productStock ['stocknonallocatedwoqty'];
 
90
 
91
  $inventoryId = $productStock ['inventory_id'];
92
  $inventory = Mage::getModel ( 'megaventory/inventories' )->load ( $inventoryId );
@@ -103,8 +105,11 @@ class Mv_Megaventory_Model_Services_Api extends Mage_Api_Model_Resource_Abstract
103
  {
104
  $totalStock += $inventoryStock - $inventoryNonShippedStock - $inventoryNonAllocatedWOStock;
105
  }
 
 
106
  }
107
  Mage::log ( 'total stock after update = ' . $totalStock, null, 'api.log', true );
 
108
  }
109
  $stockItem = Mage::getModel ( 'cataloginventory/stock_item' )->loadByProduct ( $pId );
110
  Mage::log ( 'stock item id = ' . $stockItem->getId (), null, 'api.log', true );
@@ -112,6 +117,27 @@ class Mv_Megaventory_Model_Services_Api extends Mage_Api_Model_Resource_Abstract
112
  if ($totalStock > $stockItem->getMinQty ())
113
  $stockItem->setData ( 'is_in_stock', 1 );
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  Varien_Profiler::start ( 'savestock' );
116
  $stockItem->save ();
117
  Varien_Profiler::stop ( 'savestock' );
83
  Mage::log ( 'product id in inventory stock = ' . $pId, null, 'api.log', true );
84
  $productStockCollection = Mage::getModel ( 'megaventory/productstocks' )->loadProductstocks ( $pId );
85
  $totalStock = 0;
86
+ $totalAlertQuantity = 0;
87
  foreach ( $productStockCollection as $key => $productStock ) {
88
  $inventoryStock = $productStock ['stockqty'];
89
  $inventoryNonShippedStock = $productStock ['stocknonshippedqty'];
90
  $inventoryNonAllocatedWOStock = $productStock ['stocknonallocatedwoqty'];
91
+ $inventoryAlertQty = $productStock ['stockalarmqty'];
92
 
93
  $inventoryId = $productStock ['inventory_id'];
94
  $inventory = Mage::getModel ( 'megaventory/inventories' )->load ( $inventoryId );
105
  {
106
  $totalStock += $inventoryStock - $inventoryNonShippedStock - $inventoryNonAllocatedWOStock;
107
  }
108
+
109
+ $totalAlertQuantity += $inventoryAlertQty;
110
  }
111
  Mage::log ( 'total stock after update = ' . $totalStock, null, 'api.log', true );
112
+ Mage::log ( 'total alert quantity after update = ' . $totalAlertQuantity, null, 'api.log', true );
113
  }
114
  $stockItem = Mage::getModel ( 'cataloginventory/stock_item' )->loadByProduct ( $pId );
115
  Mage::log ( 'stock item id = ' . $stockItem->getId (), null, 'api.log', true );
117
  if ($totalStock > $stockItem->getMinQty ())
118
  $stockItem->setData ( 'is_in_stock', 1 );
119
 
120
+ //update notify quantity
121
+ $useConfigNotify = $stockItem->getData('use_config_notify_stock_qty');
122
+ $configValue = Mage::getStoreConfig('cataloginventory/item_options/notify_stock_qty');
123
+ if ($useConfigNotify == '1'){
124
+ if (isset($configValue)){
125
+ if ($configValue != $totalAlertQuantity){
126
+ $stockItem->setData('use_config_notify_stock_qty',0);
127
+ }
128
+ }
129
+ }
130
+ else
131
+ {
132
+ if (isset($configValue)){
133
+ if ($configValue == $totalAlertQuantity){
134
+ $stockItem->setData('use_config_notify_stock_qty',1);
135
+ }
136
+ }
137
+ }
138
+ $stockItem->setData('notify_stock_qty',$totalAlertQuantity);
139
+ //end of notify quantity
140
+
141
  Varien_Profiler::start ( 'savestock' );
142
  $stockItem->save ();
143
  Varien_Profiler::stop ( 'savestock' );
app/code/local/Mv/Megaventory/controllers/IndexController.php CHANGED
@@ -74,9 +74,43 @@ class Mv_Megaventory_IndexController extends Mage_Adminhtml_Controller_Action
74
  $config->saveConfig('megaventory/general/shippingproductsku',$shippingSKU);
75
  $config->saveConfig('megaventory/general/discountproductsku',$discountSKU);
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  //unfortunately
78
  $config->reinit();
79
 
 
 
 
 
80
  die();
81
  }
82
 
@@ -117,7 +151,7 @@ class Mv_Megaventory_IndexController extends Mage_Adminhtml_Controller_Action
117
  $settingValue = $accountSetting['SettingValue'];
118
  if ($settingName == 'isMagentoModuleEnabled' && $settingValue == false)
119
  $message .= 'Magento module is not enabled.';
120
- if ($settingName == 'MagentoEndPointURL'){
121
  $host = parse_url($settingValue,PHP_URL_HOST);
122
  $magentoHost = $_SERVER['HTTP_HOST'];
123
  if ($host != $magentoHost)
@@ -133,7 +167,7 @@ class Mv_Megaventory_IndexController extends Mage_Adminhtml_Controller_Action
133
  $message .= sprintf('Magento username %s does not exist.',$settingValue);
134
  }
135
  }
136
- }
137
  if ($settingName == 'isOrdersModuleEnabled' && $settingValue == false)
138
  $message .= 'Orders module is not enabled.';
139
  if ($settingName == 'isWorksModuleEnabled ' && $settingValue == false)
@@ -154,6 +188,44 @@ class Mv_Megaventory_IndexController extends Mage_Adminhtml_Controller_Action
154
  die();
155
  }
156
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  /*
158
  $supplier = $this->getRequest()->getParam('supplierattribute');
159
 
@@ -253,7 +325,6 @@ class Mv_Megaventory_IndexController extends Mage_Adminhtml_Controller_Action
253
  //first reset and then do it all from the beginning
254
  $megaventoryHelper->resetMegaventoryData();
255
 
256
-
257
  $megaventoryHelper->sendProgress(1, '<strong>Step 1/'.$totalSteps.'</strong> Getting Inventory Locations from Megaventory', '0', 'inventories', false);
258
 
259
  $count = $inventoriesHelper->initializeInventoryLocations();
@@ -293,7 +364,7 @@ class Mv_Megaventory_IndexController extends Mage_Adminhtml_Controller_Action
293
  echo json_encode($result);
294
  die();
295
  }
296
- $megaventoryHelper->sendProgress(11, 'Shipping Product synchronized successfully!', '0', 'shippingproduct',true);
297
 
298
  $createdMessage = $productHelper->addDiscountProduct($megaventoryHelper);
299
  if ($createdMessage !== true)
@@ -304,7 +375,7 @@ class Mv_Megaventory_IndexController extends Mage_Adminhtml_Controller_Action
304
  echo json_encode($result);
305
  die();
306
  }
307
- $megaventoryHelper->sendProgress(12, 'Discount Product synchronized successfully!', '0', 'discountproduct',true);
308
  $customerHelper->addDefaultGuestCustomer($megaventoryHelper);
309
  $currenciesHelper->addMagentoCurrencies($megaventoryHelper);
310
  $taxesHelper->synchronizeTaxes($megaventoryHelper);
@@ -316,7 +387,7 @@ class Mv_Megaventory_IndexController extends Mage_Adminhtml_Controller_Action
316
  }
317
  else if ($syncStep == 'categories'){
318
  if ($page == '1')
319
- $megaventoryHelper->sendProgress(20, '<br><strong>Step 3/'.$totalSteps.'</strong> Synchronizing Categories..', '0', 'categories', false);
320
 
321
  $import = $categoryHelper->importCategoriesToMegaventory($megaventoryHelper,$page, $imported);
322
 
@@ -338,7 +409,7 @@ class Mv_Megaventory_IndexController extends Mage_Adminhtml_Controller_Action
338
  }
339
  else if ($syncStep == 'products'){
340
  if ($page == '1')
341
- $megaventoryHelper->sendProgress(30, '<br><strong>Step 4/'.$totalSteps.'</strong> Synchronizing Products..', '0', 'products' ,false);
342
 
343
  $import = $productHelper->importProductsToMegaventory($megaventoryHelper,$page,$imported);
344
 
@@ -382,7 +453,7 @@ class Mv_Megaventory_IndexController extends Mage_Adminhtml_Controller_Action
382
  } */
383
  else if ($syncStep == 'finishing'){
384
  $syncTimestamp = time();
385
- $megaventoryHelper->sendProgress(40, '<br>Synchronization finished successfully at '.date(DATE_RFC2822,$syncTimestamp), '0', 'finish',true);
386
  $megaventoryHelper->sendProgress(41, 'Saving Set up data for later reference!', '0', 'saveddata',false);
387
 
388
  $megaventoryHelper->sendProgress(42, 'Done!'.Mage::registry('tickImage'), '0', 'done',false);
@@ -427,7 +498,7 @@ class Mv_Megaventory_IndexController extends Mage_Adminhtml_Controller_Action
427
  }
428
  else if ($syncStep == 'error'){
429
  //$syncTimestamp = time();
430
- $megaventoryHelper->sendProgress(90, '<br>Synchronization did not finish succesfully.', '0', 'finisherror',true);
431
  $megaventoryHelper->sendProgress(100, 'Please refresh page and try again!', '0', 'done',false);
432
  $resource = Mage::getSingleton ( 'core/resource' );
433
  $read = $resource->getConnection ( 'core/read' );
@@ -456,6 +527,7 @@ class Mv_Megaventory_IndexController extends Mage_Adminhtml_Controller_Action
456
  Mage::getConfig()->deleteConfig('megaventory/general/synctimestamp/');
457
  Mage::getConfig()->deleteConfig('megaventory/general/shippingproductsku');
458
  Mage::getConfig()->deleteConfig('megaventory/general/discountproductsku');
 
459
  Mage::getConfig()->deleteConfig('megaventory/general/defaultguestid');
460
  Mage::getConfig()->deleteConfig('megaventory/general/setupreport');
461
  Mage::getConfig()->deleteConfig('megaventory/general/ordersynchronization');
@@ -607,7 +679,7 @@ class Mv_Megaventory_IndexController extends Mage_Adminhtml_Controller_Action
607
  $mvInventoryId = $data['mvSalesOrder']['SalesOrderInventoryLocationID'];
608
  $inventory = Mage::helper('megaventory/inventories')->getInventoryFromMegaventoryId($mvInventoryId);
609
  if ($inventory){
610
- $orderAdded->setData('mv_salesorder_id',$json_result['result']['SalesOrderNo']);
611
  $orderAdded->setData('mv_inventory_id',$inventory->getData('id'));
612
  $orderAdded->save();
613
  }
@@ -1129,4 +1201,38 @@ class Mv_Megaventory_IndexController extends Mage_Adminhtml_Controller_Action
1129
 
1130
  return $this;
1131
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1132
  }
74
  $config->saveConfig('megaventory/general/shippingproductsku',$shippingSKU);
75
  $config->saveConfig('megaventory/general/discountproductsku',$discountSKU);
76
 
77
+ //add supplier attribute in config data
78
+ $magentoSupplierAttributeCode = $this->getRequest()->getPost('magento_supplier_code');
79
+
80
+ if (!empty($magentoSupplierAttributeCode)){
81
+ $attribute = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product',$magentoSupplierAttributeCode);
82
+
83
+ if (!$attribute->getId())
84
+ {
85
+ $result = array(
86
+ 'attribute_code'=>'notok',
87
+ 'message'=>'There is no attribute with this code'
88
+ );
89
+ echo json_encode($result) . PHP_EOL;
90
+ die();
91
+ }
92
+
93
+ $frontendInput = $attribute->getFrontendInput();
94
+
95
+ if ($frontendInput != 'text' && $frontendInput != 'select'){
96
+ $result = array(
97
+ 'attribute_code'=>'notok',
98
+ 'message'=>'Supplier attribute must be of frontend type Text or Dropdown'
99
+ );
100
+ echo json_encode($result) . PHP_EOL;
101
+ die();
102
+ }
103
+
104
+ $config->saveConfig('megaventory/general/supplierattributecode',$magentoSupplierAttributeCode);
105
+ }
106
+
107
  //unfortunately
108
  $config->reinit();
109
 
110
+ $result = array(
111
+ 'attribute_code'=>'ok'
112
+ );
113
+ echo json_encode($result) . PHP_EOL;
114
  die();
115
  }
116
 
151
  $settingValue = $accountSetting['SettingValue'];
152
  if ($settingName == 'isMagentoModuleEnabled' && $settingValue == false)
153
  $message .= 'Magento module is not enabled.';
154
+ /* if ($settingName == 'MagentoEndPointURL'){
155
  $host = parse_url($settingValue,PHP_URL_HOST);
156
  $magentoHost = $_SERVER['HTTP_HOST'];
157
  if ($host != $magentoHost)
167
  $message .= sprintf('Magento username %s does not exist.',$settingValue);
168
  }
169
  }
170
+ } */
171
  if ($settingName == 'isOrdersModuleEnabled' && $settingValue == false)
172
  $message .= 'Orders module is not enabled.';
173
  if ($settingName == 'isWorksModuleEnabled ' && $settingValue == false)
188
  die();
189
  }
190
 
191
+
192
+ public function updateSupplierSettingsAction()
193
+ {
194
+ $magentoSupplierAttributeCode = $this->getRequest()->getPost('magento_supplier_code');
195
+ $config = Mage::getConfig();
196
+ if (!empty($magentoSupplierAttributeCode)){
197
+ $attribute = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product',$magentoSupplierAttributeCode);
198
+
199
+ if (!$attribute->getId())
200
+ {
201
+ $result = array(
202
+ 'attribute_code'=>'notok',
203
+ 'message'=>'There is no attribute with this code'
204
+ );
205
+ echo json_encode($result) . PHP_EOL;
206
+ die();
207
+ }
208
+
209
+ $frontendInput = $attribute->getFrontendInput();
210
+
211
+ if ($frontendInput != 'text' && $frontendInput != 'select'){
212
+ $result = array(
213
+ 'attribute_code'=>'notok',
214
+ 'message'=>'Supplier attribute must be of frontend type Text or Dropdown'
215
+ );
216
+ echo json_encode($result) . PHP_EOL;
217
+ die();
218
+ }
219
+
220
+ $config->saveConfig('megaventory/general/supplierattributecode',$magentoSupplierAttributeCode);
221
+ }
222
+ else //delete it
223
+ {
224
+ $config->deleteConfig('megaventory/general/supplierattributecode');
225
+ }
226
+ die();
227
+ }
228
+
229
  /*
230
  $supplier = $this->getRequest()->getParam('supplierattribute');
231
 
325
  //first reset and then do it all from the beginning
326
  $megaventoryHelper->resetMegaventoryData();
327
 
 
328
  $megaventoryHelper->sendProgress(1, '<strong>Step 1/'.$totalSteps.'</strong> Getting Inventory Locations from Megaventory', '0', 'inventories', false);
329
 
330
  $count = $inventoriesHelper->initializeInventoryLocations();
364
  echo json_encode($result);
365
  die();
366
  }
367
+ $megaventoryHelper->sendProgress(11, 'Shipping Product added successfully!', '0', 'shippingproduct',true);
368
 
369
  $createdMessage = $productHelper->addDiscountProduct($megaventoryHelper);
370
  if ($createdMessage !== true)
375
  echo json_encode($result);
376
  die();
377
  }
378
+ $megaventoryHelper->sendProgress(12, 'Discount Product added successfully!', '0', 'discountproduct',true);
379
  $customerHelper->addDefaultGuestCustomer($megaventoryHelper);
380
  $currenciesHelper->addMagentoCurrencies($megaventoryHelper);
381
  $taxesHelper->synchronizeTaxes($megaventoryHelper);
387
  }
388
  else if ($syncStep == 'categories'){
389
  if ($page == '1')
390
+ $megaventoryHelper->sendProgress(20, '<br><strong>Step 3/'.$totalSteps.'</strong> Importing Categories to Megaventory..', '0', 'categories', false);
391
 
392
  $import = $categoryHelper->importCategoriesToMegaventory($megaventoryHelper,$page, $imported);
393
 
409
  }
410
  else if ($syncStep == 'products'){
411
  if ($page == '1')
412
+ $megaventoryHelper->sendProgress(30, '<br><strong>Step 4/'.$totalSteps.'</strong> Importing Products to Megaventory..', '0', 'products' ,false);
413
 
414
  $import = $productHelper->importProductsToMegaventory($megaventoryHelper,$page,$imported);
415
 
453
  } */
454
  else if ($syncStep == 'finishing'){
455
  $syncTimestamp = time();
456
+ $megaventoryHelper->sendProgress(40, '<br>Entity import finished successfully at '.date(DATE_RFC2822,$syncTimestamp), '0', 'finish',true);
457
  $megaventoryHelper->sendProgress(41, 'Saving Set up data for later reference!', '0', 'saveddata',false);
458
 
459
  $megaventoryHelper->sendProgress(42, 'Done!'.Mage::registry('tickImage'), '0', 'done',false);
498
  }
499
  else if ($syncStep == 'error'){
500
  //$syncTimestamp = time();
501
+ $megaventoryHelper->sendProgress(90, '<br>Entity import did not finish succesfully.', '0', 'finisherror',true);
502
  $megaventoryHelper->sendProgress(100, 'Please refresh page and try again!', '0', 'done',false);
503
  $resource = Mage::getSingleton ( 'core/resource' );
504
  $read = $resource->getConnection ( 'core/read' );
527
  Mage::getConfig()->deleteConfig('megaventory/general/synctimestamp/');
528
  Mage::getConfig()->deleteConfig('megaventory/general/shippingproductsku');
529
  Mage::getConfig()->deleteConfig('megaventory/general/discountproductsku');
530
+ Mage::getConfig()->deleteConfig('megaventory/general/supplierattributecode');
531
  Mage::getConfig()->deleteConfig('megaventory/general/defaultguestid');
532
  Mage::getConfig()->deleteConfig('megaventory/general/setupreport');
533
  Mage::getConfig()->deleteConfig('megaventory/general/ordersynchronization');
679
  $mvInventoryId = $data['mvSalesOrder']['SalesOrderInventoryLocationID'];
680
  $inventory = Mage::helper('megaventory/inventories')->getInventoryFromMegaventoryId($mvInventoryId);
681
  if ($inventory){
682
+ $orderAdded->setData('mv_salesorder_id',$json_result['mvSalesOrder']['SalesOrderNo']);
683
  $orderAdded->setData('mv_inventory_id',$inventory->getData('id'));
684
  $orderAdded->save();
685
  }
1201
 
1202
  return $this;
1203
  }
1204
+
1205
+ public function updateAlertLevelAction() {
1206
+ $mvInventoryId = $this->getRequest()->getParam('mv_inventory_id');
1207
+ $productId = $this->getRequest()->getParam('magento_product_id');
1208
+ $mvProductId = $this->getRequest()->getParam('mv_product_id');
1209
+ $alertLevel = $this->getRequest()->getParam('alertlevel');
1210
+
1211
+
1212
+ $megaventoryHelper = Mage::helper('megaventory');
1213
+
1214
+ $alertData = array
1215
+ (
1216
+ 'APIKEY' => Mage::getStoreConfig('megaventory/general/apikey'),
1217
+ 'mvProductStockAlertsAndSublocationsList'=> array
1218
+ (
1219
+ 'productID' => $mvProductId,
1220
+ 'mvInventoryLocationStockAlertAndSublocations' => array(
1221
+ 'InventoryLocationID' => $mvInventoryId,
1222
+ 'StockAlertLevel' => $alertLevel
1223
+ )
1224
+
1225
+ )
1226
+ );
1227
+
1228
+ $json_result = $megaventoryHelper->makeJsonRequest($alertData ,'InventoryLocationStockAlertAndSublocationsUpdate');
1229
+ $errorCode = $json_result['ResponseStatus']['ErrorCode'];
1230
+
1231
+ if ($errorCode == '0'){
1232
+ $inventories = Mage::helper ( 'megaventory/inventories' );
1233
+ $magentoInventoryId = $inventories->getInventoryFromMegaventoryId($mvInventoryId)->getId();
1234
+ echo json_encode($inventories->updateInventoryProductAlertValue($productId, $magentoInventoryId, $alertLevel));
1235
+ die();
1236
+ }
1237
+ }
1238
  }
app/code/local/Mv/Megaventory/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Mv_Megaventory>
5
- <version>2.0.1</version>
6
  </Mv_Megaventory>
7
  </modules>
8
  <crontab>
2
  <config>
3
  <modules>
4
  <Mv_Megaventory>
5
+ <version>2.1.0</version>
6
  </Mv_Megaventory>
7
  </modules>
8
  <crontab>
app/design/adminhtml/default/default/template/megaventory/catalog/product/tab/inventory.phtml CHANGED
@@ -196,9 +196,10 @@ if ($megaventoryIntegration == '1') */
196
  if (Mv_Megaventory_Helper_Common::isMegaventoryEnabled())
197
  {
198
  $inventories = $this->getInventories();
 
199
  ?>
200
 
201
- <?php if( $this->getProduct()->getTypeId() == 'simple' ): ?>
202
  <div id="product_info_tabs_inventory_content" style=""><div class="entry-edit">
203
  <div class="entry-edit-head">
204
  <h4 class="icon-head head-edit-form fieldset-legend">Megaventory Stock Values</h4>
@@ -251,7 +252,12 @@ $inventories = $this->getInventories();
251
  </td>
252
  <?php endif;?>
253
  <td class="value">
254
- <?php echo round($productStock->getStockalarmqty(),2) ?>
 
 
 
 
 
255
  </td>
256
  </tr>
257
  <?php endforeach; ?>
@@ -340,6 +346,39 @@ $inventories = $this->getInventories();
340
  Event.observe($('inventory_is_qty_decimal'), 'change', applyEnableDecimalDivided);
341
  applyEnableDecimalDivided();
342
  }
 
 
 
 
 
 
 
 
 
343
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344
  //]]>
345
  </script>
196
  if (Mv_Megaventory_Helper_Common::isMegaventoryEnabled())
197
  {
198
  $inventories = $this->getInventories();
199
+ $mvProductId = $this->getProduct()->getData('mv_product_id');
200
  ?>
201
 
202
+ <?php if( $this->getProduct()->getTypeId() == 'simple' && !empty($mvProductId)) : ?>
203
  <div id="product_info_tabs_inventory_content" style=""><div class="entry-edit">
204
  <div class="entry-edit-head">
205
  <h4 class="icon-head head-edit-form fieldset-legend">Megaventory Stock Values</h4>
252
  </td>
253
  <?php endif;?>
254
  <td class="value">
255
+ <input style="width:50px;" type="text" name="alertQty" onchange="changeAlertLevel(this,<?php echo $inventory->getData('megaventory_id'); ?>)"
256
+ value="<?php echo round($productStock->getStockalarmqty(),2) ?>">
257
+ <img id="loader_<?php echo $inventory->getData('megaventory_id');?>"
258
+ src="<?php echo Mage::getDesign()->getSkinUrl('images/megaventory/smallloader.gif')?>" style="border-width:0px;display:none;vertical-align:middle;">
259
+ <img id="ok_<?php echo $inventory->getData('megaventory_id');?>"
260
+ src="<?php echo Mage::getDesign()->getSkinUrl('images/megaventory/accept.png')?>" style="border-width:0px;display:none;vertical-align:middle;">
261
  </td>
262
  </tr>
263
  <?php endforeach; ?>
346
  Event.observe($('inventory_is_qty_decimal'), 'change', applyEnableDecimalDivided);
347
  applyEnableDecimalDivided();
348
  }
349
+
350
+ <?php if (!empty($mvProductId)) { ?>
351
+
352
+ $('inventory_notify_stock_qty').disable();
353
+ $('inventory_notify_stock_qty').addClassName('disabled');
354
+ $('inventory_use_config_notify_stock_qty').disable();
355
+
356
+ <?php }?>
357
+
358
  });
359
+
360
+ function changeAlertLevel(elem,inventoryId){
361
+ $('ok_'+inventoryId).hide();
362
+ $('loader_'+inventoryId).show();
363
+ url = "<?php echo Mage::helper("adminhtml")->getUrl("megaventory/index/updateAlertLevel") ?>";
364
+ new Ajax.Request(url, {
365
+ parameters:
366
+ {
367
+ 'mv_inventory_id' : inventoryId,
368
+ 'magento_product_id' : <?php echo $this->getProduct()->getId() ?>,
369
+ 'mv_product_id' : <?php echo $this->getProduct()->getData('mv_product_id') ?>,
370
+ 'alertlevel' : elem.value
371
+ },
372
+ onSuccess: function(transport) {
373
+ $('loader_'+inventoryId).hide();
374
+ $('ok_'+inventoryId).show();
375
+ var result = transport.responseText.evalJSON();
376
+ $('inventory_notify_stock_qty').value = result.totalAlertQuantity;
377
+ $('inventory_notify_stock_qty').disable();
378
+ $('inventory_notify_stock_qty').addClassName('disabled');
379
+ $('inventory_use_config_notify_stock_qty').checked = result.isConfig;
380
+ }
381
+ });
382
+ }
383
  //]]>
384
  </script>
app/design/adminhtml/default/default/template/megaventory/megaventory.phtml CHANGED
@@ -6,7 +6,7 @@
6
  <tbody>
7
  <tr>
8
  <td style="width: 50%;"><h3
9
- style="background-image: url(http://www.megaventory.com/favicon.ico)"
10
  class="icon-head">Megaventory (version <?php echo Mv_Megaventory_Helper_Common::getExtensionVersion()?>)</h3></td>
11
  </tr>
12
  </tbody>
@@ -59,6 +59,18 @@ else{
59
  <legend>Connectivity</legend>
60
  <table cellspacing="0" class="form-list">
61
  <tbody>
 
 
 
 
 
 
 
 
 
 
 
 
62
  <tr id="row_megaventory_connectivity_enabled">
63
  <td class="label"><label
64
  for="megaventory_connectivity_enabled-id"> Megaventory extension
@@ -197,6 +209,32 @@ else{
197
  <div style="display:none" class="validation-advice" id="megaventory_discount_sku-id-required" style="">This is a required field.</div>
198
  </td>
199
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  <tr>
201
  <td colspan="2" style="width: 500px;"><strong>Initialize Data</strong></td>
202
 
@@ -213,18 +251,59 @@ else{
213
  </tr>
214
  <tr>
215
  <td class="label" colspan="2">
216
- <?php if ($connectivityOk === true) { ?>
 
 
 
217
  <button id="sync-data-btn" type="button"
218
  onclick="javascript:syncData()" <?php if (empty($apikey) || empty($apiurl)) { ?> style="display: none;" <?php }?>>
219
  <span> Start </span>
220
  </button>
221
- <?php } else {
 
 
 
 
 
 
 
 
 
 
222
  ?>
223
  <span id="connectivity-message-id">Connection Failed
224
  <img src="<?php echo Mage::getDesign()->getSkinUrl('images/megaventory/exclamation.png')?>" title="<?php echo $connectivityOk ?>" style="position:relative;top:1px;left:4px;"/></span>
225
  <span style="color:red;" id="connectivity-error-message-id"></span>
226
  <?php }?>
227
  <div id="next-step" style="display:none;">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  <br>
229
  Do you want to import your Magento stock to Megaventory?<br>
230
  <button id="next1-data-yes-btn" type="button"
@@ -235,6 +314,7 @@ else{
235
  onclick="javascript:location = '<?php echo $indexURL ?>';">
236
  <span> No </span>
237
  </button>
 
238
  </div>
239
  <div id="next-error" style="display:none;">
240
  <br>
@@ -249,9 +329,9 @@ else{
249
  </button>
250
  </td>
251
  </tr>
252
- <tr>
253
  <td id="stock-setup-id" class="stock-setup" colspan="2"
254
- style="display: none;padding-top:30px;">
255
  <strong>Please select the Inventory Location you want to import your global stock to</strong><br />
256
  <select
257
  name="initial-stock-inventory" id="initial-stock-inventory-id">
@@ -273,7 +353,7 @@ else{
273
  <br />
274
  <br /> <span id="export-stock-csv"></span>
275
  </td>
276
- </tr>
277
  </table>
278
  <?php } else {?>
279
  <table class="form-list" style="width:100%">
@@ -301,6 +381,32 @@ else{
301
  <div style="display:none" class="validation-advice" id="megaventory_discount_sku-id-required" style="">This is a required field.</div>
302
  </td>
303
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  <tr id="row_megaventory_general_shippingproductsku">
305
  <td colspan="2"><strong>Setup Report</strong><br />
306
  <?php echo $this->getSettingValue('syncreport'); ?>
@@ -469,6 +575,43 @@ else{
469
  <script type="text/javascript">Fieldset.applyCollapse('megaventory_inventories');</script>
470
  </div>
471
  </td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
472
  </tr>
473
  <tr>
474
  <td colspan="2">
@@ -607,10 +750,22 @@ function syncData()
607
 
608
  var updateSKUs = "<?php echo Mage::helper("adminhtml")->getUrl("megaventory/index/setShippingAndDiscountSKUs") ?>";
609
  var ajax = new Ajax.Request(updateSKUs, {
610
- parameters: {shippingSKU: $('megaventory_shipping_sku-id').value, discountSKU: $('megaventory_discount_sku-id').value},
 
 
 
 
611
  onSuccess: function(transport) {
612
-
613
- continueSyncData();
 
 
 
 
 
 
 
 
614
  }
615
  });
616
 
@@ -619,7 +774,7 @@ function syncData()
619
  function continueSyncData()
620
  {
621
 
622
- $('sync-heading-id').update('Synchronization process started.Please do not close browser window while synchronization runs');
623
  $('sync-data-btn').hide();
624
 
625
 
@@ -659,8 +814,10 @@ function sync(step,page,imported)
659
  }
660
  else{
661
  executer.stop();
662
- if (result.nextstep != 'finisherror')
663
- $('next-step').show();
 
 
664
  else
665
  $('next-error').show();
666
  }
@@ -699,11 +856,11 @@ function next1Setup()
699
  url = "<?php echo Mage::helper("adminhtml")->getUrl("megaventory/index/getInventories") ?>";
700
  new Ajax.Request(url, {
701
  onSuccess: function(transport) {
702
- $('stock-setup-id').show();
703
  var response = transport.responseText.evalJSON();
704
  //add inventories to select object
705
  $('initial-stock-inventory-id').update(response.options);
706
-
707
  }
708
  });
709
  }
@@ -724,6 +881,24 @@ function exportStock()
724
  });
725
  }
726
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
727
  function changeCountsInStock(inventoryId , oneOrZero, url, checkBox){
728
 
729
  var r=confirm('You are about to change the Inventory Locations that contribute to the global stock of Magento. If you proceed, you should also click "Import Inventory from Megaventory" to synchronize quantities before leaving the page.');
@@ -793,4 +968,22 @@ function checkOrderSynchronization(oneOrZero, checkBox){
793
  }
794
  }
795
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
796
  </script>
6
  <tbody>
7
  <tr>
8
  <td style="width: 50%;"><h3
9
+ style="background-image: url(http://www.megaventory.com/favicon.ico);background-size:16px;"
10
  class="icon-head">Megaventory (version <?php echo Mv_Megaventory_Helper_Common::getExtensionVersion()?>)</h3></td>
11
  </tr>
12
  </tbody>
59
  <legend>Connectivity</legend>
60
  <table cellspacing="0" class="form-list">
61
  <tbody>
62
+ <?php if(empty($syncTimestamp)){
63
+ if (empty($apikey) || empty($apiurl)) {
64
+ ?>
65
+ <tr id="row_megaventory_link">
66
+ <td class="label" colspan="2">
67
+ If you don't already have a Megaventory Account please <a href="http://megaventory.com/?getstarted=1" target="_blank">Click Here</a>
68
+ </td>
69
+ </tr>
70
+ <?php
71
+ }
72
+
73
+ }?>
74
  <tr id="row_megaventory_connectivity_enabled">
75
  <td class="label"><label
76
  for="megaventory_connectivity_enabled-id"> Megaventory extension
209
  <div style="display:none" class="validation-advice" id="megaventory_discount_sku-id-required" style="">This is a required field.</div>
210
  </td>
211
  </tr>
212
+ <tr>
213
+ <td class="label" colspan="2">
214
+ <img src="<?php echo Mage::getDesign()->getSkinUrl('images/megaventory/message.png')?>" style="position:relative;top:1px;left:4px;margin-right:10px;"/>
215
+ <span style="font-weight:bold;">If you are using any custom attribute for Supplier Management in Magento <br/>please fill in the field below the
216
+ <font style="color:rgb(187, 32, 32)">attribute code</font> of this attribute (i.e supplier, manufacturer etc).
217
+ <br/>Only attributes of frontend type Text or Dropdown are supported.
218
+ <br/>The field is not mandatory.</span>
219
+ </td>
220
+ </tr>
221
+ <tr>
222
+ <td class="label"><label
223
+ for="megaventory_supplier-id">Supplier Attribute Code
224
+ </label></td>
225
+ <td class="value"><input
226
+ id="megaventory_supplier-id"
227
+ name="supplier_attribute_code"
228
+ value="<?php echo $this->getSettingValue('supplierattributecode'); ?>"
229
+ class=" input-text" type="text">&nbsp;
230
+ <?php if(!empty($syncTimestamp)){ ?>
231
+ <button id="save-config-btn" type="button"
232
+ onclick="updateSupplierSettings()">
233
+ <span>Update</span>
234
+ </button>
235
+ <?php } ?>
236
+ </td>
237
+ </tr>
238
  <tr>
239
  <td colspan="2" style="width: 500px;"><strong>Initialize Data</strong></td>
240
 
251
  </tr>
252
  <tr>
253
  <td class="label" colspan="2">
254
+ <?php if ($connectivityOk === true) {
255
+ if ($this->checkBaseCurrencies())
256
+ {
257
+ ?>
258
  <button id="sync-data-btn" type="button"
259
  onclick="javascript:syncData()" <?php if (empty($apikey) || empty($apiurl)) { ?> style="display: none;" <?php }?>>
260
  <span> Start </span>
261
  </button>
262
+ <?php } else {?>
263
+ <span id="currencies-message-id">
264
+ <img src="<?php echo Mage::getDesign()->getSkinUrl('images/megaventory/exclamation.png')?>"
265
+ style="position:relative;top:1px;"/>
266
+ <br/>Setup Wizard cannot start.
267
+ <br/>You must set your Magento and Megaventory default Currencies to the same value.
268
+ <br/>Current default values are <?php echo $this->getDefaultMagentoCurrency() ?> for Magento and <?php echo $this->getDefaultMegaventoryCurrency() ?> for Megaventory.
269
+ <br/>Please contact <a href="http://megaventory.com/?contact-us=1" target="_blank">Megaventory Support</a>
270
+ </span>
271
+ <?php }
272
+ } else {
273
  ?>
274
  <span id="connectivity-message-id">Connection Failed
275
  <img src="<?php echo Mage::getDesign()->getSkinUrl('images/megaventory/exclamation.png')?>" title="<?php echo $connectivityOk ?>" style="position:relative;top:1px;left:4px;"/></span>
276
  <span style="color:red;" id="connectivity-error-message-id"></span>
277
  <?php }?>
278
  <div id="next-step" style="display:none;">
279
+ <br/>
280
+ <strong>Please select the Inventory Location you want to import your global stock to</strong>&nbsp;&nbsp;
281
+ <select
282
+ name="initial-stock-inventory" id="initial-stock-inventory-id">
283
+ <?php foreach ($this->getInventories() as $inventory):?>
284
+ <option value="<?php echo $inventory->getId()?>">
285
+ <?php echo $inventory->getName()?>
286
+ </option>
287
+ <?php endforeach;?>
288
+ </select>
289
+ <br />
290
+ <br />
291
+ <button id="export-stock-btn" type="button" style="margin-left:auto;margin-right:auto;display:table"
292
+ onclick="exportStockAndFinish()">
293
+ <span> Export Magento Stock in Megaventory compatible csv file</span>
294
+ </button>&nbsp;
295
+ <button id="" type="button" style="margin-left:auto;margin-right:auto;display:table"
296
+ onclick="location = '<?php echo $indexURL ?>';">
297
+ <span> Cancel, I will import Megaventory stock manually </span>
298
+ </button>
299
+ <br />
300
+ <br /> <span id="export-stock-csv"></span>
301
+ <br><br>
302
+ <button id="finish-btn" type="button" style="display:none;"
303
+ onclick="javascript:location = '<?php echo $indexURL ?>';">
304
+ <span> Finish </span>
305
+ </button>
306
+ <!--
307
  <br>
308
  Do you want to import your Magento stock to Megaventory?<br>
309
  <button id="next1-data-yes-btn" type="button"
314
  onclick="javascript:location = '<?php echo $indexURL ?>';">
315
  <span> No </span>
316
  </button>
317
+ -->
318
  </div>
319
  <div id="next-error" style="display:none;">
320
  <br>
329
  </button>
330
  </td>
331
  </tr>
332
+ <!--tr>
333
  <td id="stock-setup-id" class="stock-setup" colspan="2"
334
+ style="display: none;padding-top:10px;">
335
  <strong>Please select the Inventory Location you want to import your global stock to</strong><br />
336
  <select
337
  name="initial-stock-inventory" id="initial-stock-inventory-id">
353
  <br />
354
  <br /> <span id="export-stock-csv"></span>
355
  </td>
356
+ </tr-->
357
  </table>
358
  <?php } else {?>
359
  <table class="form-list" style="width:100%">
381
  <div style="display:none" class="validation-advice" id="megaventory_discount_sku-id-required" style="">This is a required field.</div>
382
  </td>
383
  </tr>
384
+ <tr>
385
+ <td class="label" colspan="2">
386
+ <img src="<?php echo Mage::getDesign()->getSkinUrl('images/megaventory/message.png')?>" style="position:relative;top:1px;left:4px;margin-right:10px;"/>
387
+ <span style="font-weight:bold;">If you are using any custom attribute for supplier management in Magento <br/>please fill in the field below the
388
+ <font style="color:rgb(187, 32, 32)">attribute code</font> of this attribute (i.e supplier, manufacturer etc).
389
+ <br/>Only attributes of frontend type Text or Dropdown are supported.
390
+ <br/>The field is not mandatory.</span>
391
+ </td>
392
+ </tr>
393
+ <tr>
394
+ <td class="label"><label
395
+ for="megaventory_supplier-id">Supplier Attribute Code
396
+ </label></td>
397
+ <td class="value"><input
398
+ id="megaventory_supplier-id"
399
+ name="supplier_attribute_code"
400
+ value="<?php echo $this->getSettingValue('supplierattributecode'); ?>"
401
+ class=" input-text" type="text">&nbsp;
402
+ <?php if(!empty($syncTimestamp)){ ?>
403
+ <button id="save-config-btn" type="button"
404
+ onclick="updateSupplierSettings()">
405
+ <span>Update</span>
406
+ </button>
407
+ <?php } ?>
408
+ </td>
409
+ </tr>
410
  <tr id="row_megaventory_general_shippingproductsku">
411
  <td colspan="2"><strong>Setup Report</strong><br />
412
  <?php echo $this->getSettingValue('syncreport'); ?>
575
  <script type="text/javascript">Fieldset.applyCollapse('megaventory_inventories');</script>
576
  </div>
577
  </td>
578
+ <!--td style="padding-left: 15px">
579
+ <div class="entry-edit">
580
+ <div class="entry-edit-head collapseable">
581
+ <a id="megaventory_suppliers-head" href="#"
582
+ onclick="Fieldset.toggleCollapse('megaventory_suppliers', ''); return false;"
583
+ class="open">Suppliers</a>
584
+ </div>
585
+ <input id="megaventory_suppliers-state" type="hidden" value="1">
586
+ <fieldset class="config collapseable" id="megaventory_suppliers"
587
+ style="">
588
+ <legend>Suppliers</legend>
589
+ <table class="form-list" style="width:100%">
590
+ <tr>
591
+ <td width="50%" class="label"><label
592
+ for="megaventory_supplier-id">Supplier Attribute Code
593
+ </label></td>
594
+ <td class="value"><input
595
+ id="megaventory_supplier-id"
596
+ name="supplier_attribute_code"
597
+ value="<?php echo $this->getSettingValue('supplierattributecode'); ?>"
598
+ class=" input-text" type="text">
599
+ </td>
600
+ </tr>
601
+ <tr>
602
+ <td>&nbsp;</td>
603
+ <td class="label" colspan="2">
604
+ <button id="save-config-btn" type="button"
605
+ onclick="updateSupplierSettings()">
606
+ <span>Update</span>
607
+ </button>
608
+ </td>
609
+ </tr>
610
+ </table>
611
+ </fieldset>
612
+ <script type="text/javascript">Fieldset.applyCollapse('megaventory_suppliers');</script>
613
+ </div>
614
+ </td-->
615
  </tr>
616
  <tr>
617
  <td colspan="2">
750
 
751
  var updateSKUs = "<?php echo Mage::helper("adminhtml")->getUrl("megaventory/index/setShippingAndDiscountSKUs") ?>";
752
  var ajax = new Ajax.Request(updateSKUs, {
753
+ parameters: {
754
+ shippingSKU: $('megaventory_shipping_sku-id').value,
755
+ discountSKU: $('megaventory_discount_sku-id').value,
756
+ magento_supplier_code: $('megaventory_supplier-id').value
757
+ },
758
  onSuccess: function(transport) {
759
+ var result = transport.responseText.evalJSON();
760
+ var html = result.message;
761
+ if (html){
762
+ alert(html);
763
+ location = '<?php echo $indexURL ?>';
764
+ }
765
+ else
766
+ {
767
+ continueSyncData();
768
+ }
769
  }
770
  });
771
 
774
  function continueSyncData()
775
  {
776
 
777
+ $('sync-heading-id').update('Initialization process started.Please do not close browser window while initialization runs');
778
  $('sync-data-btn').hide();
779
 
780
 
814
  }
815
  else{
816
  executer.stop();
817
+ if (result.nextstep != 'finisherror'){
818
+ next1Setup();
819
+ //$('next-step').show();
820
+ }
821
  else
822
  $('next-error').show();
823
  }
856
  url = "<?php echo Mage::helper("adminhtml")->getUrl("megaventory/index/getInventories") ?>";
857
  new Ajax.Request(url, {
858
  onSuccess: function(transport) {
859
+ //$('stock-setup-id').show();
860
  var response = transport.responseText.evalJSON();
861
  //add inventories to select object
862
  $('initial-stock-inventory-id').update(response.options);
863
+ $('next-step').show();
864
  }
865
  });
866
  }
881
  });
882
  }
883
 
884
+
885
+ function exportStockAndFinish()
886
+ {
887
+ url = "<?php echo Mage::helper("adminhtml")->getUrl("megaventory/index/exportStock") ?>";
888
+
889
+ new Ajax.Request(url, {
890
+ parameters:
891
+ {
892
+ 'inventory' : $('initial-stock-inventory-id').options[$('initial-stock-inventory-id').selectedIndex].value,
893
+ },
894
+ onSuccess: function(transport) {
895
+ var link = '<a href="/var/export/InitialQuantities.csv">Download InitialQuantities File</a>';
896
+ $('export-stock-csv').update(link);
897
+ $('finish-btn').show();
898
+ }
899
+ });
900
+ }
901
+
902
  function changeCountsInStock(inventoryId , oneOrZero, url, checkBox){
903
 
904
  var r=confirm('You are about to change the Inventory Locations that contribute to the global stock of Magento. If you proceed, you should also click "Import Inventory from Megaventory" to synchronize quantities before leaving the page.');
968
  }
969
  }
970
 
971
+ function updateSupplierSettings(){
972
+ url = "<?php echo Mage::helper("adminhtml")->getUrl("megaventory/index/updateSupplierSettings") ?>";
973
+ new Ajax.Request(url, {
974
+ parameters:
975
+ {
976
+ 'magento_supplier_code' : $('megaventory_supplier-id').value
977
+ },
978
+ onSuccess: function(transport) {
979
+ if (transport.responseText){
980
+ var result = transport.responseText.evalJSON();
981
+
982
+ alert(result.message);
983
+ }
984
+ location = '<?php echo $indexURL ?>';
985
+ }
986
+ });
987
+ }
988
+
989
  </script>
package.xml CHANGED
@@ -1,23 +1,23 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mv_Megaventory</name>
4
- <version>2.0.1</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Integrates your Magento store to Megaventory web-based ERP</summary>
10
  <description>With Megaventory, you will efficiently manage all your inventory, purchasing and order fullfilment needs. This module synchronizes Magento to your megaventory.com account and adds support for multiple inventory locations, purchase orders, work orders (using bill of materials) and custom inventory, sales and purchasing reports.</description>
11
- <notes>This new minor version catches bulk imports of products and customers from Magento, which now are flowing to Megaventory.&#xD;
12
- Extended dataflow profile imports are not yet supported. This affects older Magento versions that do not have default import processes (no System-&gt;Import/Export-&gt;Import option)&#xD;
13
- &#xD;
14
- Furthermore the following bugs were fixed:&#xD;
15
- - Sometines wrong shipment id was used when applied a Megaventory shipping pending update. Now we ensure that the right shipment increment id is applied at all times&#xD;
16
- - Order references to Megaventory's inventory locations are also being reset when user resets global data</notes>
17
  <authors><author><name>Megaventory Megaventory</name><user>megaventory</user><email>info@megaventory.com</email></author></authors>
18
- <date>2014-07-30</date>
19
- <time>12:14:12</time>
20
- <contents><target name="magelocal"><dir name="Mv"><dir name="Megaventory"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><file name="Grid.php" hash="fff2aa89e995af3446a6007850a743e0"/></dir></dir><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="View.php" hash="5f4b6af1de69091b1b10b4b12ce0f673"/></dir></dir></dir><dir name="Inventories"><file name="Grid.php" hash="3359fe278f99e28acf29547debbc611b"/></dir><file name="Inventories.php" hash="963069637a8d349f279e3e2a3d59e878"/><dir name="Megaventorylog"><file name="Grid.php" hash="d2417c3c3ed63ef65c71c6538ee62e4d"/></dir><file name="Megaventorylog.php" hash="06b457820aec2bda101728a4b97b9c6a"/><file name="Megaventorysettings.php" hash="8135c0d4c727606112182c4b09e95d7e"/><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Megaventory.php" hash="6959d43090370b73abf97d494de33910"/></dir></dir></dir><dir name="Renderer"><file name="Action.php" hash="5a88b067482480da031ac6a1972502a7"/><file name="Boolean.php" hash="a64533e5627a1981410b2f4465c3e5f5"/><file name="Countsinstock.php" hash="02fb7cc939969503ed5f2c0d46605beb"/><file name="Orderinventory.php" hash="81e8c7b5915388ac833dd26cf5c78f58"/><dir name="Product"><file name="Inventories.php" hash="ad0116b1ae321dc7644d3ed1b18cfd20"/></dir></dir><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="aa6d5947cfd04e1317e7e88c6802b5bc"/></dir></dir><dir name="System"><dir name="Convert"><dir name="Profile"><file name="Run.php" hash="08efbdc75a3890e8c7ec74be289e16d5"/></dir></dir></dir><dir name="Taxes"><file name="Grid.php" hash="910aa1bce7cdac35049139b845806fcc"/></dir><file name="Taxes.php" hash="c325693005618a94595c433b9c40212e"/><dir name="Updates"><file name="Grid.php" hash="b58d845ed388b7f65fa919b0c5e1ff4a"/></dir><file name="Updates.php" hash="0e651824253cec325fdcbd0c4a4fdc99"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="070c600934929ff3259eccb257d9eaad"/></dir><dir name="etc"><file name="adminhtml.xml" hash="7350c351bed984caa4da9e65db78f7d3"/><file name="api.xml" hash="7cad22030a2e2c79e16de5ce0ba790e4"/><file name="config.xml" hash="3757476ee94d768352aab8067da95926"/><file name="system.xml" hash="0c4691ab690fdbfbfcd930195a07f8d3"/><file name="wsdl.xml" hash="98ae8557b66efd05e279e2ce56f36dc4"/></dir><dir name="Helper"><file name="Category.php" hash="4e2c3af28854aec82bb8cc5a7f66028a"/><file name="Common.php" hash="1214ddf8c525a635f6884cf29da31213"/><file name="Currencies.php" hash="afd489d48d2b42f22f434c2735fd8976"/><file name="Customer.php" hash="642b49d6029386c1b1940b094c079205"/><file name="Data.php" hash="fdd7b070aaaeceb045ee15617ba2a2c0"/><file name="Inventories.php" hash="99f0fa4c4e6e0671591a3e86b87e5fa1"/><file name="Order.php" hash="fd2ddb4f6b195246d8ea6dfa3d194f78"/><file name="Product.php" hash="9af8ebae1faa1cf3f3ee8cb7c9eb2579"/><file name="Suppliers.php" hash="114e7d9f5608aba273d5f4987e042564"/><file name="Taxes.php" hash="d379c953130c39e5195c0f2f65036d3a"/></dir><dir name="Model"><file name="Bom.php" hash="2e31318df6c21bcb697ce1f6a903031e"/><dir name="Category"><file name="Observer.php" hash="fe1742dfe7a6d7c80db9afa63d446d4f"/></dir><file name="Currencies.php" hash="6b8a36da6d7c55df5138d45dbeb633a4"/><dir name="Customer"><file name="Exporter.php" hash="ac724296dced11ed057046f86bb4760e"/><file name="Observer.php" hash="52fe3653bc9fa4c4f30304e4a9f44027"/></dir><file name="Exporter.php" hash="a62ef834b3b0384f4737fd2364f059f0"/><dir name="Import"><dir name="Entity"><dir name="Customer"><file name="Address.php" hash="86a8b0f38ee6e5a4b29400cc451f09fa"/></dir></dir></dir><file name="Inventories.php" hash="fb481d874caf90249c80445053148767"/><file name="Megaventorylog.php" hash="29297786f36037e8c319264f2fa85f81"/><dir name="Mysql4"><dir name="Bom"><file name="Collection.php" hash="4e390a210021192a47484134e4d39a0e"/></dir><file name="Bom.php" hash="122e092508f8efba8403195aea99cc8f"/><dir name="Currencies"><file name="Collection.php" hash="c6a2447656a517980c12645dba12fd07"/></dir><file name="Currencies.php" hash="e138cf3ab27542eebaca9412e320bade"/><dir name="Inventories"><file name="Collection.php" hash="d6b534e8a607d6417e893fd3dcd5a30d"/></dir><file name="Inventories.php" hash="b87b6aac89db59e93f203713572b7594"/><dir name="Megaventorylog"><file name="Collection.php" hash="bf0a73388b11e7c26cc5629f4609dd33"/></dir><file name="Megaventorylog.php" hash="2d2acaa33c3a65338f3711232ac0727a"/><dir name="Productstocks"><file name="Collection.php" hash="4bbb1e8cb7365df22a5bb4becc1a2928"/></dir><file name="Productstocks.php" hash="875331f6f6eda5316276505396fb4626"/><dir name="Taxes"><file name="Collection.php" hash="2ba005f102cffc1e36fdf5a96042f22f"/></dir><file name="Taxes.php" hash="78f035f9d78f878ddccbc1b782ab63cb"/></dir><dir name="Notification"><file name="Feed.php" hash="3db99c6d0c19b60c20043d0cbacb9849"/></dir><file name="Observer.php" hash="10748c85bcef23b356663b83c74a6908"/><dir name="Product"><file name="Observer.php" hash="e3eeed6b5554faa5c83e2f8da7f23fdb"/></dir><file name="Productstocks.php" hash="cfb4905eb159b62b614cc463b8a4d09b"/><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="05c334b454b5f93f1cf3bbbf39485b97"/></dir></dir><dir name="Sales"><file name="Observer.php" hash="0bfb53a5e95defc780fbc38aa140a8e0"/></dir><dir name="Services"><dir name="Api"><file name="V2.php" hash="3fe9ab25a56006d4811e7d3da52b9c32"/></dir><file name="Api.php" hash="9627ef26c0d29b3ef5801e0e976bccc5"/></dir><dir name="Stock"><file name="Exporter.php" hash="d3e449aca921c3ab4f8f2181db88dcaf"/></dir><dir name="Stockitem"><file name="Observer.php" hash="71df67605c432bfdc25ae8b60ae66b31"/></dir><file name="Taxes.php" hash="f223b7efcbfac4ceb4b553725281e9f2"/></dir><dir name="sql"><dir name="megaventory_setup"><file name="mysql4-install-0.1.0.php" hash="2e1ce681394e2278868a10865660a41f"/><file name="mysql4-upgrade-0.1.0-0.1.5.php" hash="b9e25c46b3738eec98dbad13201c8751"/><file name="mysql4-upgrade-0.1.5-0.2.0.php" hash="2588ce62eb04c6dc20638e2110a3d2e5"/><file name="mysql4-upgrade-0.2.0-0.3.0.php" hash="3e4bcf4eecd578913fada55bbd4e4218"/><file name="mysql4-upgrade-0.3.0-1.0.0.php" hash="5dac061b4b58ff212722858db76de11d"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="megaventory"><file name="scripts.js" hash="f34681c44311c094255a52165da31d4f"/></dir><dir name="images"><dir name="megaventory"><file name="accept.png" hash="90134a31c616bab56f31472981244c0e"/><file name="exclamation.png" hash="e4dd51f46566ed3ceacdc900bf2fdf01"/><file name="infobutton.png" hash="b57cba82d84d3b333dd3654c39b97120"/><file name="message.png" hash="3cc350d4638c397345658a18c492d685"/><file name="pdf.png" hash="3e34bb1d7ae246eda83a8243e371b0cc"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="megaventory.xml" hash="d1ede978aba9e58e0bcf4f873d028b70"/></dir><dir name="template"><dir name="megaventory"><dir name="catalog"><dir name="product"><dir name="tab"><file name="inventory.phtml" hash="ffaebda15775f879a97f947b893d2c7c"/></dir></dir></dir><dir name="customer"><dir name="tab"><file name="view.phtml" hash="c5a30829f873360ffd69b9b55456318e"/></dir></dir><file name="megaventory.phtml" hash="20648fb92c42c5deaba7267443096e08"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mv_Megaventory.xml" hash="a7b18008632193e463a04c92852d32c4"/></dir></target></contents>
21
  <compatible/>
22
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
23
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mv_Megaventory</name>
4
+ <version>2.1.0</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Integrates your Magento store to Megaventory web-based ERP</summary>
10
  <description>With Megaventory, you will efficiently manage all your inventory, purchasing and order fullfilment needs. This module synchronizes Magento to your megaventory.com account and adds support for multiple inventory locations, purchase orders, work orders (using bill of materials) and custom inventory, sales and purchasing reports.</description>
11
+ <notes>This update includes the following feature additions: &#xD;
12
+ (A) If a custom product attribute has been added in Magento to &#x201C;link&#x201D; products &#xD;
13
+ to supplier entities, this information (the supplier of the product) &#xD;
14
+ will also be pushed to Megaventory either during the initial setup wizard or at any time a Magento product is saved/updated. &#xD;
15
+ (B) The Notify for Quantity Below (Stock Alert level) figure is automatically synced between Magento and Megaventory&#xD;
16
+ Moreover, a few bugs have been fixed and various code optimizations have been applied.</notes>
17
  <authors><author><name>Megaventory Megaventory</name><user>megaventory</user><email>info@megaventory.com</email></author></authors>
18
+ <date>2014-11-25</date>
19
+ <time>17:03:41</time>
20
+ <contents><target name="magelocal"><dir name="Mv"><dir name="Megaventory"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><file name="Grid.php" hash="fff2aa89e995af3446a6007850a743e0"/></dir></dir><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="View.php" hash="5f4b6af1de69091b1b10b4b12ce0f673"/></dir></dir></dir><dir name="Inventories"><file name="Grid.php" hash="3359fe278f99e28acf29547debbc611b"/></dir><file name="Inventories.php" hash="963069637a8d349f279e3e2a3d59e878"/><dir name="Megaventorylog"><file name="Grid.php" hash="d2417c3c3ed63ef65c71c6538ee62e4d"/></dir><file name="Megaventorylog.php" hash="06b457820aec2bda101728a4b97b9c6a"/><file name="Megaventorysettings.php" hash="3f3d343791f6e5e4d70141aeb67f3726"/><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Megaventory.php" hash="6959d43090370b73abf97d494de33910"/></dir></dir></dir><dir name="Renderer"><file name="Action.php" hash="5a88b067482480da031ac6a1972502a7"/><file name="Boolean.php" hash="a64533e5627a1981410b2f4465c3e5f5"/><file name="Countsinstock.php" hash="02fb7cc939969503ed5f2c0d46605beb"/><file name="Orderinventory.php" hash="81e8c7b5915388ac833dd26cf5c78f58"/><dir name="Product"><file name="Inventories.php" hash="ad0116b1ae321dc7644d3ed1b18cfd20"/></dir></dir><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="aa6d5947cfd04e1317e7e88c6802b5bc"/></dir></dir><dir name="System"><dir name="Convert"><dir name="Profile"><file name="Run.php" hash="08efbdc75a3890e8c7ec74be289e16d5"/></dir></dir></dir><dir name="Taxes"><file name="Grid.php" hash="910aa1bce7cdac35049139b845806fcc"/></dir><file name="Taxes.php" hash="c325693005618a94595c433b9c40212e"/><dir name="Updates"><file name="Grid.php" hash="b58d845ed388b7f65fa919b0c5e1ff4a"/></dir><file name="Updates.php" hash="0e651824253cec325fdcbd0c4a4fdc99"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="1b5c9f129772f148ba5822853cfbb544"/></dir><dir name="etc"><file name="adminhtml.xml" hash="7350c351bed984caa4da9e65db78f7d3"/><file name="api.xml" hash="7cad22030a2e2c79e16de5ce0ba790e4"/><file name="config.xml" hash="78b9c301fa12399cc7b627fb4f05f0c6"/><file name="system.xml" hash="0c4691ab690fdbfbfcd930195a07f8d3"/><file name="wsdl.xml" hash="98ae8557b66efd05e279e2ce56f36dc4"/></dir><dir name="Helper"><file name="Category.php" hash="d639d3696ba9bf42a6684b2c0d075a02"/><file name="Common.php" hash="1214ddf8c525a635f6884cf29da31213"/><file name="Currencies.php" hash="afd489d48d2b42f22f434c2735fd8976"/><file name="Customer.php" hash="642b49d6029386c1b1940b094c079205"/><file name="Data.php" hash="fdd7b070aaaeceb045ee15617ba2a2c0"/><file name="Inventories.php" hash="afb3355dad6dbb0d13b2180eb57255cf"/><file name="Order.php" hash="0699be197186a604a2f27ac7b4b16b9f"/><file name="Product.php" hash="3a925a7d4119a23d86cdd02c78989138"/><file name="Suppliers.php" hash="114e7d9f5608aba273d5f4987e042564"/><file name="Taxes.php" hash="d379c953130c39e5195c0f2f65036d3a"/></dir><dir name="Model"><file name="Bom.php" hash="2e31318df6c21bcb697ce1f6a903031e"/><dir name="Category"><file name="Observer.php" hash="68005baf483f6216455a319d88f2d4cc"/></dir><file name="Currencies.php" hash="6b8a36da6d7c55df5138d45dbeb633a4"/><dir name="Customer"><file name="Exporter.php" hash="ac724296dced11ed057046f86bb4760e"/><file name="Observer.php" hash="52fe3653bc9fa4c4f30304e4a9f44027"/></dir><file name="Exporter.php" hash="a62ef834b3b0384f4737fd2364f059f0"/><dir name="Import"><dir name="Entity"><dir name="Customer"><file name="Address.php" hash="86a8b0f38ee6e5a4b29400cc451f09fa"/></dir></dir></dir><file name="Inventories.php" hash="fb481d874caf90249c80445053148767"/><file name="Megaventorylog.php" hash="29297786f36037e8c319264f2fa85f81"/><dir name="Mysql4"><dir name="Bom"><file name="Collection.php" hash="4e390a210021192a47484134e4d39a0e"/></dir><file name="Bom.php" hash="122e092508f8efba8403195aea99cc8f"/><dir name="Currencies"><file name="Collection.php" hash="c6a2447656a517980c12645dba12fd07"/></dir><file name="Currencies.php" hash="e138cf3ab27542eebaca9412e320bade"/><dir name="Inventories"><file name="Collection.php" hash="d6b534e8a607d6417e893fd3dcd5a30d"/></dir><file name="Inventories.php" hash="b87b6aac89db59e93f203713572b7594"/><dir name="Megaventorylog"><file name="Collection.php" hash="bf0a73388b11e7c26cc5629f4609dd33"/></dir><file name="Megaventorylog.php" hash="2d2acaa33c3a65338f3711232ac0727a"/><dir name="Productstocks"><file name="Collection.php" hash="4bbb1e8cb7365df22a5bb4becc1a2928"/></dir><file name="Productstocks.php" hash="875331f6f6eda5316276505396fb4626"/><dir name="Taxes"><file name="Collection.php" hash="2ba005f102cffc1e36fdf5a96042f22f"/></dir><file name="Taxes.php" hash="78f035f9d78f878ddccbc1b782ab63cb"/></dir><dir name="Notification"><file name="Feed.php" hash="3db99c6d0c19b60c20043d0cbacb9849"/></dir><file name="Observer.php" hash="10748c85bcef23b356663b83c74a6908"/><dir name="Product"><file name="Observer.php" hash="e3eeed6b5554faa5c83e2f8da7f23fdb"/></dir><file name="Productstocks.php" hash="cfb4905eb159b62b614cc463b8a4d09b"/><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="05c334b454b5f93f1cf3bbbf39485b97"/></dir></dir><dir name="Sales"><file name="Observer.php" hash="0bfb53a5e95defc780fbc38aa140a8e0"/></dir><dir name="Services"><dir name="Api"><file name="V2.php" hash="3fe9ab25a56006d4811e7d3da52b9c32"/></dir><file name="Api.php" hash="868008325f492742f102586847214ba1"/></dir><dir name="Stock"><file name="Exporter.php" hash="d3e449aca921c3ab4f8f2181db88dcaf"/></dir><dir name="Stockitem"><file name="Observer.php" hash="71df67605c432bfdc25ae8b60ae66b31"/></dir><file name="Taxes.php" hash="f223b7efcbfac4ceb4b553725281e9f2"/></dir><dir name="sql"><dir name="megaventory_setup"><file name="mysql4-install-0.1.0.php" hash="2e1ce681394e2278868a10865660a41f"/><file name="mysql4-upgrade-0.1.0-0.1.5.php" hash="b9e25c46b3738eec98dbad13201c8751"/><file name="mysql4-upgrade-0.1.5-0.2.0.php" hash="2588ce62eb04c6dc20638e2110a3d2e5"/><file name="mysql4-upgrade-0.2.0-0.3.0.php" hash="3e4bcf4eecd578913fada55bbd4e4218"/><file name="mysql4-upgrade-0.3.0-1.0.0.php" hash="5dac061b4b58ff212722858db76de11d"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="megaventory"><file name="scripts.js" hash="f34681c44311c094255a52165da31d4f"/></dir><dir name="images"><dir name="megaventory"><file name="accept.png" hash="90134a31c616bab56f31472981244c0e"/><file name="exclamation.png" hash="e4dd51f46566ed3ceacdc900bf2fdf01"/><file name="infobutton.png" hash="b57cba82d84d3b333dd3654c39b97120"/><file name="message.png" hash="3cc350d4638c397345658a18c492d685"/><file name="pdf.png" hash="3e34bb1d7ae246eda83a8243e371b0cc"/><file name="smallloader.gif" hash="eec22c24eb141346e57115232ccbd53e"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="megaventory.xml" hash="d1ede978aba9e58e0bcf4f873d028b70"/></dir><dir name="template"><dir name="megaventory"><dir name="catalog"><dir name="product"><dir name="tab"><file name="inventory.phtml" hash="4cbee14572a0291a66f48dc485670de0"/></dir></dir></dir><dir name="customer"><dir name="tab"><file name="view.phtml" hash="c5a30829f873360ffd69b9b55456318e"/></dir></dir><file name="megaventory.phtml" hash="cb33f0673117122ca0c28393811eaac5"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mv_Megaventory.xml" hash="a7b18008632193e463a04c92852d32c4"/></dir></target></contents>
21
  <compatible/>
22
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
23
  </package>
skin/adminhtml/default/default/images/megaventory/smallloader.gif ADDED
Binary file