NEW Beautify the select of warehouses

This commit is contained in:
Laurent Destailleur 2019-10-24 19:34:28 +02:00
parent b4eb14ee44
commit 31452dad42

View File

@ -455,12 +455,20 @@ class FormProduct
{
if (empty($fk_entrepot) || $fk_entrepot == $arraytypes['entrepot_id'])
{
$label=$arraytypes['entrepot_label'].' - ';
$label.=$arraytypes['batch'];
if ($arraytypes['qty'] <= 0) {
$label.=' <span class=\'text-warning\'>('.$langs->trans("Stock").' '.$arraytypes['qty'].')</span>';
}
else {
$label.=' <span class=\'opacitymedium\'>('.$langs->trans("Stock").' '.$arraytypes['qty'].')</span>';
}
$out.='<option value="'.$id.'"';
if ($selected == $id || ($selected == 'ifone' && $nboflot == 1)) $out.=' selected';
$out.=' data-html="'.$label.'"';
$out.='>';
$out.=$arraytypes['entrepot_label'].' - ';
$out.=$arraytypes['batch'];
$out.=' ('.$langs->trans("Stock").':'.$arraytypes['qty'].')';
$out.=$label;
$out.='</option>';
}
}