Fix 0 quantity not displayed master
authorMaxime Bourget <bmx007@gmail.com>
Sun, 14 Jul 2013 09:41:02 +0000 (10:41 +0100)
committerMaxime Bourget <bmx007@gmail.com>
Sun, 14 Jul 2013 09:41:02 +0000 (10:41 +0100)
haxe/ItemScheduler.hx
hincludes/lib/ItemScheduler.class.php
item_schedule.php

index 7b988f2a8b9329ebd8269f34380f7039633e6a02..e8156c8f18906d106775fdb817f6fde393f26063 100644 (file)
@@ -303,7 +303,7 @@ class ItemScheduler {
                        ,location.name
                        ,location.quantityOnHand(stock_id, null)
                        ,left-location.quantityOnHand(stock_id, null)
-                       ,left
+                       , "<span>"+left+"</span>" // only to force null or 0 to be displayed
                        ,location.code
                        ,location.delivery.getTime() == 0 ? '' : location.delivery.format("%F")
                        ,""
index 530224eded2b6a7b693da6cdf979fe3ffa50c973..f7f7371fd26093a2686755056ccf1e18bac65f93 100644 (file)
@@ -123,7 +123,7 @@ class ItemScheduler {
                return FA::query($sql);
        }
        public function formatLocation($location, $type, $left) {
-               $cells = new _hx_array(array($type, $location->name, $location->quantityOnHand($this->stock_id, null), $left - $location->quantityOnHand($this->stock_id, null), $left, $location->code, ((_hx_equal($location->delivery->getTime(), 0)) ? "" : DateTools::format($location->delivery, "%F")), "", "", ""));
+               $cells = new _hx_array(array($type, $location->name, $location->quantityOnHand($this->stock_id, null), $left - $location->quantityOnHand($this->stock_id, null), "<span>" . _hx_string_rec($left, "") . "</span>", $location->code, ((_hx_equal($location->delivery->getTime(), 0)) ? "" : DateTools::format($location->delivery, "%F")), "", "", ""));
                $this->printRow($cells, new _hx_array(array("class = \"tableheader location\"", "id = \"loc_" . $location->code . "\"")));
        }
        public function quantity_box($row_id, $order, $left) {
index 4449d16ab0974091b800c0527916e6d1fc420efc..5e893b9894ab1bfd6b453435a4652e0e6ed40d88 100644 (file)
@@ -60,9 +60,9 @@ if (list_updated('stock_id') || in_ajax()) $Ajax->activate('item_schedule') ;
 
 
 
+       stock_costable_items_list_cells(_("Item:"), 'stock_id', $_POST['stock_id']);
+// Needs to be done afterward  as it can modify the post variable
 $stock_id = $_POST['stock_id'];
-       stock_costable_items_list_cells(_("Item:"), 'stock_id', $stock_id);
-
 
 end_row();
 end_table(1);