diff --git a/ci4/app/Controllers/Configuracion/Papelesgenericos.php b/ci4/app/Controllers/Configuracion/Papelesgenericos.php index 82392fca..37e2ca7c 100755 --- a/ci4/app/Controllers/Configuracion/Papelesgenericos.php +++ b/ci4/app/Controllers/Configuracion/Papelesgenericos.php @@ -156,6 +156,9 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController if ($this->request->getPost('show_in_client') == null) { $sanitizedData['show_in_client'] = false; } + if ($this->request->getPost('activo') == null) { + $sanitizedData['activo'] = false; + } if ($this->request->getPost('show_in_client_special') == null) { $sanitizedData['show_in_client_special'] = false; } @@ -163,6 +166,9 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController if ($sanitizedData['show_in_client_special']) { $sanitizedData['show_in_client'] = true; } + if ($sanitizedData['activo']) { + $sanitizedData['activo'] = true; + } $noException = true; if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) : diff --git a/ci4/app/Database/Migrations/2025-02-16-224244_AlterAddColumnActivoPapelGenerico.php b/ci4/app/Database/Migrations/2025-02-16-224244_AlterAddColumnActivoPapelGenerico.php new file mode 100644 index 00000000..ae73c86b --- /dev/null +++ b/ci4/app/Database/Migrations/2025-02-16-224244_AlterAddColumnActivoPapelGenerico.php @@ -0,0 +1,26 @@ + [ + 'type' => 'BOOLEAN', + 'default' => true, + ] + ]; + $this->forge->addColumn('lg_papel_generico',$field); + + } + + public function down() + { + $this->forge->dropColumn('lg_papel_generico','activo'); + } +} + diff --git a/ci4/app/Entities/Configuracion/PapelGenerico.php b/ci4/app/Entities/Configuracion/PapelGenerico.php index a6bc5faa..344d1832 100755 --- a/ci4/app/Entities/Configuracion/PapelGenerico.php +++ b/ci4/app/Entities/Configuracion/PapelGenerico.php @@ -13,11 +13,13 @@ class PapelGenerico extends \CodeIgniter\Entity\Entity "show_in_client" => false, "show_in_client_special" => false, "is_deleted" => 0, + "activo" => false, "created_at" => null, "updated_at" => null, ]; protected $casts = [ "show_in_client" => "boolean", + "activo" => "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 c38d8c1c..5df63224 100755 --- a/ci4/app/Language/es/PapelGenerico.php +++ b/ci4/app/Language/es/PapelGenerico.php @@ -8,6 +8,7 @@ return [ 'createdAt' => 'Creado el', 'deletedAt' => 'Deleted At', 'id' => 'ID', + 'activo' => 'Activo', 'isDeleted' => 'Is Deleted', 'moduleTitle' => 'Papel Genérico', 'nombre' => 'Nombre', diff --git a/ci4/app/Models/Configuracion/PapelGenericoModel.php b/ci4/app/Models/Configuracion/PapelGenericoModel.php index 5e235d43..118dadf2 100755 --- a/ci4/app/Models/Configuracion/PapelGenericoModel.php +++ b/ci4/app/Models/Configuracion/PapelGenericoModel.php @@ -22,7 +22,7 @@ class PapelGenericoModel extends \App\Models\BaseModel 4 => "t1.show_in_client_special", ]; - protected $allowedFields = ["nombre", "code", "code_ot", "show_in_client", "show_in_client_special", "deleted_at", "is_deleted"]; + protected $allowedFields = ["nombre", "code", "code_ot", "show_in_client", "show_in_client_special", "deleted_at", "is_deleted", "activo"]; protected $returnType = "App\Entities\Configuracion\PapelGenerico"; protected $useTimestamps = true; @@ -120,25 +120,28 @@ 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.show_in_client_special AS show_in_client_special" + ->select("t1.id AS id, t1.nombre AS nombre, + t1.code AS code, + t1.code_ot AS code_ot, + t1.activo AS activo, + t1.show_in_client AS show_in_client, + t1.show_in_client_special AS show_in_client_special" ) ->where("is_deleted", 0); return empty($search) ? $builder : $builder - ->groupStart() - ->like("t1.id", $search) - ->orLike("t1.nombre", $search) - ->orLike("t1.code", $search) - ->orLike("t1.code_ot", $search) - ->orLike("t1.id", $search) - ->orLike("t1.nombre", $search) - ->orLike("t1.code", $search) - ->orLike("t1.code_ot", $search) - ->groupEnd(); + ->groupStart() + ->like("t1.id", $search) + ->orLike("t1.nombre", $search) + ->orLike("t1.code", $search) + ->orLike("t1.code_ot", $search) + ->orLike("t1.id", $search) + ->orLike("t1.nombre", $search) + ->orLike("t1.code", $search) + ->orLike("t1.code_ot", $search) + ->groupEnd(); } 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 501b1124..797b136d 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelGenericoFormItems.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelGenericoFormItems.php @@ -23,7 +23,15 @@ - +