From ac926e0cd9000e2523c5c88674345d73c8ae388e Mon Sep 17 00:00:00 2001 From: Maxime Bourget Date: Sat, 15 Jun 2013 21:26:14 +0100 Subject: [PATCH] Display different color on order detail for sold out item. --- includes/order_lines.inc | 5 +++-- order_lines_view.php | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/order_lines.inc b/includes/order_lines.inc index a3367ea..f66d3ba 100644 --- a/includes/order_lines.inc +++ b/includes/order_lines.inc @@ -171,7 +171,7 @@ function aggregate_comment($row) { function available_quantity($row, $available) { $quantity = $row['quantity']; $class = ''; - if($available== 0) $class = 'limited'; + if($available== 0) $class = $row['qoh'] == 0 ? 'stockmankobg' : 'limited'; else if($quantity > $available) $class = 'partial'; else if(OrderXtraConfig::early(sql2date($row['hold_until_date']))) $class = 'early'; @@ -240,8 +240,9 @@ function get_order_details_extra($customer_id, $location, $item_like, $order_id) , so.order_no , stk_code , sod.quantity - qty_sent quantity - , GREATEST(0, LEAST(qoh.quantity - quantity_before, sod.quantity - qty_sent)) + , GREATEST(0, LEAST(qoh.quantity - quantity_before, sod.quantity - qty_sent)) AS available , quantity_before + , qoh.quantity AS qoh , p.quantity AS quantity_to_pick , sod.`priority` , hold_until_date diff --git a/order_lines_view.php b/order_lines_view.php index 7a74825..4813560 100644 --- a/order_lines_view.php +++ b/order_lines_view.php @@ -125,6 +125,7 @@ if($customer_id) { ,_("Quantity") => array('type' => 'qty', 'dec' => 0) ,_("Available") => array('fun' => 'available_quantity', 'dec' => 0, 'ord' => '') ,_("Before") => 'skip' + ,_("QOH") => 'skip' ,_("To Pick") => array('type' => 'qty', 'ord' => '', 'dec' => 0) ,_("Priority") => array('type' => 'time', 'ord' => '') ,_("Hold Until") => array('fun' => 'input_hold_until_date_details', 'ord' => '') -- 2.30.2