Fix cambio stato intervento in fase di eliminazione riga da fattura

This commit is contained in:
MatteoPistorello 2021-10-08 10:00:36 +02:00
parent dfbed77adc
commit e1e0369f4b
1 changed files with 1 additions and 1 deletions

View File

@ -182,7 +182,7 @@ trait RelationTrait
{
$result = parent::delete();
if (!empty($this->idintervento)) {
if (!empty($this->idintervento) && $this->fattura->getRighe()->where('idintervento', $this->idintervento)->count()==1) {
database()->query("UPDATE in_interventi SET idstatointervento = (SELECT idstatointervento FROM in_statiintervento WHERE codice = 'OK') WHERE id=".prepare($this->idintervento));
}