diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index eb8b824ef3e..2211422f3c5 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -9,7 +9,7 @@ * Copyright (C) 2015-2018 Frédéric France * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2016-2021 Ferran Marcet + * Copyright (C) 2016-2023 Ferran Marcet * Copyright (C) 2018 Charlene Benke * Copyright (C) 2021 Anthony Berton * @@ -403,7 +403,7 @@ if (empty($reshook)) { $desc = dol_concatdesc($desc, $langs->trans("Order").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day')); } - if ($lines[$i]->subprice < 0) { + if ($lines[$i]->subprice < 0 && empty($conf->global->INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN)) { // Negative line, we create a discount line $discount = new DiscountAbsolute($db); $discount->fk_soc = $objecttmp->socid; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 1d5bd8dc7ef..6644548d87c 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1457,15 +1457,15 @@ class ExtraFields $labeltoshow = dol_trunc($labeltoshow, 45); if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) { + $labeltoshow = ''; foreach ($fields_label as $field_toshow) { $translabel = $langs->trans($obj->$field_toshow); if ($translabel != $obj->$field_toshow) { - $labeltoshow = dol_trunc($translabel, 18).' '; + $labeltoshow .= ' '.dol_trunc($translabel, 18).' '; } else { - $labeltoshow = dol_trunc($obj->$field_toshow, 18).' '; + $labeltoshow .= ' '.dol_trunc($obj->$field_toshow, 18).' '; } } - $data[$obj->rowid] = $labeltoshow; } else { if (!$notrans) { @@ -1774,17 +1774,20 @@ class ExtraFields $fields_label = explode('|', $InfoFieldList[1]); if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) { if (is_array($fields_label) && count($fields_label) > 1) { + $label = '
  • '; foreach ($fields_label as $field_toshow) { $translabel = ''; if (!empty($obj->$field_toshow)) { $translabel = $langs->trans($obj->$field_toshow); } if ($translabel != $field_toshow) { - $toprint[] = '
  • '.dol_trunc($translabel, 18).'
  • '; + $label .= ' '.dol_trunc($translabel, 18); } else { - $toprint[] = '
  • '.$obj->$field_toshow.'
  • '; + $label .= ' '.$obj->$field_toshow; } } + $label .= ''; + $toprint[] = $label; } else { $translabel = ''; if (!empty($obj->{$InfoFieldList[1]})) {