mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
cambio stato agli interventi solo se sto fatturando il preventivo
This commit is contained in:
@@ -277,12 +277,15 @@ class Preventivo extends Document
|
|||||||
$this->stato()->associate($stato);
|
$this->stato()->associate($stato);
|
||||||
$this->save();
|
$this->save();
|
||||||
|
|
||||||
// Trasferimento degli interventi collegati
|
//cambio stato agli interventi solo se sto fatturando il preventivo
|
||||||
$interventi = $this->interventi;
|
if ($trigger->getDocument() instanceof Fattura){
|
||||||
$stato_intervento = \Modules\Interventi\Stato::where('codice', $codice_intervento)->first();
|
// Trasferimento degli interventi collegati
|
||||||
foreach ($interventi as $intervento) {
|
$interventi = $this->interventi;
|
||||||
$intervento->stato()->associate($stato_intervento);
|
$stato_intervento = \Modules\Interventi\Stato::where('codice', $codice_intervento)->first();
|
||||||
$intervento->save();
|
foreach ($interventi as $intervento) {
|
||||||
|
$intervento->stato()->associate($stato_intervento);
|
||||||
|
$intervento->save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user