diff --git a/.idea/php.xml b/.idea/php.xml
index 89778155..29059d00 100644
--- a/.idea/php.xml
+++ b/.idea/php.xml
@@ -10,7 +10,9 @@
-
+
+
+
diff --git a/ci4/.env b/ci4/.env
index cfd0651b..40f48c5f 100644
--- a/ci4/.env
+++ b/ci4/.env
@@ -22,8 +22,8 @@ CI_ENVIRONMENT = development
# APP
#--------------------------------------------------------------------
-app.baseURL = 'https://sk-jjo.imnavajas.es'
-#app.baseURL = 'https://sk-imn.imnavajas.es'
+#app.baseURL = 'https://sk-jjo.imnavajas.es'
+app.baseURL = 'https://sk-imn.imnavajas.es'
# app.baseURL = "http://safekat.test/"
# app.forceGlobalSecureRequests = false
diff --git a/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php b/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php
index ebf3773d..5a678caf 100644
--- a/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php
+++ b/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php
@@ -148,6 +148,12 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
$this->viewData['papelGenericoCubiertaList'] = $this->getPapelGenericoCubierta();
$this->viewData['papelGenericoSobrecubiertaList'] = $this->getPapelGenericoSobreCubierta();
+ // Tarifas
+ $this->viewData['serviciosPreimpresion'] = $this->getServiciosPreimpresion();
+ $this->viewData['serviciosEncuadernacion'] = $this->getServiciosEncuadernacion();
+ $this->viewData['serviciosAcabado'] = $this->getServiciosAcabado();
+ $this->viewData['serviciosManipulado'] = $this->getServiciosManipulado();
+
/*
@@ -376,7 +382,6 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
$this->viewData['papelGenericoCubiertaList'] = $this->getPapelGenericoCubierta();
$this->viewData['papelGenericoSobrecubiertaList'] = $this->getPapelGenericoSobreCubierta();
-
$this->viewData['formAction'] = route_to('updatePresupuesto', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Presupuestos.moduleTitle') . ' ' . lang('Basic.global.edit3');
@@ -701,6 +706,53 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
return $data;
}
+ protected function getServiciosPreimpresion()
+ {
+ $model = model('App\Models\Tarifas\TarifapreimpresionModel');
+ $data = $model->getServiciosPreimpresionSelector();
+ array_unshift($data, (object)array(
+ "id" => 0,
+ "nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.servicioPreimpresion'))])
+ ));
+ return $data;
+ }
+
+ protected function getServiciosEncuadernacion()
+ {
+ $model = model('App\Models\Tarifas\TarifaEncuadernacionModel');
+ $data = $model->getServiciosEncuadernacionSelector();
+ array_unshift($data, (object)array(
+ "id" => 0,
+ "nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.servicioEncuadernacion'))])
+ ));
+ return $data;
+ }
+
+ protected function getServiciosAcabado()
+ {
+ $model = model('App\Models\Tarifas\TarifaacabadoModel');
+ $data = $model->getServiciosAcabadoSelector();
+ array_unshift($data, (object)array(
+ "id" => 0,
+ "nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.servicioAcabado'))])
+ ));
+ return $data;
+ }
+
+ protected function getServiciosManipulado()
+ {
+ $model = model('App\Models\Tarifas\TarifaManipuladoModel');
+ $data = $model->getServiciosManipuladoSelector();
+ array_unshift($data, (object)array(
+ "id" => 0,
+ "nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.servicioManipulado'))])
+ ));
+ return $data;
+ }
+
+
+
+
/*
@@ -1087,4 +1139,5 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
return $paginasPortadaOptions;
}
*/
+
}
diff --git a/ci4/app/Controllers/Presupuestos/PresupuestoAcabados.php b/ci4/app/Controllers/Presupuestos/PresupuestoAcabados.php
new file mode 100644
index 00000000..b88a868d
--- /dev/null
+++ b/ci4/app/Controllers/Presupuestos/PresupuestoAcabados.php
@@ -0,0 +1,367 @@
+viewData['pageTitle'] = lang('ClienteContactos.moduleTitle');
+ $this->viewData['usingSweetAlert'] = true;
+ parent::initController($request, $response, $logger);
+ }
+
+
+ public function index()
+ {
+
+ $viewData = [
+ 'currentModule' => static::$controllerSlug,
+ 'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('ClienteContactos.contactoDeCliente')]),
+ 'clienteContactoEntity' => new ClienteContactoEntity(),
+ 'usingServerSideDataTable' => true,
+
+ ];
+
+ $viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
+
+ return view(static::$viewPath . 'viewContactoDeClienteList', $viewData);
+ }
+
+
+ public function add()
+ {
+
+
+ $requestMethod = $this->request->getMethod();
+
+ if ($requestMethod === 'post') :
+
+ $nullIfEmpty = true; // !(phpversion() >= '8.1');
+
+ $postData = $this->request->getPost();
+
+ $sanitizedData = $this->sanitized($postData, $nullIfEmpty);
+
+
+ $noException = true;
+ if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
+
+
+ if ($this->canValidate()) :
+ try {
+ $successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
+ } catch (\Exception $e) {
+ $noException = false;
+ $this->dealWithException($e);
+ }
+ else:
+ $this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
+ $this->session->setFlashdata('formErrors', $this->model->errors());
+ endif;
+
+ $thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
+ endif;
+ if ($noException && $successfulResult) :
+
+ $id = $this->model->db->insertID();
+
+ $message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
+
+ if ($thenRedirect) :
+ if (!empty($this->indexRoute)) :
+ return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
+ else:
+ return $this->redirect2listView('sweet-success', $message);
+ endif;
+ else:
+ $this->session->setFlashData('sweet-success', $message);
+ endif;
+
+ endif; // $noException && $successfulResult
+
+ endif; // ($requestMethod === 'post')
+
+ $this->viewData['clienteContactoEntity'] = isset($sanitizedData) ? new ClienteContactoEntity($sanitizedData) : new ClienteContactoEntity();
+ $this->viewData['clienteList'] = $this->getClienteListItems($clienteContactoEntity->cliente_id ?? null);
+
+ $this->viewData['formAction'] = route_to('createContactoDeCliente');
+
+ $this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('ClienteContactos.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
+
+
+ return $this->displayForm(__METHOD__);
+ } // end function add()
+
+ public function edit($requestedId = null)
+ {
+
+ if ($requestedId == null) :
+ return $this->redirect2listView();
+ endif;
+ $id = filter_var($requestedId, FILTER_SANITIZE_URL);
+ $clienteContactoEntity = $this->model->find($id);
+
+ if ($clienteContactoEntity == false) :
+ $message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('ClienteContactos.contactoDeCliente')), $id]);
+ return $this->redirect2listView('sweet-error', $message);
+ endif;
+
+ $requestMethod = $this->request->getMethod();
+
+ if ($requestMethod === 'post') :
+
+ $nullIfEmpty = true; // !(phpversion() >= '8.1');
+
+ $postData = $this->request->getPost();
+
+ $sanitizedData = $this->sanitized($postData, $nullIfEmpty);
+
+
+ $noException = true;
+ if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
+
+
+ if ($this->canValidate()) :
+ try {
+ $successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
+ } catch (\Exception $e) {
+ $noException = false;
+ $this->dealWithException($e);
+ }
+ else:
+ $this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('ClienteContactos.contactoDeCliente'))]);
+ $this->session->setFlashdata('formErrors', $this->model->errors());
+
+ endif;
+
+ $clienteContactoEntity->fill($sanitizedData);
+
+ $thenRedirect = false;
+ endif;
+ if ($noException && $successfulResult) :
+ $id = $clienteContactoEntity->id ?? $id;
+ $message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
+
+ if ($thenRedirect) :
+ if (!empty($this->indexRoute)) :
+ return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
+ else:
+ return $this->redirect2listView('sweet-success', $message);
+ endif;
+ else:
+ $this->session->setFlashData('sweet-success', $message);
+ endif;
+
+ endif; // $noException && $successfulResult
+ endif; // ($requestMethod === 'post')
+
+ $this->viewData['clienteContactoEntity'] = $clienteContactoEntity;
+ $this->viewData['clienteList'] = $this->getClienteListItems($clienteContactoEntity->cliente_id ?? null);
+
+ $this->viewData['formAction'] = route_to('updateContactoDeCliente', $id);
+
+ $this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('ClienteContactos.moduleTitle') . ' ' . lang('Basic.global.edit3');
+
+
+ return $this->displayForm(__METHOD__, $id);
+ } // end function edit(...)
+
+
+ public function datatable()
+ {
+ if ($this->request->isAJAX()) {
+ $reqData = $this->request->getPost();
+ if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
+ $errstr = 'No data available in response to this specific request.';
+ $response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
+ return $response;
+ }
+ $start = $reqData['start'] ?? 0;
+ $length = $reqData['length'] ?? 5;
+ $search = $reqData['search']['value'];
+ $requestedOrder = $reqData['order']['0']['column'] ?? 1;
+ $order = ClienteContactoModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 1];
+ $dir = $reqData['order']['0']['dir'] ?? 'asc';
+
+ $id_C = $reqData['id_cliente'] ?? -1;
+
+ $resourceData = $this->model->getResource("", $id_C)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
+
+ /*$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
+ foreach ($resourceData as $item) :
+ if (isset($item->apellidos) && strlen($item->apellidos) > 100) :
+ $item->apellidos = character_limiter($item->apellidos, 100);
+ endif;
+ endforeach;*/
+
+ return $this->respond(Collection::datatable(
+ $resourceData,
+ $this->model->getResource()->countAllResults(),
+ $this->model->getResource("", $id_C)->countAllResults()
+ ));
+ } else {
+ return $this->failUnauthorized('Invalid request', 403);
+ }
+ }
+
+ public function datatable_editor() {
+ if ($this->request->isAJAX()) {
+
+ include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
+
+ // Build our Editor instance and process the data coming from _POST
+ $response = Editor::inst( $db, 'cliente_contactos' )
+ ->fields(
+ Field::inst( 'nombre' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Falta nombre' )
+ ),
+ Field::inst( 'apellidos' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Falta apellidos' )
+ ),
+ Field::inst( 'cargo' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Falta cargp' )
+ ),
+ Field::inst( 'telefono' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Falta telefono' )
+ ),
+ Field::inst( 'email' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Falta email' )
+ ),
+
+ Field::inst( 'cliente_id' ),
+
+ )
+ ->validator( function($editor, $action, $data){
+ if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT){
+ /*foreach ($data['data'] as $pkey => $values ){
+ // No se pueden duplicar valores al crear o al editar
+ if (!empty($response)){
+ return $response;
+ }
+ }*/
+ }
+ })
+ ->debug(true)
+ ->process( $_POST )
+ ->data();
+
+ $newTokenHash = csrf_hash();
+ $csrfTokenName = csrf_token();
+
+ $response[$csrfTokenName] = $newTokenHash;
+
+ echo json_encode($response);
+
+ } else {
+ return $this->failUnauthorized('Invalid request', 403);
+ }
+ }
+
+ public function allItemsSelect()
+ {
+ if ($this->request->isAJAX()) {
+ $onlyActiveOnes = true;
+ $reqVal = $this->request->getPost('val') ?? 'id';
+ $menu = $this->model->getAllForMenu($reqVal . ', nombre', 'nombre', $onlyActiveOnes, false);
+ $nonItem = new \stdClass;
+ $nonItem->id = '';
+ $nonItem->nombre = '- ' . lang('Basic.global.None') . ' -';
+ array_unshift($menu, $nonItem);
+
+ $newTokenHash = csrf_hash();
+ $csrfTokenName = csrf_token();
+ $data = [
+ 'menu' => $menu,
+ $csrfTokenName => $newTokenHash
+ ];
+ return $this->respond($data);
+ } else {
+ return $this->failUnauthorized('Invalid request', 403);
+ }
+ }
+
+ public function menuItems()
+ {
+ if ($this->request->isAJAX()) {
+ $searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
+ $reqId = goSanitize($this->request->getPost('id'))[0];
+ $reqText = goSanitize($this->request->getPost('text'))[0];
+ $onlyActiveOnes = false;
+ $columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
+ $onlyActiveOnes = false;
+ $menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
+ $nonItem = new \stdClass;
+ $nonItem->id = '';
+ $nonItem->text = '- ' . lang('Basic.global.None') . ' -';
+ array_unshift($menu, $nonItem);
+
+ $newTokenHash = csrf_hash();
+ $csrfTokenName = csrf_token();
+ $data = [
+ 'menu' => $menu,
+ $csrfTokenName => $newTokenHash
+ ];
+ return $this->respond($data);
+ } else {
+ return $this->failUnauthorized('Invalid request', 403);
+ }
+ }
+
+
+ protected function getClienteListItems($selId = null)
+ {
+ $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Clientes.cliente'))])];
+ if (!empty($selId)) :
+ $clienteModel = model('App\Models\Clientes\ClienteModel');
+
+ $selOption = $clienteModel->where('id', $selId)->findColumn('nombre');
+ if (!empty($selOption)) :
+ $data[$selId] = $selOption[0];
+ endif;
+ endif;
+ return $data;
+ }
+
+}
diff --git a/ci4/app/Entities/Presupuestos/PresupuestoAcabadosEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoAcabadosEntity.php
new file mode 100644
index 00000000..61c87e5b
--- /dev/null
+++ b/ci4/app/Entities/Presupuestos/PresupuestoAcabadosEntity.php
@@ -0,0 +1,26 @@
+ null,
+ "presupuesto_id" => null,
+ "tarifa_acabado_id" => null,
+ "nombre" => null,
+ "precio" => null,
+ "precio_unidad" => null,
+ "tirada" => null,
+ "created_at" => null,
+ "updated_at" => null,
+ ];
+ protected $casts = [
+ "presupuesto_id" => "int",
+ "tarifa_acabado_id" => "int",
+ "precio" => "float",
+ "precio_unidad" => "float",
+ "tirada" => "int",
+ ];
+}
diff --git a/ci4/app/Language/en/Presupuestos.php b/ci4/app/Language/en/Presupuestos.php
index c7869387..843e0a33 100644
--- a/ci4/app/Language/en/Presupuestos.php
+++ b/ci4/app/Language/en/Presupuestos.php
@@ -10,6 +10,7 @@ return [
'datosPresupuesto' => 'Budget information',
'datosLibro' => 'Book information',
+ 'datosServicios' => 'Other Services',
'datosPresupuestoCliente' => 'Client budget data (comparator)',
'id' => 'Budget Number',
diff --git a/ci4/app/Language/es/Presupuestos.php b/ci4/app/Language/es/Presupuestos.php
index e2a545bb..d714c8c4 100644
--- a/ci4/app/Language/es/Presupuestos.php
+++ b/ci4/app/Language/es/Presupuestos.php
@@ -10,6 +10,7 @@ return [
'datosPresupuesto' => 'Datos generales del presupuesto',
'datosLibro' => 'Datos del libro',
+ 'datosServicios' => 'Otros Servicios',
'datosPresupuestoCliente' => 'Datos presupuesto cliente (comparador)',
'id' => 'Número Presupuesto',
@@ -85,6 +86,10 @@ return [
'solapasAnchoCubierta' => 'Ancho solapas cubierta',
'1cara' => '1 cara',
'2caras' => '2 caras',
+ 'servicioAcabado' => 'Servicio de acabado',
+ 'servicioPreimpresion' => 'Servicio de preimpresión',
+ 'servicioEncuadernado' => 'Servicio de encuadernado',
+ 'servicioManipulado' => 'Servicio de manipulado',
/* '4x0' => '4x0',
'4x4' => '4x4',
diff --git a/ci4/app/Models/Presupuestos/PresupuestoAcabadoModel.php b/ci4/app/Models/Presupuestos/PresupuestoAcabadoModel.php
new file mode 100644
index 00000000..75db712c
--- /dev/null
+++ b/ci4/app/Models/Presupuestos/PresupuestoAcabadoModel.php
@@ -0,0 +1,127 @@
+ "t1.nombre",
+ 1 => "t1.apellidos",
+ 2 => "t1.cargo",
+ 3 => "t1.telefono",
+ 4 => "t1.email",
+ ];
+
+ protected $allowedFields = ["cliente_id", "cargo", "nombre", "apellidos", "telefono", "email"];
+ protected $returnType = "App\Entities\Presupuestos\PresupuestoAcabadosEntity";
+
+ protected $useTimestamps = true;
+ protected $useSoftDeletes = false;
+
+ protected $createdField = "created_at";
+ protected $updatedField = "updated_at";
+
+ public static $labelField = "nombre";
+
+ protected $validationRules = [
+ "apellidos" => [
+ "label" => "ClienteContactos.apellidos",
+ "rules" => "trim|max_length[500]",
+ ],
+ "cargo" => [
+ "label" => "ClienteContactos.cargo",
+ "rules" => "trim|max_length[100]",
+ ],
+ "email" => [
+ "label" => "ClienteContactos.email",
+ "rules" => "trim|max_length[150]|valid_email|permit_empty",
+ ],
+ "nombre" => [
+ "label" => "ClienteContactos.nombre",
+ "rules" => "trim|max_length[100]",
+ ],
+ "telefono" => [
+ "label" => "ClienteContactos.telefono",
+ "rules" => "trim|max_length[20]",
+ ],
+ ];
+
+ protected $validationMessages = [
+ "apellidos" => [
+ "max_length" => "ClienteContactos.validation.apellidos.max_length",
+ ],
+ "cargo" => [
+ "max_length" => "ClienteContactos.validation.cargo.max_length",
+ ],
+ "email" => [
+ "max_length" => "ClienteContactos.validation.email.max_length",
+ "valid_email" => "ClienteContactos.validation.email.valid_email",
+ ],
+ "nombre" => [
+ "max_length" => "ClienteContactos.validation.nombre.max_length",
+ ],
+ "telefono" => [
+ "max_length" => "ClienteContactos.validation.telefono.max_length",
+ ],
+ ];
+
+ public function findAllWithClientes(string $selcols = "*", int $limit = null, int $offset = 0)
+ {
+ $sql =
+ "SELECT t1." .
+ $selcols .
+ ", t2.nombre AS cliente_id FROM " .
+ $this->table .
+ " t1 LEFT JOIN clientes t2 ON t1.cliente_id = t2.id";
+ if (!is_null($limit) && intval($limit) > 0) {
+ $sql .= " LIMIT " . $limit;
+ }
+
+ if (!is_null($offset) && intval($offset) > 0) {
+ $sql .= " OFFSET " . $offset;
+ }
+
+ $query = $this->db->query($sql);
+ $result = $query->getResultObject();
+ return $result;
+ }
+
+ /**
+ * Get resource data.
+ *
+ * @param string $search
+ *
+ * @return \CodeIgniter\Database\BaseBuilder
+ */
+ public function getResource(string $search = "", $presupuesto_id = -1)
+ {
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.id AS id, t1.cargo AS cargo, t1.nombre AS nombre, t1.apellidos AS apellidos, t1.telefono AS telefono, t1.email AS email, t1.cliente_id AS cliente_id"
+ );
+
+ $builder->where('t1.presupuesto_id', $presupuesto_id);
+ $builder->join("presupuestos t2", "t1.presupuesto_id = t2.id", "left");
+
+ return empty($search)
+ ? $builder
+ : $builder
+ ->groupStart()
+ ->like("t1.cargo", $search)
+ ->orLike("t1.nombre", $search)
+ ->orLike("t1.apellidos", $search)
+ ->orLike("t1.telefono", $search)
+ ->orLike("t1.email", $search)
+ ->groupEnd();
+ }
+}
diff --git a/ci4/app/Models/Tarifas/TarifaEncuadernacionModel.php b/ci4/app/Models/Tarifas/TarifaEncuadernacionModel.php
index 05be7bda..84c2630b 100644
--- a/ci4/app/Models/Tarifas/TarifaEncuadernacionModel.php
+++ b/ci4/app/Models/Tarifas/TarifaEncuadernacionModel.php
@@ -94,4 +94,22 @@ class TarifaEncuadernacionModel extends \App\Models\GoBaseModel
->like("t1.nombre", $search)
->groupEnd();
}
+
+ public function getServiciosEncuadernacionSelector()
+ {
+ /*
+ Todos los servicios de encuadernacion activas que se pueden usar en presupuestos
+ */
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.id as id, t1.nombre AS nombre"
+ )
+ ->where("t1.is_deleted", 0)
+ ->where("t1.mostrar_en_presupuesto", 1);
+
+ return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
+ }
+
+
}
diff --git a/ci4/app/Models/Tarifas/TarifaManipuladoModel.php b/ci4/app/Models/Tarifas/TarifaManipuladoModel.php
index 8afc3ab4..b8b7cfd1 100644
--- a/ci4/app/Models/Tarifas/TarifaManipuladoModel.php
+++ b/ci4/app/Models/Tarifas/TarifaManipuladoModel.php
@@ -93,4 +93,20 @@ class TarifaManipuladoModel extends \App\Models\GoBaseModel
->like("t1.nombre", $search)
->groupEnd();
}
+
+ public function getServiciosManipuladoSelector()
+ {
+ /*
+ Todos los servicios de manipulado activas que se pueden usar en presupuestos
+ */
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.id as id, t1.nombre AS nombre"
+ )
+ ->where("t1.is_deleted", 0)
+ ->where("t1.mostrar_en_presupuesto", 1);
+
+ return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
+ }
}
diff --git a/ci4/app/Models/Tarifas/TarifaacabadoModel.php b/ci4/app/Models/Tarifas/TarifaacabadoModel.php
index 8d9d209d..079296ee 100644
--- a/ci4/app/Models/Tarifas/TarifaacabadoModel.php
+++ b/ci4/app/Models/Tarifas/TarifaacabadoModel.php
@@ -94,4 +94,22 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
->like("t1.nombre", $search)
->groupEnd();
}
+
+ public function getServiciosAcabadoSelector()
+ {
+ /*
+ Todos los servicios de acabado activos que se pueden usar en presupuestos
+ */
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.id as id, t1.nombre AS nombre"
+ )
+ ->where("t1.is_deleted", 0)
+ ->where("t1.mostrar_en_presupuesto", 1);
+
+ return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
+ }
+
+
}
diff --git a/ci4/app/Models/Tarifas/TarifapreimpresionModel.php b/ci4/app/Models/Tarifas/TarifapreimpresionModel.php
index 0de5263f..6c2f16b3 100644
--- a/ci4/app/Models/Tarifas/TarifapreimpresionModel.php
+++ b/ci4/app/Models/Tarifas/TarifapreimpresionModel.php
@@ -79,4 +79,22 @@ class TarifapreimpresionModel extends \App\Models\GoBaseModel
"decimal" => "Tarifapreimpresion.validation.margen.decimal",
],
];
+
+ public function getServiciosPreimpresionSelector()
+ {
+ /*
+ Todos los servicios de preimpresion activas que se pueden usar en presupuestos
+ */
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.id as id, t1.nombre AS nombre"
+ )
+ ->where("t1.is_deleted", 0)
+ ->where("t1.mostrar_en_presupuesto", 1);
+
+ return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
+ }
+
+
}
diff --git a/ci4/app/Views/themes/_commonPartialsBs/_confirm2delete.php b/ci4/app/Views/themes/_commonPartialsBs/_confirm2delete.php
index 50e7ee0b..56322188 100644
--- a/ci4/app/Views/themes/_commonPartialsBs/_confirm2delete.php
+++ b/ci4/app/Views/themes/_commonPartialsBs/_confirm2delete.php
@@ -13,7 +13,7 @@
diff --git a/ci4/app/Views/themes/_commonPartialsBs/datatables.php b/ci4/app/Views/themes/_commonPartialsBs/datatables.php
index 6ee8d97d..c8224ef3 100644
--- a/ci4/app/Views/themes/_commonPartialsBs/datatables.php
+++ b/ci4/app/Views/themes/_commonPartialsBs/datatables.php
@@ -175,6 +175,12 @@
$(this).find('.btn-confirm').attr('href', $(e.relatedTarget).data('href'));
});
+ $('#confirm2delete').keypress(function(e) { // Attach the form handler to the keypress event
+ if (e.keyCode == 13) { // If the the enter key was pressed.
+ $('#confirmDelete').click(); // Trigger the button(elementId) click event.
+ }
+ });
+
function toggleAllCheckboxes($cssClass, $io=null) {
$('.'+$cssClass).prop('checked', $io);
}
diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.php
new file mode 100644
index 00000000..113a843f
--- /dev/null
+++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.php
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+
Proximanente
+
+
+
+
Proximanente
+
+
+
+
Proximanente
+
+
+
+
Proximanente
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaForm.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaForm.php
index d935982a..5aa7a7b7 100644
--- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaForm.php
+++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaForm.php
@@ -17,6 +17,7 @@
= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoItems") ?>
= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems") ?>
= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems") ?>
+ = view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems") ?>