From 9795886369d6d2cc9c6fbb77286cb9d07c2435f1 Mon Sep 17 00:00:00 2001 From: loviuz Date: Fri, 10 Mar 2023 19:29:49 +0100 Subject: [PATCH] Miglioramento riferimenti in import FE --- plugins/importFE/actions.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/plugins/importFE/actions.php b/plugins/importFE/actions.php index a0fbf9c11..73c8ac27e 100755 --- a/plugins/importFE/actions.php +++ b/plugins/importFE/actions.php @@ -353,10 +353,13 @@ switch (filter('op')) { break; } } - $dati_ddt[(int)$linea] = [ - 'numero' => $dato['NumeroDDT'], - 'anno' => ( new Carbon($dato['DataDDT']) )->format('Y'), - ]; + + if (!empty($dato['DataDDT'])) { + $dati_ddt[(int)$linea] = [ + 'numero' => $dato['NumeroDDT'], + 'anno' => ( new Carbon($dato['DataDDT']) )->format('Y'), + ]; + } } } else { foreach ($replaces as $replace) { @@ -365,10 +368,12 @@ switch (filter('op')) { break; } } - $dati_ddt[(int)$dato['RiferimentoNumeroLinea']] = [ - 'numero' => $dato['NumeroDDT'], - 'anno' => ( new Carbon($dato['DataDDT']) )->format('Y'), - ]; + if (!empty($dato['DataDDT'])) { + $dati_ddt[(int)$dato['RiferimentoNumeroLinea']] = [ + 'numero' => $dato['NumeroDDT'], + 'anno' => ( new Carbon($dato['DataDDT']) )->format('Y'), + ]; + } } }