Fix no tooltip of not predefined products

This commit is contained in:
Laurent Destailleur 2020-04-20 13:26:06 +02:00
parent b92c03cdf6
commit c7fab6a83e

View File

@ -944,6 +944,7 @@ if ($placeid > 0)
if (is_array($invoice->lines) && count($invoice->lines)) if (is_array($invoice->lines) && count($invoice->lines))
{ {
print '<!-- Show lines of invoices -->'."\n";
$tmplines = array_reverse($invoice->lines); $tmplines = array_reverse($invoice->lines);
foreach ($tmplines as $line) foreach ($tmplines as $line)
{ {
@ -993,11 +994,14 @@ if ($placeid > 0)
else $htmlforlines .= img_object('', 'service').' '; else $htmlforlines .= img_object('', 'service').' ';
} }
if (empty($conf->global->TAKEPOS_SHOW_N_FIRST_LINES)) { if (empty($conf->global->TAKEPOS_SHOW_N_FIRST_LINES)) {
$tooltiptext = '<b>'.$langs->trans("Ref").'</b> : '.$line->product_ref.'<br>'; $tooltiptext = '';
$tooltiptext .= '<b>'.$langs->trans("Label").'</b> : '.$line->product_label.'<br>'; if ($line->product_ref) {
if ($line->product_label != $line->desc) { $tooltiptext .= '<b>'.$langs->trans("Ref").'</b> : '.$line->product_ref.'<br>';
if ($line->desc) $tooltiptext .= '<br>'; $tooltiptext .= '<b>'.$langs->trans("Label").'</b> : '.$line->product_label.'<br>';
$tooltiptext .= $line->desc; if ($line->product_label != $line->desc) {
if ($line->desc) $tooltiptext .= '<br>';
$tooltiptext .= $line->desc;
}
} }
$htmlforlines .= $form->textwithpicto($line->product_label ? $line->product_label : ($line->product_ref ? $line->product_ref : dolGetFirstLineOfText($line->desc, 1)), $tooltiptext); $htmlforlines .= $form->textwithpicto($line->product_label ? $line->product_label : ($line->product_ref ? $line->product_ref : dolGetFirstLineOfText($line->desc, 1)), $tooltiptext);
} else { } else {