1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-03-18 12:10:17 +01:00

fix: riferimenti ricevute FE

This commit is contained in:
valentina 2024-12-09 16:19:26 +01:00
parent a3b9457be8
commit 1b965e52f2
3 changed files with 10 additions and 12 deletions

View File

@ -1,5 +1,4 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.r.l.
@ -49,8 +48,7 @@ if ($module->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_ : <b>_STATO_</b>', [
'_ICON_' => '<i class="'.$stato_fe['icon'].'"></i>',
'_ICON_' => '<i class="'.$stato_fe->icon.'"></i>',
'_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_ : <b>_STATO_</b> _ANTICIPATA_', [
'_ICON_' => '<i class="'.$stato_fe['icon'].'"></i>',
'_ICON_' => '<i class="'.$stato_fe->icon.'"></i>',
'_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)' : ''),
]));
}

View File

@ -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;

View File

@ -95,7 +95,7 @@ if ($fattura !== null) {
</a>';
// Scelgo quando posso inviarla
$inviabile = Interaction::isEnabled() && $generata && intval($stato_fe['is_inviabile']);
$inviabile = Interaction::isEnabled() && $generata && intval($stato_fe->is_inviabile);
echo '
<i class="fa fa-arrow-right fa-fw text-muted"></i>
@ -126,7 +126,7 @@ if ($fattura !== null) {
// Messaggio informativo sulla ricevuta principale impostata
if (!empty($ricevuta_principale)) {
echo '
<div class="alert alert-'.$stato_fe['tipo'].'">
<div class="alert alert-'.$stato_fe->tipo.'">
<div class="float-right d-none d-sm-inline">
<i class="fa fa-clock-o tip" title="'.tr('Data e ora').'"></i> '.timestampFormat($record['data_stato_fe']);
@ -141,8 +141,8 @@ if ($fattura !== null) {
</div>
<big>
<i class="'.$stato_fe['icon'].'" style="color:#fff;"></i>
<b>'.$stato_fe['codice'].'</b> - '.$stato_fe['descrizione'].'
<i class="'.$stato_fe->icon.'" style="color:#fff;"></i>
<b>'.$stato_fe->codice.'</b> - '.$stato_fe->name.'
</big>';
if (!empty($record['descrizione_ricevuta_fe'])) {