diff --git a/plugins/importFE/actions.php b/plugins/importFE/actions.php index 57a00cfcf..bcc75a4da 100755 --- a/plugins/importFE/actions.php +++ b/plugins/importFE/actions.php @@ -192,6 +192,7 @@ switch (filter('op')) { break; case 'compile': + // Gestione del caso di anagrafica inesistente if (empty($anagrafica)) { echo json_encode([]); @@ -211,6 +212,13 @@ switch (filter('op')) { } $righe = $righe->flatten(); + // Gestione del caso di anagrafica senza fatture o con fatture senza righe + if ($fatture->isEmpty() || $righe->isEmpty()) { + echo json_encode([]); + + return; + } + // Ricerca del tipo di documento piĆ¹ utilizzato $tipi = $fatture->groupBy(function ($item, $key) { return $item->tipo->id;