Forzatura dello stato ad Emessa per FE con notifica ricevuta in Bozza

This commit is contained in:
Dasc3er 2020-10-16 18:24:54 +02:00
parent fa89698032
commit c21cc2514e
1 changed files with 10 additions and 0 deletions

View File

@ -21,6 +21,7 @@ namespace Plugins\ReceiptFE;
use Models\Upload;
use Modules\Fatture\Fattura;
use Modules\Fatture\Stato;
use Plugins;
use UnexpectedValueException;
use Util\XML;
@ -224,6 +225,15 @@ class Ricevuta
$upload = $this->saveAllegato($codice_nome);
// Correzione eventuale per lo stato della fattura in Bozza
$fattura = $this->getFattura();
if ($fattura->stato->descrizione == 'Bozza') {
$stato_emessa = Stato::where('descrizione', 'Emessa')->first();
$fattura->stato()->associate($stato_emessa);
$fattura->save();
}
// Controllo per il cambio di stato FE
if ($cambia_stato) {
// In caso di Notifica Esito il codice è definito dal nodo <Esito> della ricevuta
if ($codice_stato == 'NE') {