This commit is contained in:
69
api/app/Models/WebService/Almoxarifado/Cliente/Entrada.php
Normal file
69
api/app/Models/WebService/Almoxarifado/Cliente/Entrada.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\WebService\Almoxarifado\Cliente;
|
||||
|
||||
use App\Models\Almoxarifado\Entrada as AlmoxarifadoEntrada;
|
||||
use App\Models\Model;
|
||||
|
||||
class Entrada extends Model
|
||||
{
|
||||
protected $table = 'web_service_almoxarifado_cliente_entrada';
|
||||
|
||||
protected $casts = [
|
||||
'data_documento' => 'datetime:Y-m-d',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'conectasus_entrada_id',
|
||||
'unidade_id',
|
||||
'fornecedor_id',
|
||||
'codigo_nota',
|
||||
'documento_tipo_id',
|
||||
'data_documento',
|
||||
'numero_documento',
|
||||
'numero_pedido',
|
||||
'status_id',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'conectasus_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 conectasusEntrada()
|
||||
{
|
||||
return $this->belongsTo(AlmoxarifadoEntrada::class);
|
||||
}
|
||||
|
||||
public function unidade()
|
||||
{
|
||||
return $this->belongsTo(Unidade::class);
|
||||
}
|
||||
|
||||
public function fornecedor()
|
||||
{
|
||||
return $this->belongsTo(Fornecedor::class);
|
||||
}
|
||||
|
||||
public function documentoTipo()
|
||||
{
|
||||
return $this->belongsTo(EntradaDocumentoTipo::class);
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->belongsTo(EntradaStatus::class);
|
||||
}
|
||||
|
||||
public function itens()
|
||||
{
|
||||
return $this->hasMany(EntradaItem::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\WebService\Almoxarifado\Cliente;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class EntradaDocumentoTipo extends Model
|
||||
{
|
||||
protected $table = 'web_service_almoxarifado_cliente_entrada_documento_tipo';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'nome',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\WebService\Almoxarifado\Cliente;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class EntradaStatus extends Model
|
||||
{
|
||||
protected $table = 'web_service_almoxarifado_cliente_entrada_status';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'nome',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\WebService\Almoxarifado\Cliente;
|
||||
|
||||
use App\Models\Cadastro\Fabricante\Fabricante as CadastroFabricante;
|
||||
use App\Models\Model;
|
||||
|
||||
class Fabricante extends Model
|
||||
{
|
||||
protected $table = 'web_service_almoxarifado_cliente_fabricante';
|
||||
|
||||
protected $fillable = [
|
||||
'conectasus_fabricante_id',
|
||||
'nome',
|
||||
'cnpj',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'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 conectasusFabricante()
|
||||
{
|
||||
return $this->belongsTo(CadastroFabricante::class);
|
||||
}
|
||||
|
||||
public function entradaItens()
|
||||
{
|
||||
return $this->hasMany(EntradaItem::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\WebService\Almoxarifado\Cliente;
|
||||
|
||||
use App\Models\Cadastro\Fornecedor\Fornecedor as CadastroFornecedor;
|
||||
use App\Models\Model;
|
||||
|
||||
class Fornecedor extends Model
|
||||
{
|
||||
protected $table = 'web_service_almoxarifado_cliente_fornecedor';
|
||||
|
||||
protected $fillable = [
|
||||
'conectasus_fornecedor_id',
|
||||
'nome',
|
||||
'cnpj',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'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 conectasusFornecedor()
|
||||
{
|
||||
return $this->belongsTo(CadastroFornecedor::class);
|
||||
}
|
||||
|
||||
public function entradas()
|
||||
{
|
||||
return $this->hasMany(Entrada::class);
|
||||
}
|
||||
}
|
||||
37
api/app/Models/WebService/Almoxarifado/Cliente/Material.php
Normal file
37
api/app/Models/WebService/Almoxarifado/Cliente/Material.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\WebService\Almoxarifado\Cliente;
|
||||
|
||||
use App\Models\Cadastro\Material\Material as CadastroMaterial;
|
||||
use App\Models\Model;
|
||||
|
||||
class Material extends Model
|
||||
{
|
||||
protected $table = 'web_service_almoxarifado_cliente_material';
|
||||
|
||||
protected $fillable = [
|
||||
'conectasus_material_id',
|
||||
'nome',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'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 conectasusMaterial()
|
||||
{
|
||||
return $this->belongsTo(CadastroMaterial::class);
|
||||
}
|
||||
|
||||
public function entradaItens()
|
||||
{
|
||||
return $this->hasMany(EntradaItem::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\WebService\Almoxarifado\Cliente;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class PeriodoContabil extends Model
|
||||
{
|
||||
protected $table = 'web_service_almoxarifado_cliente_periodo_contabil';
|
||||
|
||||
protected $casts = [
|
||||
'inicio' => 'datetime:Y-m-d',
|
||||
'fim' => 'datetime:Y-m-d',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'inicio',
|
||||
'fim',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'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',
|
||||
];
|
||||
}
|
||||
43
api/app/Models/WebService/Almoxarifado/Cliente/Unidade.php
Normal file
43
api/app/Models/WebService/Almoxarifado/Cliente/Unidade.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\WebService\Almoxarifado\Cliente;
|
||||
|
||||
use App\Models\Cadastro\Estabelecimento\CentroCusto as CadastroCentroCusto;
|
||||
use App\Models\Model;
|
||||
|
||||
class Unidade extends Model
|
||||
{
|
||||
protected $table = 'web_service_almoxarifado_cliente_unidade';
|
||||
|
||||
protected $casts = [
|
||||
'is_almoxarifado' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'conectasus_centro_custo_id',
|
||||
'nome',
|
||||
'cnes',
|
||||
'is_almoxarifado',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'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 conectasusCentroCusto()
|
||||
{
|
||||
return $this->belongsTo(CadastroCentroCusto::class);
|
||||
}
|
||||
|
||||
public function entradas()
|
||||
{
|
||||
return $this->hasMany(Entrada::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user