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:
parent
a5d6b3e4ac
commit
30906992c8
29
modules/interventi/src/Components/Descrizione.php
Normal file
29
modules/interventi/src/Components/Descrizione.php
Normal 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';
|
||||
}
|
@ -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()
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user