diff --git a/ci4/app/Controllers/Configuracion/Papelesgenericos.php b/ci4/app/Controllers/Configuracion/Papelesgenericos.php index 2d699401..4df4e462 100755 --- a/ci4/app/Controllers/Configuracion/Papelesgenericos.php +++ b/ci4/app/Controllers/Configuracion/Papelesgenericos.php @@ -301,13 +301,14 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController $tipo = goSanitize($this->request->getGet('tipo'))[0]; $selected_papel = goSanitize($this->request->getGet('papel'))[0] ?? null; $cubierta = goSanitize($this->request->getGet('cubierta'))[0] ?? 0; - $papel_especial = goSanitize($this->request->getGet('papel_especial'))[0] ?? 0; - $menu = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, $papel_especial); + $menu = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, false); + $menu2 = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, true); $newTokenHash = csrf_hash(); $csrfTokenName = csrf_token(); $data = [ 'papeles' => $menu, + 'papeles_especiales' => $menu2, $csrfTokenName => $newTokenHash ]; return $this->respond($data); @@ -315,4 +316,37 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController return $this->failUnauthorized('Invalid request', 403); } } + + + + /****************************************** + * + * AUQIIIIII + */ + public function selectPapelEspecial() + { + + if ($this->request->isAJAX()) { + + $tipo = goSanitize($this->request->getGet('tipo'))[0]; + $cubierta = goSanitize($this->request->getGet('cubierta'))[0] ?? 0; + $items = $this->model->getPapelCliente($tipo, $cubierta, null, true); + + $query = $this->model->builder()->select( + [ + "id", + "nombre as name" + ] + )->where("deleted_at", null); + if ($this->request->getGet("q")) { + $query->groupStart() + ->orLike("clientes.nombre", $this->request->getGet("q")) + ->groupEnd(); + } + + return $this->response->setJSON($query->get()->getResultObject()); + } else { + return $this->failUnauthorized('Invalid request', 403); + } + } } diff --git a/ci4/app/Language/es/Presupuestos.php b/ci4/app/Language/es/Presupuestos.php index 6290d962..1fb887c2 100755 --- a/ci4/app/Language/es/Presupuestos.php +++ b/ci4/app/Language/es/Presupuestos.php @@ -256,6 +256,7 @@ return [ // Placeholders 'formatoLibro' => "Formato libro", 'selectCliente' => "Seleccione cliente", + 'selectPapel' => "Seleccione papel", // Preview diff --git a/ci4/app/Models/Configuracion/PapelGenericoModel.php b/ci4/app/Models/Configuracion/PapelGenericoModel.php index 18e764db..a1362d15 100755 --- a/ci4/app/Models/Configuracion/PapelGenericoModel.php +++ b/ci4/app/Models/Configuracion/PapelGenericoModel.php @@ -19,7 +19,7 @@ class PapelGenericoModel extends \App\Models\BaseModel 1 => "t1.code", 2 => "t1.code_ot", 3 => "t1.show_in_client", - 3 => "t1.show_in_client_special", + 4 => "t1.show_in_client_special", ]; protected $allowedFields = ["nombre", "code", "code_ot", "show_in_client", "show_in_client_special", "deleted_at", "is_deleted"]; diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioInterior.php b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioInterior.php index 89d79925..62916779 100644 --- a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioInterior.php +++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioInterior.php @@ -51,6 +51,12 @@ +