diff --git a/ci4/app/Controllers/Configuracion/Papelesimpresion.php b/ci4/app/Controllers/Configuracion/Papelesimpresion.php index b92d69a8..27d4dcce 100755 --- a/ci4/app/Controllers/Configuracion/Papelesimpresion.php +++ b/ci4/app/Controllers/Configuracion/Papelesimpresion.php @@ -212,15 +212,8 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController 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; + if ($this->request->getPost('use_in_client') == null) { + $sanitizedData['use_in_client'] = false; } // Hay que asegurarse de que se quitan los consumos de tintas de rotativa diff --git a/ci4/app/Database/Migrations/2024-11-20-162124_CambiarTicksPapelImpresion.php b/ci4/app/Database/Migrations/2024-11-20-162124_CambiarTicksPapelImpresion.php new file mode 100644 index 00000000..94f3f9ad --- /dev/null +++ b/ci4/app/Database/Migrations/2024-11-20-162124_CambiarTicksPapelImpresion.php @@ -0,0 +1,46 @@ + [ + 'type' => 'TINYINT', + 'constraint' => 1, + 'null' => false, + 'default' => 0, + ], + ]; + + $this->forge->addColumn('lg_papel_impresion', $fields); + $this->forge->dropColumn('lg_papel_impresion', 'show_in_client'); + $this->forge->dropColumn('lg_papel_impresion', 'show_in_client_special'); + } + + public function down() + { + $fields = [ + 'show_in_client_special' => [ + 'type' => 'TINYINT', + 'constraint' => 1, + 'null' => false, + 'default' => 0, + ], + 'show_in_client' => [ + 'type' => 'TINYINT', + 'constraint' => 1, + 'null' => false, + 'default' => 0, + ], + ]; + + $this->forge->addColumn('lg_papel_impresion', $fields); + $this->forge->dropColumn('lg_papel_impresion', 'use_in_client'); + + } +} diff --git a/ci4/app/Entities/Configuracion/PapelImpresion.php b/ci4/app/Entities/Configuracion/PapelImpresion.php index c8cc8983..b48f1875 100755 --- a/ci4/app/Entities/Configuracion/PapelImpresion.php +++ b/ci4/app/Entities/Configuracion/PapelImpresion.php @@ -23,8 +23,7 @@ class PapelImpresion extends \CodeIgniter\Entity\Entity "inkjet" => false, "rotativa" => false, "isActivo" => true, - "show_in_client" => false, - "show_in_client_special" => false, + "use_in_client" => false, "is_deleted" => 0, "created_at" => null, "updated_at" => null, @@ -43,8 +42,7 @@ class PapelImpresion extends \CodeIgniter\Entity\Entity "guardas" => "boolean", "rotativa" => "boolean", "isActivo" => "boolean", - "show_in_client" => "boolean", - "show_in_client_special" => "boolean", + "use_in_client" => "boolean", "is_deleted" => "int", ]; } diff --git a/ci4/app/Language/es/PapelImpresion.php b/ci4/app/Language/es/PapelImpresion.php index 9096bb3e..f1225ba8 100755 --- a/ci4/app/Language/es/PapelImpresion.php +++ b/ci4/app/Language/es/PapelImpresion.php @@ -35,8 +35,7 @@ return [ 'rotativa' => 'Rotativa', 'updatedAt' => 'Actualizado en', 'activo' => 'Activo?', - 'showInClient' => 'Mostrar en cliente', - 'showInClientSpecial' => 'Papel especial cliente', + 'useInClient' => 'Usar en presup. 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 c2d5b91f..9f4f3669 100755 --- a/ci4/app/Models/Configuracion/PapelImpresionModel.php +++ b/ci4/app/Models/Configuracion/PapelImpresionModel.php @@ -24,8 +24,7 @@ class PapelImpresionModel extends \App\Models\BaseModel 8 => "t1.inkjet", 9 => "t1.rotativa", 10 => "t1.isActivo", - 11 => "t1.show_in_client", - 12 => "t1.show_in_client_special" + 11 => "t1.use_in_client", ]; @@ -46,8 +45,7 @@ class PapelImpresionModel extends \App\Models\BaseModel "inkjet", "rotativa", "isActivo", - "show_in_client", - "show_in_client_special", + "use_in_client", "deleted_at", "is_deleted", "user_updated_id", @@ -155,7 +153,7 @@ class PapelImpresionModel extends \App\Models\BaseModel 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.show_in_client AS show_in_client, t1.show_in_client_special AS show_in_client_special" + t1.use_in_client AS use_in_client" ); $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 7d55da9f..501b1124 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelGenericoFormItems.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelGenericoFormItems.php @@ -31,7 +31,7 @@ show_in_client_special == true ? 'disabled' : ''; ?> + 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 54d50470..c9ddf8dd 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelImpresionFormItems.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelImpresionFormItems.php @@ -134,22 +134,11 @@
-
-
- -
-
- - show_in_client_special == true ? 'checked' : ''; ?>> + use_in_client == true ? 'checked' : ''; ?>>
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 65688fe5..6e6079b1 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionForm.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionForm.php @@ -757,17 +757,7 @@ } }) - $('#showInClientSpecial').on('change', function() { - if($(this).is(':checked')) { - $('#showInClient').prop('disabled', true); - $('#showInClient').prop('checked', true); - } - else{ - $('#showInClient').prop('disabled', false); - } - }); - -endSection() ?> + 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 61f93599..a76ef2bc 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionList.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionList.php @@ -29,8 +29,7 @@ - - + @@ -108,8 +107,7 @@ { 'data': 'inkjet' }, { 'data': 'rotativa' }, { 'data': 'isActivo' }, - { 'data': 'show_in_client' }, - { 'data': 'show_in_client_special' }, + { 'data': 'use_in_client' }, { 'data': actionBtns } ] });