From 8be0e3d16cc010cfed2d1b1a4fe78eaea6512003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Tue, 19 Nov 2024 20:51:11 +0100 Subject: [PATCH 1/2] modificado form papel generico --- .../Configuracion/Papelesgenericos.php | 6 +- .../Entities/Configuracion/PapelGenerico.php | 4 +- ci4/app/Language/es/PapelGenerico.php | 1 + .../Configuracion/PapelGenericoModel.php | 6 +- .../Configuracion/PapelImpresionModel.php | 3 +- .../papel/_papelGenericoFormItems.php | 78 ++++++++++++------- .../papel/viewPapelGenericoForm.php | 10 +++ .../papel/viewPapelGenericoList.php | 4 +- 8 files changed, 75 insertions(+), 37 deletions(-) diff --git a/ci4/app/Controllers/Configuracion/Papelesgenericos.php b/ci4/app/Controllers/Configuracion/Papelesgenericos.php index d0b93c2b..82f26748 100755 --- a/ci4/app/Controllers/Configuracion/Papelesgenericos.php +++ b/ci4/app/Controllers/Configuracion/Papelesgenericos.php @@ -156,8 +156,10 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController if ($this->request->getPost('show_in_client') == null) { $sanitizedData['show_in_client'] = false; } - - + if ($this->request->getPost('show_in_client_special') == null) { + $sanitizedData['show_in_client_special'] = false; + } + $noException = true; if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) : diff --git a/ci4/app/Entities/Configuracion/PapelGenerico.php b/ci4/app/Entities/Configuracion/PapelGenerico.php index 7203bca4..a6bc5faa 100755 --- a/ci4/app/Entities/Configuracion/PapelGenerico.php +++ b/ci4/app/Entities/Configuracion/PapelGenerico.php @@ -10,13 +10,15 @@ class PapelGenerico extends \CodeIgniter\Entity\Entity "nombre" => null, "code" => null, "code_ot" => null, - "show_in_client" => true, + "show_in_client" => false, + "show_in_client_special" => false, "is_deleted" => 0, "created_at" => null, "updated_at" => null, ]; protected $casts = [ "show_in_client" => "boolean", + "show_in_client_special" => "boolean", "is_deleted" => "int", ]; } diff --git a/ci4/app/Language/es/PapelGenerico.php b/ci4/app/Language/es/PapelGenerico.php index 08215a20..c38d8c1c 100755 --- a/ci4/app/Language/es/PapelGenerico.php +++ b/ci4/app/Language/es/PapelGenerico.php @@ -16,6 +16,7 @@ return [ 'papelGenericoList' => 'Lista Papeles Genéricos', 'papelesGenericos' => 'Papeles Genéricos', 'showInClient' => 'Mostrar en cliente', + 'showInClientSpecial' => 'Papel especial cliente', 'updatedAt' => 'Actualizado el', 'form_acordion_title' => 'Propiedades Papel Genérico', diff --git a/ci4/app/Models/Configuracion/PapelGenericoModel.php b/ci4/app/Models/Configuracion/PapelGenericoModel.php index 49f4a7a1..7cd2ca73 100755 --- a/ci4/app/Models/Configuracion/PapelGenericoModel.php +++ b/ci4/app/Models/Configuracion/PapelGenericoModel.php @@ -19,9 +19,10 @@ class PapelGenericoModel extends \App\Models\BaseModel 1 => "t1.code", 2 => "t1.code_ot", 3 => "t1.show_in_client", + 3 => "t1.show_in_client_special", ]; - protected $allowedFields = ["nombre", "code", "code_ot", "show_in_client", "deleted_at", "is_deleted"]; + protected $allowedFields = ["nombre", "code", "code_ot", "show_in_client", "show_in_client_special", "deleted_at", "is_deleted"]; protected $returnType = "App\Entities\Configuracion\PapelGenerico"; protected $useTimestamps = true; @@ -104,7 +105,8 @@ class PapelGenericoModel extends \App\Models\BaseModel $builder = $this->db ->table($this->table . " t1") ->select( - "t1.id AS id, t1.nombre AS nombre, t1.code AS code, t1.code_ot AS code_ot, t1.show_in_client AS show_in_client" + "t1.id AS id, t1.nombre AS nombre, t1.code AS code, t1.code_ot AS code_ot, + t1.show_in_client AS show_in_client, t1.show_in_client_special AS show_in_client_special" ) ->where("is_deleted", 0); diff --git a/ci4/app/Models/Configuracion/PapelImpresionModel.php b/ci4/app/Models/Configuracion/PapelImpresionModel.php index eac4807c..276892af 100755 --- a/ci4/app/Models/Configuracion/PapelImpresionModel.php +++ b/ci4/app/Models/Configuracion/PapelImpresionModel.php @@ -150,7 +150,8 @@ class PapelImpresionModel extends \App\Models\BaseModel t1.espesor AS espesor, t1.gramaje AS gramaje, t1.precio_tonelada AS precio_tonelada, t1.bn AS bn, t1.color AS color, t1.cubierta AS cubierta, t1.sobrecubierta AS sobrecubierta, t1.guardas AS guardas, t1.inkjet AS inkjet, t1.rotativa AS rotativa, - t1.isActivo AS isActivo, t2.nombre AS papel_generico_id" + t1.isActivo AS isActivo, t2.nombre AS papel_generico_id, + t1.show_in_client AS show_in_client, t1.show_in_client_special AS show_in_client_special" ); $builder->join("lg_papel_generico t2", "t1.papel_generico_id = t2.id", "left"); diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelGenericoFormItems.php b/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelGenericoFormItems.php index 6b1141e9..a5c18b8e 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelGenericoFormItems.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelGenericoFormItems.php @@ -1,36 +1,54 @@ -
-
-
- - -
+
+
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
-
+
+
- -
-
+ + show_in_client == true ? 'checked' : ''; ?>> -
+
+
-
\ No newline at end of file +
+
+ + + show_in_client_special == true ? 'checked' : ''; ?>> + + +
+
+ +
+ +
\ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelGenericoForm.php b/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelGenericoForm.php index b4b20718..0d231599 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelGenericoForm.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelGenericoForm.php @@ -134,6 +134,16 @@ window.location.href = `/configuracion/papelesimpresion/edit/${$(this).attr('data-id')}`; }); + $('#showInClientSpecial').on('change', function() { + if($(this).is(':checked')) { + $('#showInClient').prop('disabled', true); + $('#showInClient').prop('checked', true); + } + else{ + $('#showInClient').prop('disabled', false); + } + }); + endSection() ?> diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelGenericoList.php b/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelGenericoList.php index c3fd47da..8f8e0009 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelGenericoList.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelGenericoList.php @@ -20,6 +20,7 @@ + @@ -90,13 +91,14 @@ { 'data': 'code' }, { 'data': 'code_ot' }, { 'data': 'show_in_client' }, + { 'data': 'show_in_client_special' }, { 'data': actionBtns } ] }); theTable.on( 'draw.dt', function () { - const boolCols = [3]; + const boolCols = [3, 4]; for (let coln of boolCols) { theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) { cell.innerHTML = cell.innerHTML == '1' ? '' : ''; From e5159abf58806f93aac935b1bad8f3455f8b849d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Wed, 20 Nov 2024 16:35:48 +0100 Subject: [PATCH 2/2] =?UTF-8?q?a=C3=B1adido=20los=20checks=20de=20web=20cl?= =?UTF-8?q?iente=20en=20papeles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Configuracion/Papelesgenericos.php | 3 + .../Configuracion/Papelesimpresion.php | 13 + .../Entities/Configuracion/PapelImpresion.php | 6 + ci4/app/Language/es/PapelImpresion.php | 2 + .../Configuracion/PapelImpresionModel.php | 6 +- .../papel/_papelGenericoFormItems.php | 1 + .../papel/_papelImpresionFormItems.php | 305 ++++++++++-------- .../papel/viewPapelImpresionForm.php | 10 + .../papel/viewPapelImpresionList.php | 6 +- 9 files changed, 216 insertions(+), 136 deletions(-) diff --git a/ci4/app/Controllers/Configuracion/Papelesgenericos.php b/ci4/app/Controllers/Configuracion/Papelesgenericos.php index 82f26748..af7cfa22 100755 --- a/ci4/app/Controllers/Configuracion/Papelesgenericos.php +++ b/ci4/app/Controllers/Configuracion/Papelesgenericos.php @@ -160,6 +160,9 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController $sanitizedData['show_in_client_special'] = false; } + if($sanitizedData['show_in_client_special']){ + $sanitizedData['show_in_client'] = true; + } $noException = true; if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) : diff --git a/ci4/app/Controllers/Configuracion/Papelesimpresion.php b/ci4/app/Controllers/Configuracion/Papelesimpresion.php index 15f7160e..b92d69a8 100755 --- a/ci4/app/Controllers/Configuracion/Papelesimpresion.php +++ b/ci4/app/Controllers/Configuracion/Papelesimpresion.php @@ -209,6 +209,19 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController if ($this->request->getPost('inkjet') == null) { $sanitizedData['inkjet'] = false; } + if ($this->request->getPost('isActivo') == null) { + $sanitizedData['isActivo'] = false; + } + if ($this->request->getPost('show_in_client') == null) { + $sanitizedData['show_in_client'] = false; + } + if ($this->request->getPost('show_in_client_special') == null) { + $sanitizedData['show_in_client_special'] = false; + } + + if($sanitizedData['show_in_client_special']){ + $sanitizedData['show_in_client'] = true; + } // Hay que asegurarse de que se quitan los consumos de tintas de rotativa // en caso de que se haya deseleccionado la opción rotativa diff --git a/ci4/app/Entities/Configuracion/PapelImpresion.php b/ci4/app/Entities/Configuracion/PapelImpresion.php index b2ef88ce..c8cc8983 100755 --- a/ci4/app/Entities/Configuracion/PapelImpresion.php +++ b/ci4/app/Entities/Configuracion/PapelImpresion.php @@ -22,6 +22,9 @@ class PapelImpresion extends \CodeIgniter\Entity\Entity "guardas" => false, "inkjet" => false, "rotativa" => false, + "isActivo" => true, + "show_in_client" => false, + "show_in_client_special" => false, "is_deleted" => 0, "created_at" => null, "updated_at" => null, @@ -39,6 +42,9 @@ class PapelImpresion extends \CodeIgniter\Entity\Entity "sobrecubierta" => "boolean", "guardas" => "boolean", "rotativa" => "boolean", + "isActivo" => "boolean", + "show_in_client" => "boolean", + "show_in_client_special" => "boolean", "is_deleted" => "int", ]; } diff --git a/ci4/app/Language/es/PapelImpresion.php b/ci4/app/Language/es/PapelImpresion.php index 46cfe47b..9096bb3e 100755 --- a/ci4/app/Language/es/PapelImpresion.php +++ b/ci4/app/Language/es/PapelImpresion.php @@ -35,6 +35,8 @@ return [ 'rotativa' => 'Rotativa', 'updatedAt' => 'Actualizado en', 'activo' => 'Activo?', + 'showInClient' => 'Mostrar en cliente', + 'showInClientSpecial' => 'Papel especial cliente', 'userUpdateId' => 'ID usuario actualización', 'consumo_tintas_rotativas' => 'Consumo tintas', diff --git a/ci4/app/Models/Configuracion/PapelImpresionModel.php b/ci4/app/Models/Configuracion/PapelImpresionModel.php index 276892af..c2d5b91f 100755 --- a/ci4/app/Models/Configuracion/PapelImpresionModel.php +++ b/ci4/app/Models/Configuracion/PapelImpresionModel.php @@ -23,7 +23,9 @@ class PapelImpresionModel extends \App\Models\BaseModel 7 => "t1.guardas", 8 => "t1.inkjet", 9 => "t1.rotativa", - 10 => "t1.isActivo" + 10 => "t1.isActivo", + 11 => "t1.show_in_client", + 12 => "t1.show_in_client_special" ]; @@ -44,6 +46,8 @@ class PapelImpresionModel extends \App\Models\BaseModel "inkjet", "rotativa", "isActivo", + "show_in_client", + "show_in_client_special", "deleted_at", "is_deleted", "user_updated_id", diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelGenericoFormItems.php b/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelGenericoFormItems.php index a5c18b8e..7d55da9f 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelGenericoFormItems.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelGenericoFormItems.php @@ -31,6 +31,7 @@ show_in_client_special == true ? 'disabled' : ''; ?> show_in_client == true ? 'checked' : ''; ?>> diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelImpresionFormItems.php b/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelImpresionFormItems.php index 964e9916..54d50470 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelImpresionFormItems.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelImpresionFormItems.php @@ -1,165 +1,202 @@ -
-
+
+
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
+
-
-
- - - $v) : ?> - - - -
+ $v): ?> + + + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
+
- + -
-
-
-
+
+
+
+
- -
-
+ +
+
-
-
+
+
- -
-
+ +
+
-
-
+
+
- -
-
+ +
+
-
-
+
+
- -
-
+ +
+
-
-
+
+
- -
-
-
+ +
+
-
-
-
+
+
+ + show_in_client_special == true ? 'disabled' : ''; ?> + show_in_client == true ? 'checked' : ''; ?>> +
+
- -
-
+
+
+ + show_in_client_special == true ? 'checked' : ''; ?>> +
+
+
-
-
+
+
+
- -
-
+ +
+
-
-
+
+
- -
-
+ +
+
-
-
+
+
- -
-
-
-
\ No newline at end of file + +
+
+ +
+
+ + +
+
+
+
\ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionForm.php b/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionForm.php index 4431ccbe..65688fe5 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionForm.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionForm.php @@ -757,6 +757,16 @@ } }) + $('#showInClientSpecial').on('change', function() { + if($(this).is(':checked')) { + $('#showInClient').prop('disabled', true); + $('#showInClient').prop('checked', true); + } + else{ + $('#showInClient').prop('disabled', false); + } + }); + endSection() ?> diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionList.php b/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionList.php index 17736b94..61f93599 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionList.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionList.php @@ -29,6 +29,8 @@ + + @@ -106,13 +108,15 @@ { 'data': 'inkjet' }, { 'data': 'rotativa' }, { 'data': 'isActivo' }, + { 'data': 'show_in_client' }, + { 'data': 'show_in_client_special' }, { 'data': actionBtns } ] }); theTable.on( 'draw.dt', function () { - const boolCols = [3, 4, 5, 6, 7, 8, 9, 10]; + const boolCols = [3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; for (let coln of boolCols) { theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) { cell.innerHTML = cell.innerHTML == '1' ? '' : '';