Call db_hook on priority update.
authorMaxime Bourget <bmx007@gmail.com>
Sat, 8 Jun 2013 15:28:40 +0000 (16:28 +0100)
committerMaxime Bourget <bmx007@gmail.com>
Sat, 8 Jun 2013 15:46:28 +0000 (16:46 +0100)
hooks.php
includes/order_lines.inc

index 1df1ef5cc4387d555dc9908bdd4f0ec53794a7b9..099d11c224ddbfdc7566f19e61174de29dd1823e 100644 (file)
--- a/hooks.php
+++ b/hooks.php
@@ -90,7 +90,11 @@ class hooks_order_line_extra extends hooks {
                                $stock_id = $item->stock_id;
                                update_queue_quantity_for_item($stock_id);
                                update_qoh_for_item($stock_id);
+                               }
                        }
+                       else if (isset($trans_type) && $trans_type == "order_xtra") {
+                               update_queue_quantities();
+                               update_qoh_for_item();
                        }
 
                        // update null fields of new entered orders.
index cbaedc1d00a28011df1636ef5f5f4afadd0c6674..02787d63914b35ce26a5152e8cdc5207a2ef39a7 100644 (file)
@@ -32,6 +32,8 @@ function update_extra_order_details() {
        if(!isset($_POST['Update']) || $_POST['Update'] != 'Update')  return;
 
 begin_transaction();
+       $cart  = null;
+       hook_db_prewrite($cart, 'order_xtra');
        // update in database all field
        $date_fields = array('hold_until_date', 'required_date', 'expiry_date', 'priority');
        foreach($_POST['detail'] as $detail_id => $values) {
@@ -59,7 +61,8 @@ begin_transaction();
                                return;
                        }
                }
-commit_transaction();
+       hook_db_postwrite($cart, 'order_xtra');
+       commit_transaction();
 
        }