mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'feat/catalogo' into 'main'
Feat/catalogo See merge request jjimenez/safekat!727
This commit is contained in:
265
ci4/app/Entities/Catalogo/CatalogoLibroEntity.php
Normal file
265
ci4/app/Entities/Catalogo/CatalogoLibroEntity.php
Normal file
@ -0,0 +1,265 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Catalogo;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use App\Models\Configuracion\PapelGenericoModel;
|
||||
use App\Models\Configuracion\TipoPresupuestoModel;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use App\Models\Tarifas\Acabados\ServicioAcabadoModel;
|
||||
use App\Models\Clientes\ClienteModel;
|
||||
class CatalogoLibroEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
'id' => null,
|
||||
'cliente_id' => null,
|
||||
'proveedor_id' => null,
|
||||
'user_created_id' => 1,
|
||||
'user_update_id' => 1,
|
||||
'cubierta_archivo' => null,
|
||||
'cubierta_url' => null,
|
||||
'ancho' => 0.00,
|
||||
'alto' => 0.00,
|
||||
'peso' => null,
|
||||
'titulo' => '',
|
||||
'autor' => '',
|
||||
'autor_entidad' => null,
|
||||
'traductor' => null,
|
||||
'ilustrador' => null,
|
||||
'idioma' => 'spa',
|
||||
'num_edic' => 1,
|
||||
'fecha_disponibilidad' => null,
|
||||
'fecha_public' => null,
|
||||
'num_fotos' => 0,
|
||||
'num_ilustr' => 0,
|
||||
'num_ilustr_color' => 0,
|
||||
'num_ilustr_bn' => 0,
|
||||
'coleccion' => '',
|
||||
'isk' => null,
|
||||
'isbn' => null,
|
||||
'ean' => null,
|
||||
'editorial' => '',
|
||||
'resumen' => null,
|
||||
'resumen_breve' => null,
|
||||
'sello' => null,
|
||||
'paginas' => 0,
|
||||
'tipo_impresion' => null,
|
||||
'solapas_ancho' => 0.00,
|
||||
'cubiertas_ancho' => 0.00,
|
||||
'comentarios' => '',
|
||||
'negro_paginas' => null,
|
||||
'negro_papel' => null,
|
||||
'negro_papel_id' => null,
|
||||
'negro_gramaje' => null,
|
||||
'negro_pod_papel_id' => null,
|
||||
'negro_pod_gramaje' => null,
|
||||
'color_paginas' => null,
|
||||
'color_papel' => null,
|
||||
'color_papel_id' => null,
|
||||
'color_gramaje' => null,
|
||||
'color_pod_papel_id' => null,
|
||||
'color_pod_gramaje' => null,
|
||||
'cubierta_paginas' => null,
|
||||
'cubierta_papel' => null,
|
||||
'cubierta_papel_id' => null,
|
||||
'cubierta_gramaje' => null,
|
||||
'cubierta_acabado' => null,
|
||||
'cubierta_pod_papel_id' => null,
|
||||
'cubierta_pod_gramaje' => null,
|
||||
'sobrecubierta_paginas' => null,
|
||||
'sobrecubierta_papel' => null,
|
||||
'sobrecubierta_papel_id' => null,
|
||||
'sobrecubierta_gramaje' => null,
|
||||
'sobrecubierta_acabado' => null,
|
||||
'sobrecubierta_pod_papel_id' => null,
|
||||
'sobrecubierta_pod_gramaje' => null,
|
||||
'encuardenacion_id' => 'null',
|
||||
'ubicacion' => null,
|
||||
'created_at' => null,
|
||||
'updated_at' => null,
|
||||
'deleted_at' => null,
|
||||
];
|
||||
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at', 'fecha_disponibilidad', 'fecha_public'];
|
||||
|
||||
protected $casts = [
|
||||
'id' => 'int',
|
||||
'cliente_id' => '?int',
|
||||
'proveedor_id' => '?int',
|
||||
'user_created_id' => 'int',
|
||||
'user_update_id' => 'int',
|
||||
'ancho' => 'float',
|
||||
'alto' => 'float',
|
||||
'peso' => '?float',
|
||||
'num_edic' => '?int',
|
||||
'num_fotos' => '?int',
|
||||
'num_ilustr' => '?int',
|
||||
'num_ilustr_color' => '?int',
|
||||
'num_ilustr_bn' => '?int',
|
||||
'paginas' => 'int',
|
||||
'solapas_ancho' => 'float',
|
||||
'cubiertas_ancho' => 'float',
|
||||
'negro_paginas' => '?int',
|
||||
'negro_gramaje' => '?float',
|
||||
'negro_papel_id' => '?int',
|
||||
'negro_pod_papel_id' => '?int',
|
||||
'negro_pod_gramaje' => '?float',
|
||||
'color_paginas' => '?int',
|
||||
'color_gramaje' => '?float',
|
||||
'color_papel_id' => '?int',
|
||||
'color_pod_papel_id' => '?int',
|
||||
'color_pod_gramaje' => '?float',
|
||||
'cubierta_paginas' => '?int',
|
||||
'cubierta_gramaje' => '?float',
|
||||
'cubierta_papel_id' => '?int',
|
||||
'cubierta_pod_papel_id' => '?int',
|
||||
'cubierta_pod_gramaje' => '?float',
|
||||
'sobrecubierta_paginas' => '?int',
|
||||
'sobrecubierta_gramaje' => '?float',
|
||||
'sobrecubierta_papel_id' => '?int',
|
||||
'sobrecubierta_pod_papel_id' => '?int',
|
||||
'sobrecubierta_pod_gramaje' => '?float',
|
||||
'fecha_disponibilidad' => 'datetime',
|
||||
'fecha_public' => 'datetime',
|
||||
|
||||
];
|
||||
|
||||
public function getClienteName()
|
||||
{
|
||||
if (!$this->cliente_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$cliente = model(ClienteModel::class)->find($this->cliente_id);
|
||||
return $cliente->nombre ?? null;
|
||||
}
|
||||
|
||||
public function getEncuadernacionName()
|
||||
{
|
||||
if (!$this->encuadernacion_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$enc = model(TipoPresupuestoModel::class)->find($this->encuadernacion_id);
|
||||
return $enc->encuadernacion ?? null;
|
||||
}
|
||||
|
||||
public function getCreatedUser()
|
||||
{
|
||||
if (!$this->user_created_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return model(UserModel::class)->getFullName($this->user_created_id);
|
||||
}
|
||||
|
||||
public function getUpdatedUser()
|
||||
{
|
||||
if (!$this->user_update_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return model(UserModel::class)->getFullName($this->user_update_id);
|
||||
}
|
||||
|
||||
|
||||
public function getNegroPapelName()
|
||||
{
|
||||
if (!$this->negro_papel_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$papel = model(PapelGenericoModel::class)->asObject()->find($this->negro_papel_id);
|
||||
return $papel?->nombre ?? null;
|
||||
}
|
||||
|
||||
public function getNegroPodPapelName()
|
||||
{
|
||||
if (!$this->negro_pod_papel_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$papel = model(PapelGenericoModel::class)->asObject()->find($this->negro_pod_papel_id);
|
||||
return $papel?->nombre ?? null;
|
||||
}
|
||||
|
||||
public function getColorPapelName()
|
||||
{
|
||||
if (!$this->color_papel_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$papel = model(PapelGenericoModel::class)->asObject()->find($this->color_papel_id);
|
||||
return $papel?->nombre ?? null;
|
||||
}
|
||||
|
||||
public function getColorPodPapelName()
|
||||
{
|
||||
if (!$this->color_pod_papel_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$papel = model(PapelGenericoModel::class)->asObject()->find($this->color_pod_papel_id);
|
||||
return $papel?->nombre ?? null;
|
||||
}
|
||||
|
||||
public function getCubiertaPapelName()
|
||||
{
|
||||
if (!$this->cubierta_papel_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$papel = model(PapelGenericoModel::class)->asObject()->find($this->cubierta_papel_id);
|
||||
return $papel?->nombre ?? null;
|
||||
}
|
||||
|
||||
public function getCubiertaPodPapelName()
|
||||
{
|
||||
if (!$this->cubierta_pod_papel_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$papel = model(PapelGenericoModel::class)->asObject()->find($this->cubierta_pod_papel_id);
|
||||
return $papel?->nombre ?? null;
|
||||
}
|
||||
|
||||
public function getSobrecubiertaPapelName()
|
||||
{
|
||||
if (!$this->sobrecubierta_papel_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$papel = model(PapelGenericoModel::class)->asObject()->find($this->sobrecubierta_papel_id);
|
||||
return $papel?->nombre ?? null;
|
||||
}
|
||||
|
||||
public function getSobrecubiertaPodPapelName()
|
||||
{
|
||||
if (!$this->sobrecubierta_pod_papel_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$papel = model(PapelGenericoModel::class)->asObject()->find($this->sobrecubierta_pod_papel_id);
|
||||
return $papel?->nombre ?? null;
|
||||
}
|
||||
|
||||
public function getCubiertaAcabadoName()
|
||||
{
|
||||
if (!$this->cubierta_acabado_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$servicioAcabado = model(ServicioAcabadoModel::class)->asObject()->find($this->cubierta_acabado_id);
|
||||
return $servicioAcabado?->nombre ?? null;
|
||||
}
|
||||
|
||||
public function getSobrecubiertaAcabadoName()
|
||||
{
|
||||
if (!$this->sobrecubierta_acabado_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$servicioAcabado = model(ServicioAcabadoModel::class)->asObject()->find($this->sobrecubierta_acabado_id);
|
||||
return $servicioAcabado?->nombre ?? null;
|
||||
}
|
||||
}
|
||||
10
ci4/app/Entities/Catalogo/IdentificadorIsk.php
Normal file
10
ci4/app/Entities/Catalogo/IdentificadorIsk.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Catalogo;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class IdentificadorIsk extends Entity
|
||||
{
|
||||
protected $dates = ['created_at', 'updated_at'];
|
||||
}
|
||||
Reference in New Issue
Block a user