Files
rkm-conectasus-ci-sandbox/api/app/Models/WebService/Almoxarifado/Cliente/EntradaItem.php
Antonio Lopes dos Santos afec302c3e
All checks were successful
build-api-image / build (push) Successful in 51s
init commit
2026-08-04 16:52:02 -03:00

58 lines
1.2 KiB
PHP

<?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);
}
}