This commit is contained in:
77
api/app/Models/Almoxarifado/Saida.php
Normal file
77
api/app/Models/Almoxarifado/Saida.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Almoxarifado;
|
||||
|
||||
use App\Models\Cadastro\Estabelecimento\CentroCusto;
|
||||
use App\Models\Model;
|
||||
|
||||
class Saida extends Model
|
||||
{
|
||||
protected $table = 'almoxarifado_saida';
|
||||
|
||||
protected $casts = [
|
||||
'finalizada' => 'boolean',
|
||||
'finalizada_em' => 'datetime:d/m/Y',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'centro_custo_id',
|
||||
'tipo_id',
|
||||
'finalizada',
|
||||
'finalizada_em',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
protected $with = [
|
||||
'requisicao',
|
||||
'baixa',
|
||||
];
|
||||
|
||||
public function centroCusto()
|
||||
{
|
||||
return $this->belongsTo(CentroCusto::class);
|
||||
}
|
||||
|
||||
public function tipo()
|
||||
{
|
||||
return $this->belongsTo(SaidaTipo::class);
|
||||
}
|
||||
|
||||
public function requisicao()
|
||||
{
|
||||
return $this->hasOne(SaidaRequisicao::class);
|
||||
}
|
||||
|
||||
public function transferencia()
|
||||
{
|
||||
return $this->hasOne(SaidaTransferencia::class);
|
||||
}
|
||||
|
||||
public function baixa()
|
||||
{
|
||||
return $this->hasOne(SaidaBaixa::class);
|
||||
}
|
||||
|
||||
public function itens()
|
||||
{
|
||||
return $this->hasMany(SaidaItem::class);
|
||||
}
|
||||
|
||||
public function requisicaoResposta()
|
||||
{
|
||||
return $this->hasOne(RequisicaoResposta::class);
|
||||
}
|
||||
|
||||
public function itensRecusadosTransferencia()
|
||||
{
|
||||
return $this->hasMany(SaidaItemRecusadoTransferencia::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user