From: Maxime Bourget Date: Tue, 11 Jun 2013 16:36:10 +0000 (+0100) Subject: Fix priority queue using hold until date instead of expiry one. X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=01dde931d6327458da4ff354811b07161d4c96e2;p=order_line_extra.git Fix priority queue using hold until date instead of expiry one. --- diff --git a/hooks.php b/hooks.php index 40a3fd9..0ef098f 100644 --- a/hooks.php +++ b/hooks.php @@ -60,9 +60,9 @@ class hooks_order_line_extra extends hooks { ); return $this->update_databases($company, $updates, $check_only) + && update_order_detail_defaults(true) && update_queue_quantities() && update_qoh_for_item() - && update_order_detail_defaults(true) ; } diff --git a/includes/db_order_lines.inc b/includes/db_order_lines.inc index 94ed65f..944a3f2 100644 --- a/includes/db_order_lines.inc +++ b/includes/db_order_lines.inc @@ -52,7 +52,7 @@ function insert_item_into_queue($stock_id) { NATURAL JOIN ".TB_PREF."sales_orders WHERE stk_code = \"$stock_id\" AND quantity > qty_sent - ORDER BY IF(hold_until_date < NOW(), 1, 0), IF(priority IS NULL, CONCAT(ord_date, ' 23:59:59'), priority) + ORDER BY IF(expiry_date < NOW(), 1, 0), IF(priority IS NULL, CONCAT(ord_date, ' 23:59:59'), priority), hold_until_date, id ) AS d ";