1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-16 19:40:44 +01:00

Aggiunta gestione Descrizioni in Interventi

This commit is contained in:
Dasc3er 2021-08-30 14:28:16 +02:00
parent a5d6b3e4ac
commit 30906992c8
3 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,29 @@
<?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\Components;
use Common\Components\Description;
class Descrizione extends Description
{
use RelationTrait;
protected $table = 'in_righe_interventi';
}

View File

@ -178,7 +178,7 @@ class Intervento extends Document
public function descrizioni()
{
return $this->righe()->where('is_descrizione', 1);
return $this->hasMany(Components\Descrizione::class, 'idintervento');
}
public function sessioni()

View File

@ -25,6 +25,7 @@ use Auth;
use Carbon\Carbon;
use Modules\Articoli\Articolo as ArticoloOriginale;
use Modules\Interventi\Components\Articolo;
use Modules\Interventi\Components\Descrizione;
use Modules\Interventi\Components\Riga;
use Modules\Interventi\Components\Sconto;
use Modules\Interventi\Intervento;
@ -201,6 +202,8 @@ class RigheInterventi extends AppResource
{
if (!empty($data['is_sconto'])) {
$type = Sconto::class;
} elseif (!empty($data['is_descrizione'])) {
$type = Descrizione::class;
} elseif (!empty($data['is_articolo'])) {
$type = Articolo::class;
} else {