50 lines
1.2 KiB
PHP
Executable File
50 lines
1.2 KiB
PHP
Executable File
<?php
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class StabileServizioTariffa extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'stabile_servizio_tariffe';
|
|
|
|
protected $fillable = [
|
|
'stabile_id',
|
|
'stabile_servizio_id',
|
|
'fattura_elettronica_id',
|
|
'fornitore_id',
|
|
'data_fattura',
|
|
'decorrenza_tariffe',
|
|
'profilo_tariffario',
|
|
'delibera_ato',
|
|
'delibera_arera',
|
|
'codice_iva',
|
|
'aliquota_iva_percentuale',
|
|
'iva_descrizione',
|
|
'tariffe_scaglioni',
|
|
'tariffe_componenti',
|
|
'payload',
|
|
];
|
|
|
|
protected $casts = [
|
|
'data_fattura' => 'date',
|
|
'decorrenza_tariffe' => 'date',
|
|
'aliquota_iva_percentuale' => 'decimal:2',
|
|
'tariffe_scaglioni' => 'array',
|
|
'tariffe_componenti' => 'array',
|
|
'payload' => 'array',
|
|
];
|
|
|
|
public function fatturaElettronica()
|
|
{
|
|
return $this->belongsTo(FatturaElettronica::class, 'fattura_elettronica_id');
|
|
}
|
|
|
|
public function stabileServizio()
|
|
{
|
|
return $this->belongsTo(StabileServizio::class, 'stabile_servizio_id');
|
|
}
|
|
}
|