diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 9211cddf045e4..07db31d2e499b 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -2272,7 +2272,7 @@
if (empty($typenArray)) {
$typenArray = $formcompany->typent_array(1);
}
- print $typenArray[$obj->typent_code];
+ print $typenArray[$obj->typent_code]??'';
print '';
if (!$i) {
$totalarray['nbfield']++;
@@ -2516,6 +2516,7 @@
// Total margin
if (!empty($arrayfields['total_margin']['checked'])) {
+
print '
'.price($marginInfo['total_margin']).' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -2523,6 +2524,12 @@
if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = 'total_margin';
}
+
+
+ if(!isset($totalarray['val']['total_margin'])){
+ $totalarray['val']['total_margin'] = 0;
+ }
+
$totalarray['val']['total_margin'] += $marginInfo['total_margin'];
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 762416d2ad8fd..3e2375b9078a4 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -8145,7 +8145,7 @@ public function selectForForms($objectdesc, $htmlname, $preSelectedValue, $showe
$oldValueForShowOnCombobox = 0;
foreach ($objecttmp->fields as $fieldK => $fielV) {
- if (!$fielV['showoncombobox'] || empty($objecttmp->$fieldK)) continue;
+ if (!array_key_exists('showoncombobox', $fielV) || !$fielV['showoncombobox'] || empty($objecttmp->$fieldK)) continue;
if (!$oldValueForShowOnCombobox) {
$selected_input_value = '';