Add db_prevoid
authorMaxime Bourget <bmx007@gmail.com>
Wed, 5 Jun 2013 21:07:37 +0000 (22:07 +0100)
committerMaxime Bourget <bmx007@gmail.com>
Wed, 5 Jun 2013 21:07:37 +0000 (22:07 +0100)
hooks.php

index 0bf5ad166e40b1e7181685d197d7fba70171e090..1773852a2b2f4cfe15db15141e71fb906794a901 100644 (file)
--- a/hooks.php
+++ b/hooks.php
@@ -92,5 +92,16 @@ class hooks_order_line_extra extends hooks {
                        }
        
                }
+
+
+               function db_prevoid($cart, $trans_type) {
+               // Simple version, rebuild everything
+               $types = array(ST_CUSTCREDIT, ST_CUSTDELIVERY, ST_INVADJUST, ST_PURCHORDER, ST_WORKORDER, ST_MANUISSUE,
+                               ST_SALESORDER, ST_SALESQUOTE, ST_MANURECEIVE);
+               if(in_array($trans_type, $types)) {
+                       update_queue_quantities();
+                       update_qoh_for_item();
+               }
+               }
 }
 ?>