From 0b14b88e69dd69274cc287b837dc6e32c864b8fb Mon Sep 17 00:00:00 2001 From: Dasc3er <Dasc3er@users.noreply.github.com> Date: Thu, 15 Jul 2021 18:14:17 +0200 Subject: [PATCH] Fix tipo Intervento duplicato --- modules/interventi/src/Intervento.php | 7 +----- modules/interventi/src/Tipo.php | 36 --------------------------- 2 files changed, 1 insertion(+), 42 deletions(-) delete mode 100755 modules/interventi/src/Tipo.php diff --git a/modules/interventi/src/Intervento.php b/modules/interventi/src/Intervento.php index 219f2a534..247a96926 100755 --- a/modules/interventi/src/Intervento.php +++ b/modules/interventi/src/Intervento.php @@ -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'); } diff --git a/modules/interventi/src/Tipo.php b/modules/interventi/src/Tipo.php deleted file mode 100755 index b45766bc4..000000000 --- a/modules/interventi/src/Tipo.php +++ /dev/null @@ -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'); - } -}