diff --git a/ci4/app/Controllers/Catalogo/CatalogoLibros.php b/ci4/app/Controllers/Catalogo/CatalogoLibros.php index 749aceae..b495f614 100644 --- a/ci4/app/Controllers/Catalogo/CatalogoLibros.php +++ b/ci4/app/Controllers/Catalogo/CatalogoLibros.php @@ -178,8 +178,8 @@ class CatalogoLibros extends BaseResourceController endif; // $noException && $successfulResult endif; // ($requestMethod === 'post') - $catalogoLibrosEntity->tipoImpresion = $catalogoLibrosEntity->tipo_impresion ?? 'negro'; $catalogoLibrosEntity->clienteName = model('App\Models\Clientes\ClienteModel')->find($catalogoLibrosEntity->cliente_id)->nombre; + $catalogoLibrosEntity->encuadernacionName = model('App\Models\Configuracion\TipoPresupuestoModel')->find($catalogoLibrosEntity->encuadernacion_id)->encuadernacion; $catalogoLibrosEntity->createdUser = model('App\Models\Usuarios\UserModel')->getFullName($catalogoLibrosEntity->user_created_id); $catalogoLibrosEntity->updatedUser = model('App\Models\Usuarios\UserModel')->getFullName($catalogoLibrosEntity->user_update_id); diff --git a/ci4/app/Entities/Catalogo/CatalogoLibroEntity.php b/ci4/app/Entities/Catalogo/CatalogoLibroEntity.php index 49a9cef2..0f363e67 100644 --- a/ci4/app/Entities/Catalogo/CatalogoLibroEntity.php +++ b/ci4/app/Entities/Catalogo/CatalogoLibroEntity.php @@ -3,6 +3,7 @@ namespace App\Entities\Catalogo; use CodeIgniter\Entity\Entity; +use App\Models\Configuracion\PapelGenericoModel; class CatalogoLibroEntity extends Entity { @@ -44,19 +45,24 @@ class CatalogoLibroEntity extends Entity 'comentarios' => '', 'negro_paginas' => null, 'negro_papel' => null, + 'negro_papel_id' => null, 'negro_gramaje' => null, 'color_paginas' => null, 'color_papel' => null, + 'color_papel_id' => null, 'color_gramaje' => null, - 'portada_paginas' => null, - 'portada_papel' => null, - 'portada_gramaje' => null, - 'portada_acabado' => null, 'cubierta_paginas' => null, 'cubierta_papel' => null, + 'cubierta_papel_id' => null, 'cubierta_gramaje' => null, 'cubierta_acabado' => null, + 'sobrecubierta_paginas' => null, + 'sobrecubierta_papel' => null, + 'sobrecubierta_papel_id' => null, + 'sobrecubierta_gramaje' => null, + 'sobrecubierta_acabado' => null, 'encuardenacion' => '', + 'encuardenacion_id' => 'null', 'ubicacion' => null, 'created_at' => null, 'updated_at' => null, @@ -84,11 +90,57 @@ class CatalogoLibroEntity extends Entity 'cubiertas_ancho' => 'float', 'negro_paginas' => '?int', 'negro_gramaje' => '?float', + 'negro_papel_id' => '?int', 'color_paginas' => '?int', 'color_gramaje' => '?float', - 'portada_paginas' => '?int', - 'portada_gramaje' => '?float', + 'color_papel_id' => '?int', 'cubierta_paginas' => '?int', 'cubierta_gramaje' => '?float', + 'cubierta_papel_id' => '?int', + 'sobrecubierta_paginas' => '?int', + 'sobrecubierta_gramaje' => '?float', + 'sobrecubierta_papel_id' => '?int', + ]; + + + 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 getColorPapelName() + { + if (!$this->color_papel_id) { + return null; + } + + $papel = model(PapelGenericoModel::class)->asObject()->find($this->color_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 getSobrecubiertaPapelName() + { + if (!$this->sobrecubierta_papel_id) { + return null; + } + + $papel = model(PapelGenericoModel::class)->asObject()->find($this->sobrecubierta_papel_id); + return $papel?->nombre ?? null; + } } diff --git a/ci4/app/Language/es/Catalogo.php b/ci4/app/Language/es/Catalogo.php index 4fcde2c1..feb14e0b 100644 --- a/ci4/app/Language/es/Catalogo.php +++ b/ci4/app/Language/es/Catalogo.php @@ -40,6 +40,7 @@ return [ 'sello' => 'Sello', 'paginas' => 'Páginas', 'tipoImpresion' => 'Tipo de Impresión', + 'seleccionarTipoImpresion' => 'Seleccionar tipo de impresión', 'solapasAncho' => 'Ancho de Solapas', 'cubiertasAncho' => 'Ancho de Cubiertas', 'comentarios' => 'Comentarios', diff --git a/ci4/app/Views/themes/vuexy/form/catalogo/_configuracionLibroFormItems.php b/ci4/app/Views/themes/vuexy/form/catalogo/_configuracionLibroFormItems.php index ac1dabe2..06303dad 100644 --- a/ci4/app/Views/themes/vuexy/form/catalogo/_configuracionLibroFormItems.php +++ b/ci4/app/Views/themes/vuexy/form/catalogo/_configuracionLibroFormItems.php @@ -29,17 +29,18 @@
= lang("Presupuestos.numeroPaginas") ?>
= lang("Presupuestos.papel") ?>
@@ -82,6 +86,16 @@ = lang("Presupuestos.gramaje") ?>+ = "Solapas" ?> +
++ = "Acabados" ?> +
+