From 05ef7a21f9d2e2bade7d446e861d0e6081e4e127 Mon Sep 17 00:00:00 2001 From: Maxime Bourget Date: Sat, 8 Jun 2013 16:28:40 +0100 Subject: [PATCH] Call db_hook on priority update. --- hooks.php | 4 ++++ includes/order_lines.inc | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hooks.php b/hooks.php index 1df1ef5..099d11c 100644 --- 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. diff --git a/includes/order_lines.inc b/includes/order_lines.inc index cbaedc1..02787d6 100644 --- a/includes/order_lines.inc +++ b/includes/order_lines.inc @@ -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(); } -- 2.30.2