cambio stato agli interventi solo se sto fatturando il preventivo

This commit is contained in:
Beppe 2021-11-10 11:03:58 +01:00
parent 25cfa23ebc
commit f02d44ce76
1 changed files with 9 additions and 6 deletions

View File

@ -277,6 +277,8 @@ class Preventivo extends Document
$this->stato()->associate($stato);
$this->save();
//cambio stato agli interventi solo se sto fatturando il preventivo
if ($trigger->getDocument() instanceof Fattura){
// Trasferimento degli interventi collegati
$interventi = $this->interventi;
$stato_intervento = \Modules\Interventi\Stato::where('codice', $codice_intervento)->first();
@ -285,6 +287,7 @@ class Preventivo extends Document
$intervento->save();
}
}
}
// Metodi statici