From 443ca85f436cdc0c639a52d665d31a84a79f4067 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 24 Oct 2019 19:48:25 +0200 Subject: [PATCH] NEW Beautify the select of warehouses --- .../product/class/html.formproduct.class.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 87748643c04..f93a1ef1758 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -258,12 +258,25 @@ class FormProduct if ($empty) $out.=''; foreach($this->cache_warehouses as $id => $arraytypes) { + $label=''; + if ($showfullpath) $label.=$arraytypes['full_label']; + else $label.=$arraytypes['label']; + if (($fk_product || ($showstock > 0)) && ($arraytypes['stock'] != 0 || ($showstock > 0))) + { + if ($arraytypes['stock'] <= 0) { + $label.=' ('.$langs->trans("Stock").':'.$arraytypes['stock'].')'; + } + else + { + $label.=' ('.$langs->trans("Stock").':'.$arraytypes['stock'].')'; + } + } + $out.=''; } $out.='';