Wyomind_RealInventory - Version 1.1.0

Version Notes

v1.1.0

Download this release

Release Info

Developer Wyomind
Extension Wyomind_RealInventory
Version 1.1.0
Comparing to
See all releases


Code changes from version 1.0.1 to 1.1.0

app/code/community/Wyomind/Realinventory/Block/Adminhtml/System/Config/Form/Field/Date.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Wyomind_Realinventory_Block_Adminhtml_System_Config_Form_Field_Date extends Mage_Adminhtml_Block_System_Config_Form_Field {
4
+
5
+ public function render(Varien_Data_Form_Element_Abstract $element) {
6
+ $element->setFormat(Varien_Date::DATE_INTERNAL_FORMAT); //or other format
7
+ $element->setImage($this->getSkinUrl('images/grid-cal.gif'));
8
+ return parent::render($element);
9
+ }
10
+
11
+ }
12
+
app/code/community/Wyomind/Realinventory/Model/Observer.php CHANGED
@@ -29,16 +29,21 @@ class Wyomind_Realinventory_Model_Observer {
29
 
30
  public function reserve($observer) {
31
  $order = $observer->getEvent()->getOrder();
32
- $orderedItems = Mage::helper("realinventory/data")->getOrderedItems($order);
33
- Mage::helper("realinventory/data")->incrementReservedStocks($orderedItems);
34
- //Mage::getSingleton("core/session")->addSuccess("LOG::reserve");
 
 
 
 
35
  }
36
 
37
  public function cancel($observer) {
38
  $order = $observer->getEvent()->getPayment()->getOrder();
39
-
40
- $orderedItems = Mage::helper("realinventory/data")->getOrderedItems($order);
41
- Mage::helper("realinventory/data")->decrementReservedStocks($orderedItems);
 
42
 
43
  //Mage::getSingleton("core/session")->addSuccess("LOG::cancel");
44
  }
@@ -66,6 +71,7 @@ class Wyomind_Realinventory_Model_Observer {
66
  }
67
 
68
  public function shipped($observer) {
 
69
  $shipment = $observer->getEvent()->getShipment();
70
  $items = $shipment->getItemsCollection();
71
  foreach ($items as $item) {
@@ -77,4 +83,3 @@ class Wyomind_Realinventory_Model_Observer {
77
  }
78
 
79
  }
80
-
29
 
30
  public function reserve($observer) {
31
  $order = $observer->getEvent()->getOrder();
32
+
33
+ if ($order->getCreatedAt() > Mage::getStoreConfig("realinventory/system/from_date")) {
34
+
35
+ $orderedItems = Mage::helper("realinventory/data")->getOrderedItems($order);
36
+ Mage::helper("realinventory/data")->incrementReservedStocks($orderedItems);
37
+ //Mage::getSingleton("core/session")->addSuccess("LOG::reserve");
38
+ }
39
  }
40
 
41
  public function cancel($observer) {
42
  $order = $observer->getEvent()->getPayment()->getOrder();
43
+ if ($order->getCreatedAt() > Mage::getStoreConfig("realinventory/system/from_date")) {
44
+ $orderedItems = Mage::helper("realinventory/data")->getOrderedItems($order);
45
+ Mage::helper("realinventory/data")->decrementReservedStocks($orderedItems);
46
+ }
47
 
48
  //Mage::getSingleton("core/session")->addSuccess("LOG::cancel");
49
  }
71
  }
72
 
73
  public function shipped($observer) {
74
+
75
  $shipment = $observer->getEvent()->getShipment();
76
  $items = $shipment->getItemsCollection();
77
  foreach ($items as $item) {
83
  }
84
 
85
  }
 
app/code/community/Wyomind/Realinventory/etc/config.xml CHANGED
@@ -4,13 +4,13 @@
4
  <config>
5
  <modules>
6
  <Wyomind_Realinventory>
7
- <version>1.0.1</version>
8
  </Wyomind_Realinventory>
9
  </modules>
10
  <default>
11
  <realinventory>
12
  <system>
13
- <grid>Mage_Adminhtml_Block_Product_Grid</grid>
14
  </system>
15
  </realinventory>
16
  </default>
@@ -148,6 +148,11 @@
148
  <class>Wyomind_Realinventory_Helper</class>
149
  </realinventory>
150
  </helpers>
 
 
 
 
 
151
  </global>
152
  </config>
153
 
4
  <config>
5
  <modules>
6
  <Wyomind_Realinventory>
7
+ <version>1.1.0</version>
8
  </Wyomind_Realinventory>
9
  </modules>
10
  <default>
11
  <realinventory>
12
  <system>
13
+ <grid>Mage_Adminhtml_Block_Catalog_Product_Grid</grid>
14
  </system>
15
  </realinventory>
16
  </default>
148
  <class>Wyomind_Realinventory_Helper</class>
149
  </realinventory>
150
  </helpers>
151
+ <blocks>
152
+ <realinventory>
153
+ <class>Wyomind_Realinventory_Block</class>
154
+ </realinventory>
155
+ </blocks>
156
  </global>
157
  </config>
158
 
app/code/community/Wyomind/Realinventory/etc/system.xml CHANGED
@@ -29,7 +29,7 @@
29
  <grid translate="label comment">
30
  <label>Product grid to display </label>
31
  <comment>
32
- <![CDATA[ <span class="notice"> Default value : `Mage_Adminhtml_Block_Product_Grid`</span>]]>
33
  </comment>
34
  <validate>required-entry validate-address</validate>
35
  <frontend_type>text</frontend_type>
@@ -38,6 +38,19 @@
38
  <show_in_website>0</show_in_website>
39
  <show_in_store>0</show_in_store>
40
  </grid>
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  </fields>
42
  </system>
43
  </groups>
29
  <grid translate="label comment">
30
  <label>Product grid to display </label>
31
  <comment>
32
+ <![CDATA[ <span class="notice"> Default value : `Mage_Adminhtml_Block_Catalog_Product_Grid`</span>]]>
33
  </comment>
34
  <validate>required-entry validate-address</validate>
35
  <frontend_type>text</frontend_type>
38
  <show_in_website>0</show_in_website>
39
  <show_in_store>0</show_in_store>
40
  </grid>
41
+ <from_date translate="label comment">
42
+ <label>Start date for order management:</label>
43
+ <comment>
44
+ <![CDATA[<span class="notice">Use real stock info from this date </span>]]>
45
+ </comment>
46
+
47
+ <frontend_type>date</frontend_type>
48
+ <frontend_model>realinventory/adminhtml_system_config_form_field_date</frontend_model>
49
+ <sort_order>2</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>0</show_in_website>
52
+ <show_in_store>0</show_in_store>
53
+ </from_date>
54
  </fields>
55
  </system>
56
  </groups>
package.xml CHANGED
@@ -1,23 +1,21 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Wyomind_RealInventory</name>
4
- <version>1.0.1</version>
5
  <stability>stable</stability>
6
- <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Keep your inventory updated until the orders are shipped. Display your stock level in two distinct columns : one for the saleable remaining products and one other for the already paid but not shipped products.</summary>
10
  <description>+ Show the saleable remaining product stocks and the already paid but not shipped product stock&#xD;
11
  + Keep your Magento inventory synchronized with your real inventory&#xD;
12
  + See in one glance which products must be shipped&#xD;
13
- + Can be used with any tiers extension already installed that overrides the default products grid such as "Enhanced Admin Product Grid"</description>
14
- <notes>Fixed bugs : &#xD;
15
- - Compilation fixed &#xD;
16
- - Wording in the configuration panel</notes>
17
- <authors><author><name>Wyomind</name><user>auto-converted</user><email>contact@wyomind.com</email></author></authors>
18
- <date>2013-03-14</date>
19
- <time>07:41:01</time>
20
- <contents><target name="magecommunity"><dir name="Wyomind"><dir name="Realinventory"><dir name="Block"><dir name="Renderer"><file name="Qty.php" hash="22af248287d79ec365023cd1ca7ab9a8"/></dir></dir><dir name="Helper"><file name="Data.php" hash="ad19841c1add221eed126808a17a080d"/></dir><dir name="Model"><file name="Observer.php" hash="02a969a3abcac088eeb83f6125a004df"/></dir><dir name="controllers"><file name="LicenseController.php" hash="831a4b2ca0d4404f74fdb210eea6fac8"/></dir><dir name="etc"><file name="config.xml" hash="aac5bae6191d247fd64af3adb4d1cf5e"/><file name="system.xml" hash="0508fe955d892fe459b14aa0e278efb8"/></dir><dir name="sql"><dir name="realinventory_setup"><file name="mysql4-install-1.0.0.php" hash="281ce389c4960100c21039539d601c60"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Wyomind_Realinventory.xml" hash="a55d4da5dc0000c556e72e4e648f26b2"/></dir></target></contents>
21
  <compatible/>
22
- <dependencies/>
23
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Wyomind_RealInventory</name>
4
+ <version>1.1.0</version>
5
  <stability>stable</stability>
6
+ <license>free</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Keep your inventory updated until the orders are shipped. Display your stock level in two distinct columns : one for the saleable remaining products and one other for the already paid but not shipped products.</summary>
10
  <description>+ Show the saleable remaining product stocks and the already paid but not shipped product stock&#xD;
11
  + Keep your Magento inventory synchronized with your real inventory&#xD;
12
  + See in one glance which products must be shipped&#xD;
13
+ + Can be used with any tiers extension already installed that overrides the default products grid such as "Enhanced Admin Product Grid</description>
14
+ <notes>v1.1.0</notes>
15
+ <authors><author><name>Wyomind</name><user>Wyomind</user><email>contact@wyomind.com</email></author></authors>
16
+ <date>2015-02-09</date>
17
+ <time>09:30:59</time>
18
+ <contents><target name="magecommunity"><dir name="Wyomind"><dir name="Realinventory"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Date.php" hash="1048ac959f97468549693067bc0cd582"/></dir></dir></dir></dir></dir><dir name="Renderer"><file name="Qty.php" hash="22af248287d79ec365023cd1ca7ab9a8"/></dir></dir><dir name="Helper"><file name="Data.php" hash="ad19841c1add221eed126808a17a080d"/></dir><dir name="Model"><file name="Observer.php" hash="05070a0b53cd468e42e71204f7b342e5"/></dir><dir name="controllers"><file name="LicenseController.php" hash="831a4b2ca0d4404f74fdb210eea6fac8"/></dir><dir name="etc"><file name="config.xml" hash="96886b5c2e1302d7c26516fbbfe03f19"/><file name="system.xml" hash="af6993d0e4720776537f3940bd9ee32d"/></dir><dir name="sql"><dir name="realinventory_setup"><file name="mysql4-install-1.0.0.php" hash="281ce389c4960100c21039539d601c60"/></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Wyomind_Realinventory.xml" hash="a55d4da5dc0000c556e72e4e648f26b2"/></dir></dir></target></contents>
 
 
19
  <compatible/>
20
+ <dependencies><required><php><min>4.0.0</min><max>5.6.0</max></php></required></dependencies>
21
  </package>