diff --git a/modules/fatture/controller_before.php b/modules/fatture/controller_before.php index 6241a8f26..3b392d58c 100644 --- a/modules/fatture/controller_before.php +++ b/modules/fatture/controller_before.php @@ -1,5 +1,4 @@ getTranslation('title') == 'Fatture di vendita' && $services_enable $documenti = Fattura::where('data', '>', $data_limite)->where('data', '>', $data_setting)->whereIn('codice_stato_fe', ['EC02', 'ERR', 'ERVAL', 'NS', 'GEN', 'QUEUE'])->get(); foreach ($documenti as $documento) { - $stato_fe = StatoFE::find($documento->codice_stato_fe)->id_record; - + $stato_fe = StatoFE::find($documento->codice_stato_fe); if (in_array($documento->codice_stato_fe, $codici_scarto)) { // In caso di NS verifico che non sia semplicemente un codice 00404 (Fattura duplicata) if ($documento->codice_stato_fe == 'NS' && ($documento->stato != Stato::where('name', 'Bozza')->first()->id) && ($documento->stato != Stato::where('name', 'Non valida')->first()->id)) { @@ -69,10 +67,10 @@ if ($module->getTranslation('title') == 'Fatture di vendita' && $services_enable } } $documenti_scarto[] = Modules::link('Fatture di vendita', $documento->id, tr('_ICON_ Fattura numero _NUM_ del _DATE_ : _STATO_', [ - '_ICON_' => '', + '_ICON_' => '', '_NUM_' => $documento->numero_esterno, '_DATE_' => dateFormat($documento->data), - '_STATO_' => $stato_fe['descrizione'], + '_STATO_' => $stato_fe->name, ])); $show_avviso = $show_avviso ?: ($documento->data_stato_fe < (new Carbon())->subDays(4) ? 1 : 0); @@ -85,10 +83,10 @@ if ($module->getTranslation('title') == 'Fatture di vendita' && $services_enable if ($documento->data <= $data_limite_invio && !$is_estera) { $documenti_invio[] = Modules::link('Fatture di vendita', $documento->id, tr('_ICON_ Fattura numero _NUM_ del _DATE_ : _STATO_ _ANTICIPATA_', [ - '_ICON_' => '', + '_ICON_' => '', '_NUM_' => $documento->numero_esterno, '_DATE_' => dateFormat($documento->data), - '_STATO_' => $stato_fe['descrizione'], + '_STATO_' => $stato_fe->name, '_ANTICIPATA_' => (($documento->data->diffInDays($data_limite_invio) < 10) ? '(Anticipata)' : ''), ])); } diff --git a/modules/fatture/init.php b/modules/fatture/init.php index dd5237ddd..273d37c3d 100755 --- a/modules/fatture/init.php +++ b/modules/fatture/init.php @@ -73,7 +73,7 @@ if (!empty($id_record)) { // Blocco gestito dallo stato della Fattura Elettronica $stato_fe = StatoFE::find($fattura->codice_stato_fe); - $abilita_genera = empty($fattura->codice_stato_fe) || intval($stato_fe['is_generabile']); + $abilita_genera = empty($fattura->codice_stato_fe) || intval($stato_fe->is_generabile); // Controllo autofattura e gestione avvisi $reverse_charge = null; diff --git a/plugins/exportFE/edit.php b/plugins/exportFE/edit.php index 9ed1b4953..ee13c9e60 100755 --- a/plugins/exportFE/edit.php +++ b/plugins/exportFE/edit.php @@ -95,7 +95,7 @@ if ($fattura !== null) { '; // Scelgo quando posso inviarla - $inviabile = Interaction::isEnabled() && $generata && intval($stato_fe['is_inviabile']); + $inviabile = Interaction::isEnabled() && $generata && intval($stato_fe->is_inviabile); echo ' @@ -126,7 +126,7 @@ if ($fattura !== null) { // Messaggio informativo sulla ricevuta principale impostata if (!empty($ricevuta_principale)) { echo ' -
+
'.timestampFormat($record['data_stato_fe']); @@ -141,8 +141,8 @@ if ($fattura !== null) {
- - '.$stato_fe['codice'].' - '.$stato_fe['descrizione'].' + + '.$stato_fe->codice.' - '.$stato_fe->name.' '; if (!empty($record['descrizione_ricevuta_fe'])) {