Forzatura dello stato ad Emessa per FE con notifica ricevuta in Bozza
This commit is contained in:
parent
fa89698032
commit
c21cc2514e
|
@ -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') {
|
||||
|
|
Loading…
Reference in New Issue