This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\WebService\Almoxarifado\Cliente;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class EntradaItem extends Model
|
||||
{
|
||||
protected $table = 'web_service_almoxarifado_cliente_entrada_item';
|
||||
|
||||
protected $casts = [
|
||||
'validade_lote' => 'datetime:Y-m-d',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'entrada_id',
|
||||
'material_id',
|
||||
'fabricante_id',
|
||||
'lote',
|
||||
'validade_lote',
|
||||
'quantidade',
|
||||
'valor_unitario',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'id',
|
||||
'entrada_id',
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
'externo_created_usuario_id',
|
||||
'externo_updated_usuario_id',
|
||||
];
|
||||
|
||||
public function getValorUnitarioFormattedAttribute()
|
||||
{
|
||||
return number_format($this->valor_unitario, 6, ',', '.');
|
||||
}
|
||||
|
||||
public function entrada()
|
||||
{
|
||||
return $this->belongsTo(Entrada::class);
|
||||
}
|
||||
|
||||
public function material()
|
||||
{
|
||||
return $this->belongsTo(Material::class);
|
||||
}
|
||||
|
||||
public function fabricante()
|
||||
{
|
||||
return $this->belongsTo(Fabricante::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user