Fix tipo Intervento duplicato

This commit is contained in:
Dasc3er 2021-07-15 18:14:17 +02:00
parent 06d2fb9342
commit 0b14b88e69
2 changed files with 1 additions and 42 deletions

View File

@ -58,7 +58,7 @@ class Intervento extends Document
$model->anagrafica()->associate($anagrafica);
$model->stato()->associate($stato);
$model->tipoSessione()->associate($tipo_sessione);
$model->tipo()->associate($tipo_sessione);
$model->codice = static::getNextCodice($data_richiesta);
$model->data_richiesta = $data_richiesta;
@ -157,11 +157,6 @@ class Intervento extends Document
}
public function tipo()
{
return $this->belongsTo(Tipo::class, 'idtipointervento');
}
public function tipoSessione()
{
return $this->belongsTo(TipoSessione::class, 'idtipointervento');
}

View File

@ -1,36 +0,0 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.r.l.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace Modules\Interventi;
use Common\SimpleModelTrait;
use Illuminate\Database\Eloquent\Model;
class Tipo extends Model
{
use SimpleModelTrait;
protected $primaryKey = 'idtipointervento';
protected $table = 'in_tipiintervento';
public function interventi()
{
return $this->hasMany(Intervento::class, 'idtipointervento');
}
}