Bug 5466: user qty decimals handled incorrectly by code that calls get_item_edit_info...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 26 Jun 2021 19:19:26 +0000 (21:19 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 26 Jun 2021 19:19:26 +0000 (21:19 +0200)
includes/db/inventory_db.inc

index 52c016746e570cc741e1c645e1f71fd73a22a7e7..4ffda2e7abe2a1ff0497b71d7b2c691ab7e63766 100644 (file)
@@ -93,7 +93,10 @@ function get_item_edit_info($stock_id)
                ." AND item.units=unit.abbr";
        $result = db_query($sql, "The standard cost cannot be retrieved");
 
-       return db_fetch($result);
+       $row = db_fetch($result);
+       if ($row['decimals'] == -1)
+               $row['decimals'] = user_qty_dec();
+       return $row;
 }
 
 //--------------------------------------------------------------------------------------