Display different color on order detail for sold out item.
authorMaxime Bourget <bmx007@gmail.com>
Sat, 15 Jun 2013 20:26:14 +0000 (21:26 +0100)
committerMaxime Bourget <bmx007@gmail.com>
Sat, 15 Jun 2013 20:26:14 +0000 (21:26 +0100)
includes/order_lines.inc
order_lines_view.php

index a3367ea340b7732b1f4d464e5e7e699eacd739e7..f66d3baa0877ac8e153c1219a4f61e1c10a852a7 100644 (file)
@@ -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
index 7a74825f11cb2c342c9d64cc67099064e67e3bac..4813560dd795b70b0fc8e3032bd627b3947e18ef 100644 (file)
@@ -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' => '')