diff --git a/assets/src/js/functions/select.js b/assets/src/js/functions/select.js index cf369ea4e..7be6e6ae0 100755 --- a/assets/src/js/functions/select.js +++ b/assets/src/js/functions/select.js @@ -69,7 +69,7 @@ function start_superselect() { let results = data.results; // Interpretazione forzata per campi optgroup - if (results[0]['optgroup']) { + if (results && results[0] && [0]['optgroup']) { let groups = results.reduce(function (r, a) { r[a.optgroup] = r[a.optgroup] || []; r[a.optgroup].push(a); diff --git a/include/common/importa.php b/include/common/importa.php index 20c3c787c..4b848b476 100755 --- a/include/common/importa.php +++ b/include/common/importa.php @@ -24,14 +24,14 @@ if (empty($documento) || (!empty($documento_finale) && $documento_finale->direzi return; } -// Informazioi utili +// Informazioni utili $dir = $documento->direzione; $original_module = Modules::get($documento->module); $name = !empty($documento_finale) ? $documento_finale->module : $options['module']; $final_module = Modules::get($name); -// IVA predefinta +// IVA predefinita $id_iva = $id_iva ?: setting('Iva predefinita'); $righe = $documento->getRighe()->where('qta_rimanente', '>', 0); @@ -45,7 +45,6 @@ if (empty($righe)) { $link = !empty($documento_finale) ? ROOTDIR.'/editor.php?id_module='.$final_module['id'].'&id_record='.$documento_finale->id : ROOTDIR.'/controller.php?id_module='.$final_module['id']; echo ' -