diff --git a/ci4/.env b/ci4/.env index 347f66d5..cfd0651b 100644 --- a/ci4/.env +++ b/ci4/.env @@ -22,7 +22,7 @@ CI_ENVIRONMENT = development # APP #-------------------------------------------------------------------- -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/Config/Routes.php b/ci4/app/Config/Routes.php index 01b4b1e4..a5859bb6 100644 --- a/ci4/app/Config/Routes.php +++ b/ci4/app/Config/Routes.php @@ -456,6 +456,20 @@ $routes->group('clientecontactos', ['namespace' => 'App\Controllers\Clientes'], }); $routes->resource('ClienteContactos', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'ClienteContactos', 'except' => 'show,new,create,update']); + +$routes->group('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) { + $routes->get('', 'Cosidotapablanda::index', ['as' => 'cosidotapablandaList']); + $routes->get('add', 'Cosidotapablanda::add', ['as' => 'newCosidotapablanda']); + $routes->post('add', 'Cosidotapablanda::add', ['as' => 'createCosidotapablanda']); + $routes->post('create', 'Cosidotapablanda::create', ['as' => 'ajaxCreateCosidotapablanda']); + $routes->put('(:num)/update', 'Cosidotapablanda::update/$1', ['as' => 'ajaxUpdateCosidotapablanda']); + $routes->post('(:num)/edit', 'Cosidotapablanda::edit/$1', ['as' => 'updateCosidotapablanda']); + $routes->post('datatable', 'Cosidotapablanda::datatable', ['as' => 'dataTableOfCosidotapablanda']); + $routes->post('allmenuitems', 'Cosidotapablanda::allItemsSelect', ['as' => 'select2ItemsOfCosidotapablanda']); + $routes->post('menuitems', 'Cosidotapablanda::menuItems', ['as' => 'menuItemsOfCosidotapablanda']); +}); +$routes->resource('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Cosidotapablanda', 'except' => 'show,new,create,update']); + /* * -------------------------------------------------------------------- * Additional Routing diff --git a/ci4/app/Controllers/Configuracion/Papelformato.php b/ci4/app/Controllers/Configuracion/Papelformato.php new file mode 100644 index 00000000..df76ceb1 --- /dev/null +++ b/ci4/app/Controllers/Configuracion/Papelformato.php @@ -0,0 +1,271 @@ +viewData['pageTitle'] = lang('LgPapelFormatoes.moduleTitle'); + $this->viewData['usingSweetAlert'] = true; + parent::initController($request, $response, $logger); + } + + + public function index() { + + $viewData = [ + 'currentModule' => static::$controllerSlug, + 'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('LgPapelFormatoes.papelFormato')]), + 'papelFormatoEntity' => new PapelFormatoEntity(), + 'usingServerSideDataTable' => true, + + ]; + + $viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class + + return view(static::$viewPath.'viewPapelFormatoList', $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', [mb_strtolower(lang('LgPapelFormatoes.papelFormato'))]); + $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', [mb_strtolower(lang('LgPapelFormatoes.papelFormato'))]).'.'; + $message .= anchor( "admin/papelformato/{$id}/edit" , lang('Basic.global.continueEditing').'?'); + $message = ucfirst(str_replace("'", "\'", $message)); + + 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['papelFormatoEntity'] = isset($sanitizedData) ? new PapelFormatoEntity($sanitizedData) : new PapelFormatoEntity(); + + $this->viewData['formAction'] = route_to('createPapelFormato'); + + $this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('LgPapelFormatoes.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); + $papelFormatoEntity = $this->model->find($id); + + if ($papelFormatoEntity == false) : + $message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('LgPapelFormatoes.papelFormato')), $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('LgPapelFormatoes.papelFormato'))]); + $this->session->setFlashdata('formErrors', $this->model->errors()); + + endif; + + $papelFormatoEntity->fill($sanitizedData); + + $thenRedirect = true; + endif; + if ($noException && $successfulResult) : + $id = $papelFormatoEntity->id ?? $id; + $message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('LgPapelFormatoes.papelFormato'))]).'.'; + $message .= anchor( "admin/papelformato/{$id}/edit" , lang('Basic.global.continueEditing').'?'); + $message = ucfirst(str_replace("'", "\'", $message)); + + 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['papelFormatoEntity'] = $papelFormatoEntity; + + $this->viewData['formAction'] = route_to('updatePapelFormato', $id); + + $this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('LgPapelFormatoes.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 = PapelFormatoModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1]; + $dir = $reqData['order']['0']['dir'] ?? 'asc'; + + $resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject(); + + return $this->respond(Collection::datatable( + $resourceData, + $this->model->getResource()->countAllResults(), + $this->model->getResource($search)->countAllResults() + )); + } 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.', ancho', 'ancho', $onlyActiveOnes, false); + $nonItem = new \stdClass; + $nonItem->id = ''; + $nonItem->ancho = '- '.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 ?? 'ancho']; + $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); + } + } + +} diff --git a/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php b/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php index 234d3696..520929dc 100644 --- a/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php +++ b/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php @@ -1,19 +1,966 @@ viewData['pageTitle'] = lang('Presupuestos.moduleTitleCosidoTB'); + $this->viewData['usingSweetAlert'] = true; + + // Se indica que este controlador trabaja con soft_delete + $this->soft_delete = true; + // Se indica el flag para los ficheros borrados + $this->delete_flag = 1; + + $this->viewData = ['usingServerSideDataTable' => true]; // JJO + + // Breadcrumbs + $this->viewData['breadcrumb'] = [ + ['title' => lang("App.menu_presupuestos"), 'route' => "javascript:void(0);", 'active' => false], + ['title' => lang("App.menu_libros_cosido_tapa_blanda"), 'route' => site_url('presupuestos/cosidotapablanda'), 'active' => true] + ]; + + parent::initController($request, $response, $logger); + $this->model = new PresupuestoModel(); } + public function index() { - echo 'Presupuesto >> Libros >> Cosido tapa blanda [en desarrollo].'; + + $viewData = [ + 'currentModule' => static::$controllerSlug, + 'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Presupuestos.presupuesto')]), + 'presupuestoEntity' => new PresupuestoEntity(), + 'usingServerSideDataTable' => true, + + ]; + + $viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class + + return view(static::$viewPath . 'viewCosidotapablandaList', $viewData); } + + + public function add() + { + + // JJO + $session = session(); + + $requestMethod = $this->request->getMethod(); + + if ($requestMethod === 'post') : + + $nullIfEmpty = true; // !(phpversion() >= '8.1'); + + $postData = $this->request->getPost(); + + $sanitizedData = $this->sanitized($postData, $nullIfEmpty); + + // JJO + $sanitizedData['user_created_id'] = $session->id_user; + + $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', [mb_strtolower(lang('Presupuestos.presupuesto'))]); + $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', [mb_strtolower(lang('Presupuestos.presupuesto'))]) . '.'; + $message .= anchor("admin/presupuestos/{$id}/edit", lang('Basic.global.continueEditing') . '?'); + $message = ucfirst(str_replace("'", "\'", $message)); + + if ($thenRedirect) : + if (!empty($this->indexRoute)) : + //return redirect()->to(route_to( $this->indexRoute ) )->with('sweet-success', $message); + return redirect()->to(site_url('presupuestos/presupuestos/edit/' . $id))->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['presupuestoEntity'] = isset($sanitizedData) ? new PresupuestoEntity($sanitizedData) : new PresupuestoEntity(); + $this->viewData['clienteList'] = $this->getClienteListItems($presupuestoEntity->cliente_id ?? null); + $this->viewData['incReiList'] = array('incidencia'=>lang('Presupuestos.incidencia'), 'reimpresion'=>lang('Presupuestos.reimpresion'), 'sin_cargo'=>lang('Presupuestos.sinCargo')); + $this->viewData['paisList'] = $this->getPaisListItems(); + $this->viewData['papelFormatoList'] = $this->getPapelFormatoListItems($presupuestoEntity->papel_formato_id ?? null); + $this->viewData['papelGenericoNegroList'] = $this->getPapelGenericoNegro(); + $this->viewData['papelGenericoNegroHQList'] = $this->getPapelGenericoNegroHQ(); + $this->viewData['papelGenericoColorList'] = $this->getPapelGenericoColor(); + $this->viewData['papelGenericoColorHQList'] = $this->getPapelGenericoColorHQ(); + $this->viewData['papelGenericoCubiertaList'] = $this->getPapelGenericoCubierta(); + $this->viewData['papelGenericoSobrecubiertaList'] = $this->getPapelGenericoSobreCubierta(); + + + + /* + + $this->viewData['formaPagoList'] = $this->getFormaPagoListItems(); + $this->viewData['tiposImpresionList'] = $this->getTiposImpresionListItems($presupuestoEntity->tipo_impresion_id ?? null); + $this->viewData['tipologiasLibroList'] = $this->getTipologiasLibroListItems($presupuestoEntity->tipologia_id ?? null); + + $this->viewData['ubicacionLibroList'] = $this->getUbicacionLibroListItems($presupuestoEntity->ubicacion_id ?? null); + $this->viewData['presupuestoEstadoList'] = $this->getPresupuestoEstadoListItems($presupuestoEntity->estado_id ?? null); + + $this->viewData['papelGenericoList'] = $this->getPapelGenericoListItems($presupuestoEntity->paginas_negro_papel_id ?? null); + $this->viewData['papelImpresionList'] = $this->getPapelImpresionListItems($presupuestoEntity->paginas_negro_papel_impresion_id ?? null); + $this->viewData['maquinaList'] = $this->getMaquinaListItems($presupuestoEntity->paginas_negro_maquina_id ?? null); + $this->viewData['maquinasTarifasImpresionList'] = $this->getMaquinasTarifasImpresionListItems($presupuestoEntity->paginas_negro_tarifa_impresion_id ?? null); + $this->viewData['papelGenericoList2'] = $this->getPapelGenericoListItems2($presupuestoEntity->paginas_color_papel_id ?? null); + $this->viewData['papelImpresionList2'] = $this->getPapelImpresionListItems2($presupuestoEntity->paginas_color_papel_impresion_id ?? null); + $this->viewData['maquinaList2'] = $this->getMaquinaListItems2($presupuestoEntity->paginas_color_maquina_id ?? null); + $this->viewData['maquinasTarifasImpresionList2'] = $this->getMaquinasTarifasImpresionListItems2($presupuestoEntity->paginas_color_tarifa_impresion_id ?? null); + $this->viewData['papelGenericoList3'] = $this->getPapelGenericoListItems3($presupuestoEntity->paginas_portada_papel_id ?? null); + $this->viewData['papelImpresionList3'] = $this->getPapelImpresionListItems3($presupuestoEntity->paginas_portada_papel_impresion_id ?? null); + $this->viewData['maquinaList3'] = $this->getMaquinaListItems3($presupuestoEntity->paginas_portada_maquina_id ?? null); + $this->viewData['maquinasTarifasImpresionList3'] = $this->getMaquinasTarifasImpresionListItems3($presupuestoEntity->paginas_portada_tarifa_impresion_id ?? null); + $this->viewData['papelGenericoList4'] = $this->getPapelGenericoListItems4($presupuestoEntity->paginas_cubierta_papel_id ?? null); + $this->viewData['papelImpresionList4'] = $this->getPapelImpresionListItems4($presupuestoEntity->paginas_cubierta_papel_impresion_id ?? null); + $this->viewData['maquinaList4'] = $this->getMaquinaListItems4($presupuestoEntity->paginas_cubierta_maquina_id ?? null); + $this->viewData['maquinasTarifasImpresionList4'] = $this->getMaquinasTarifasImpresionListItems4($presupuestoEntity->paginas_cubierta_tarifa_impresion_id ?? null); + $this->viewData['userList'] = $this->getUserListItems($presupuestoEntity->total_confirmado_user_id ?? null); + $this->viewData['userList2'] = $this->getUserListItems2($presupuestoEntity->aprobado_user_id ?? null); + $this->viewData['userList3'] = $this->getUserListItems3($presupuestoEntity->pedido_espera_user_id ?? null); + $this->viewData['paginasCubiertaList'] = $this->getPaginasCubiertaOptions(); + $this->viewData['paginasPortadaList'] = $this->getPaginasPortadaOptions(); + */ + $this->viewData['formAction'] = route_to('createCosidotapablanda'); + + $this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Presupuestos.moduleTitleCosidoTB') . ' ' . lang('Basic.global.addNewSuffix'); + + /* TEST JS LOADER */ + //$this->viewData['global_js_variables'] = array('jsVarTest' => "'Hola Jaime'"); + + + return $this->displayForm(__METHOD__); + } // end function add() + + public function edit($requestedId = null) + { + + // JJO + $session = session(); + + if ($requestedId == null) : + return $this->redirect2listView(); + endif; + $id = filter_var($requestedId, FILTER_SANITIZE_URL); + $presupuestoEntity = $this->model->find($id); + + if ($presupuestoEntity == false) : + $message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Presupuestos.presupuesto')), $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); + if ($this->request->getPost('recoger_en_taller') == null) { + $sanitizedData['recoger_en_taller'] = false; + } + if ($this->request->getPost('ferro') == null) { + $sanitizedData['ferro'] = false; + } + if ($this->request->getPost('ferro_digital') == null) { + $sanitizedData['ferro_digital'] = false; + } + if ($this->request->getPost('marcapaginas') == null) { + $sanitizedData['marcapaginas'] = false; + } + if ($this->request->getPost('papel_formato_personalizado') == null) { + $sanitizedData['papel_formato_personalizado'] = false; + } + if ($this->request->getPost('solapas') == null) { + $sanitizedData['solapas'] = false; + } + if ($this->request->getPost('cosido') == null) { + $sanitizedData['cosido'] = false; + } + if ($this->request->getPost('cubiertas') == null) { + $sanitizedData['cubiertas'] = false; + } + if ($this->request->getPost('imagenes_bn_interior') == null) { + $sanitizedData['imagenes_bn_interior'] = false; + } + if ($this->request->getPost('en_produccion') == null) { + $sanitizedData['en_produccion'] = false; + } + if ($this->request->getPost('en_espera') == null) { + $sanitizedData['en_espera'] = false; + } + if ($this->request->getPost('modo_comparador') == null) { + $sanitizedData['modo_comparador'] = false; + } + if ($this->request->getPost('paginas_negro_hq') == null) { + $sanitizedData['paginas_negro_hq'] = false; + } + if ($this->request->getPost('paginas_negro_check_papel_total') == null) { + $sanitizedData['paginas_negro_check_papel_total'] = false; + } + if ($this->request->getPost('paginas_negro_check_impresion_total') == null) { + $sanitizedData['paginas_negro_check_impresion_total'] = false; + } + if ($this->request->getPost('paginas_color_check_papel_total') == null) { + $sanitizedData['paginas_color_check_papel_total'] = false; + } + if ($this->request->getPost('paginas_color_check_impresion_total') == null) { + $sanitizedData['paginas_color_check_impresion_total'] = false; + } + if ($this->request->getPost('paginas_portada_check_papel_total') == null) { + $sanitizedData['paginas_portada_check_papel_total'] = false; + } + if ($this->request->getPost('paginas_portada_check_impresion_total') == null) { + $sanitizedData['paginas_portada_check_impresion_total'] = false; + } + if ($this->request->getPost('paginas_cubierta_papel_impresion_id') == null) { + $sanitizedData['paginas_cubierta_papel_impresion_id'] = false; + } + if ($this->request->getPost('paginas_cubierta_check_papel_total') == null) { + $sanitizedData['paginas_cubierta_check_papel_total'] = false; + } + if ($this->request->getPost('paginas_cubierta_check_impresion_total') == null) { + $sanitizedData['paginas_cubierta_check_impresion_total'] = false; + } + if ($this->request->getPost('isDig') == null) { + $sanitizedData['isDig'] = false; + } + if ($this->request->getPost('envios_recoge_cliente') == null) { + $sanitizedData['envios_recoge_cliente'] = false; + } + if ($this->request->getPost('fecha_entrega_real_aviso') == null) { + $sanitizedData['fecha_entrega_real_aviso'] = false; + } + + // JJO + $sanitizedData['user_updated_id'] = $session->id_user; + + $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('Presupuestos.presupuesto'))]); + $this->session->setFlashdata('formErrors', $this->model->errors()); + + endif; + + $presupuestoEntity->fill($sanitizedData); + + $thenRedirect = true; + endif; + if ($noException && $successfulResult) : + $id = $presupuestoEntity->id ?? $id; + $message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Presupuestos.presupuesto'))]) . '.'; + $message .= anchor("admin/presupuestos/{$id}/edit", lang('Basic.global.continueEditing') . '?'); + $message = ucfirst(str_replace("'", "\'", $message)); + + 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['presupuestoEntity'] = $presupuestoEntity; + $this->viewData['clienteList'] = $this->getClienteListItems($presupuestoEntity->cliente_id ?? null); + $this->viewData['formaPagoList'] = $this->getFormaPagoListItems(); + $this->viewData['tiposImpresionList'] = $this->getTiposImpresionListItems($presupuestoEntity->tipo_impresion_id ?? null); + $this->viewData['tipologiasLibroList'] = $this->getTipologiasLibroListItems($presupuestoEntity->tipologia_id ?? null); + $this->viewData['paisList'] = $this->getPaisListItems(); + $this->viewData['ubicacionLibroList'] = $this->getUbicacionLibroListItems($presupuestoEntity->ubicacion_id ?? null); + $this->viewData['presupuestoEstadoList'] = $this->getPresupuestoEstadoListItems($presupuestoEntity->estado_id ?? null); + $this->viewData['papelFormatoList'] = $this->getPapelFormatoListItems($presupuestoEntity->papel_formato_id ?? null); + $this->viewData['papelGenericoList'] = $this->getPapelGenericoListItems($presupuestoEntity->paginas_negro_papel_id ?? null); + $this->viewData['papelImpresionList'] = $this->getPapelImpresionListItems($presupuestoEntity->paginas_negro_papel_impresion_id ?? null); + $this->viewData['maquinaList'] = $this->getMaquinaListItems($presupuestoEntity->paginas_negro_maquina_id ?? null); + $this->viewData['maquinasTarifasImpresionList'] = $this->getMaquinasTarifasImpresionListItems($presupuestoEntity->paginas_negro_tarifa_impresion_id ?? null); + $this->viewData['papelGenericoList2'] = $this->getPapelGenericoListItems2($presupuestoEntity->paginas_color_papel_id ?? null); + $this->viewData['papelImpresionList2'] = $this->getPapelImpresionListItems2($presupuestoEntity->paginas_color_papel_impresion_id ?? null); + $this->viewData['maquinaList2'] = $this->getMaquinaListItems2($presupuestoEntity->paginas_color_maquina_id ?? null); + $this->viewData['maquinasTarifasImpresionList2'] = $this->getMaquinasTarifasImpresionListItems2($presupuestoEntity->paginas_color_tarifa_impresion_id ?? null); + $this->viewData['papelGenericoList3'] = $this->getPapelGenericoListItems3($presupuestoEntity->paginas_portada_papel_id ?? null); + $this->viewData['papelImpresionList3'] = $this->getPapelImpresionListItems3($presupuestoEntity->paginas_portada_papel_impresion_id ?? null); + $this->viewData['maquinaList3'] = $this->getMaquinaListItems3($presupuestoEntity->paginas_portada_maquina_id ?? null); + $this->viewData['maquinasTarifasImpresionList3'] = $this->getMaquinasTarifasImpresionListItems3($presupuestoEntity->paginas_portada_tarifa_impresion_id ?? null); + $this->viewData['papelGenericoList4'] = $this->getPapelGenericoListItems4($presupuestoEntity->paginas_cubierta_papel_id ?? null); + $this->viewData['papelImpresionList4'] = $this->getPapelImpresionListItems4($presupuestoEntity->paginas_cubierta_papel_impresion_id ?? null); + $this->viewData['maquinaList4'] = $this->getMaquinaListItems4($presupuestoEntity->paginas_cubierta_maquina_id ?? null); + $this->viewData['maquinasTarifasImpresionList4'] = $this->getMaquinasTarifasImpresionListItems4($presupuestoEntity->paginas_cubierta_tarifa_impresion_id ?? null); + $this->viewData['userList'] = $this->getUserListItems($presupuestoEntity->total_confirmado_user_id ?? null); + $this->viewData['userList2'] = $this->getUserListItems2($presupuestoEntity->aprobado_user_id ?? null); + $this->viewData['userList3'] = $this->getUserListItems3($presupuestoEntity->pedido_espera_user_id ?? null); + $this->viewData['paginasCubiertaList'] = $this->getPaginasCubiertaOptions(); + $this->viewData['paginasPortadaList'] = $this->getPaginasPortadaOptions(); + + $this->viewData['papelGenericoNegroList'] = $this->getPapelGenericoNegro(); + $this->viewData['papelGenericoNegroHQList'] = $this->getPapelGenericoNegroHQ(); + $this->viewData['papelGenericoColorList'] = $this->getPapelGenericoColor(); + $this->viewData['papelGenericoColorHQList'] = $this->getPapelGenericoColorHQ(); + $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'); + + + 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'] ?? 0; + $order = PresupuestoModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 0]; + $dir = $reqData['order']['0']['dir'] ?? 'asc'; + + $resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject(); + foreach ($resourceData as $item) : + if (isset($item->comentarios_pdf) && strlen($item->comentarios_pdf) > 100) : + $item->comentarios_pdf = character_limiter($item->comentarios_pdf, 100); + endif; + if (isset($item->causa_cancelacion) && strlen($item->causa_cancelacion) > 100) : + $item->causa_cancelacion = character_limiter($item->causa_cancelacion, 100); + endif; + if (isset($item->comentarios) && strlen($item->comentarios) > 100) : + $item->comentarios = character_limiter($item->comentarios, 100); + endif; + if (isset($item->comentarios_safekat) && strlen($item->comentarios_safekat) > 100) : + $item->comentarios_safekat = character_limiter($item->comentarios_safekat, 100); + endif; + if (isset($item->comentarios_tarifa) && strlen($item->comentarios_tarifa) > 100) : + $item->comentarios_tarifa = character_limiter($item->comentarios_tarifa, 100); + endif; + if (isset($item->tirada_alternativa_json_data) && strlen($item->tirada_alternativa_json_data) > 100) : + $item->tirada_alternativa_json_data = character_limiter($item->tirada_alternativa_json_data, 100); + endif; + if (isset($item->titulo) && strlen($item->titulo) > 100) : + $item->titulo = character_limiter($item->titulo, 100); + endif; + if (isset($item->paginas_color_posicion) && strlen($item->paginas_color_posicion) > 100) : + $item->paginas_color_posicion = character_limiter($item->paginas_color_posicion, 100); + endif; + if (isset($item->aprobado_json_data) && strlen($item->aprobado_json_data) > 100) : + $item->aprobado_json_data = character_limiter($item->aprobado_json_data, 100); + endif; + if (isset($item->comparador_json_data) && strlen($item->comparador_json_data) > 100) : + $item->comparador_json_data = character_limiter($item->comparador_json_data, 100); + endif; + if (isset($item->ws_externo_json_data) && strlen($item->ws_externo_json_data) > 100) : + $item->ws_externo_json_data = character_limiter($item->ws_externo_json_data, 100); + endif; + endforeach; + + return $this->respond(Collection::datatable( + $resourceData, + $this->model->getResource()->countAllResults(), + $this->model->getResource($search)->countAllResults() + )); + } 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 . ', titulo', 'titulo', $onlyActiveOnes, false); + $nonItem = new \stdClass; + $nonItem->id = ''; + $nonItem->titulo = '- ' . 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()) { + + $reqData = $this->request->getPost(); + + $tipo = $reqData['tipo'] ?? null; + $datos = $reqData['datos'] ?? null; + $searchStr = goSanitize($this->request->getPost('searchTerm'))[0]; + + + if ($tipo == 'gramaje'){ + // En este caso contiene el nombre del papel generico + $model = new PapelGenericoModel(); + $menu = $model->getGramajeComparador($datos, $searchStr); + } + + + $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; + } + + protected function getPaisListItems() + { + $paisModel = model('App\Models\Configuracion\PaisModel'); + $onlyActiveOnes = true; + $data = $paisModel->getAllForMenu('id, nombre', 'nombre', $onlyActiveOnes); + + return $data; + } + + protected function getPapelFormatoListItems($selId = null) + { + $papelFormatoModel = model('App\Models\Configuracion\PapelFormatoModel'); + $data = $papelFormatoModel->getElementsForMenu(); + array_unshift($data, (object)['id'=>'', 'tamanio' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papelFormatoId'))])]); + return $data; + } + + protected function getPapelGenericoNegro() + { + $model = model('App\Models\Configuracion\PapelGenericoModel'); + $data = $model->getPapelForComparador('negro', false, false); + array_unshift($data, lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])); + return $data; + } + + protected function getPapelGenericoNegroHQ() + { + $model = model('App\Models\Configuracion\PapelGenericoModel'); + $data = $model->getPapelForComparador('negrohq', false, false); + array_unshift($data, lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])); + return $data; + } + + protected function getPapelGenericoColor() + { + $model = model('App\Models\Configuracion\PapelGenericoModel'); + $data = $model->getPapelForComparador('color', false, false); + array_unshift($data, lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])); + return $data; + } + + protected function getPapelGenericoColorHQ() + { + $model = model('App\Models\Configuracion\PapelGenericoModel'); + $data = $model->getPapelForComparador('colorhq', false, false); + array_unshift($data, lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])); + return $data; + } + + protected function getPapelGenericoCubierta() + { + $model = model('App\Models\Configuracion\PapelGenericoModel'); + $data = $model->getPapelForComparador('color', true, false); + array_unshift($data, lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])); + return $data; + } + + protected function getPapelGenericoSobreCubierta() + { + $model = model('App\Models\Configuracion\PapelGenericoModel'); + $data = $model->getPapelForComparador('color', false, true); + array_unshift($data, lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])); + return $data; + } + + /* + + + + + + protected function getUbicacionLibroListItems($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('LgUbicacionesLibros.ubicacionLibro'))])]; + if (!empty($selId)) : + $ubicacionesLibroModel = model('App\Models\Configuracion\UbicacionesLibroModel'); + + $selOption = $ubicacionesLibroModel->where('id', $selId)->findColumn('nombre'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getFormaPagoListItems() + { + $formasPagoModel = model('App\Models\Configuracion\FormasPagoModel'); + $onlyActiveOnes = true; + $data = $formasPagoModel->getAllForMenu('id, nombre', 'nombre', $onlyActiveOnes); + + return $data; + } + + + protected function getPapelImpresionListItems4($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelImpresions.papelImpresion'))])]; + if (!empty($selId)) : + $papelImpresionModel = model('App\Models\Presupuestos\PapelImpresionModel'); + + $selOption = $papelImpresionModel->where('id', $selId)->findColumn('nombre'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getPresupuestoEstadoListItems($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PresupuestoEstados.presupuestoEstado'))])]; + if (!empty($selId)) : + $presupuestoEstadoModel = model('App\Models\Presupuestos\PresupuestoEstadoModel'); + + $selOption = $presupuestoEstadoModel->where('id', $selId)->findColumn('estado'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getPapelGenericoListItems3($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelGenericoes.papelGenerico'))])]; + if (!empty($selId)) : + $papelGenericoModel = model('App\Models\Presupuestos\PapelGenericoModel'); + + $selOption = $papelGenericoModel->where('id', $selId)->findColumn('nombre'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getPapelImpresionListItems2($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelImpresions.papelImpresion'))])]; + if (!empty($selId)) : + $papelImpresionModel = model('App\Models\Presupuestos\PapelImpresionModel'); + + $selOption = $papelImpresionModel->where('id', $selId)->findColumn('nombre'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getMaquinaListItems3($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])]; + if (!empty($selId)) : + $maquinaModel = model('App\Models\Presupuestos\MaquinaModel'); + + $selOption = $maquinaModel->where('id', $selId)->findColumn('nombre'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getMaquinasTarifasImpresionListItems2($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifasImpresion'))])]; + if (!empty($selId)) : + $maquinasTarifasImpresionModel = model('App\Models\Presupuestos\MaquinasTarifasImpresionModel'); + + $selOption = $maquinasTarifasImpresionModel->where('id', $selId)->findColumn('precio'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getPapelGenericoListItems2($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelGenericoes.papelGenerico'))])]; + if (!empty($selId)) : + $papelGenericoModel = model('App\Models\Presupuestos\PapelGenericoModel'); + + $selOption = $papelGenericoModel->where('id', $selId)->findColumn('nombre'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getMaquinaListItems($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])]; + if (!empty($selId)) : + $maquinaModel = model('App\Models\Presupuestos\MaquinaModel'); + + $selOption = $maquinaModel->where('id', $selId)->findColumn('nombre'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + + + protected function getMaquinaListItems2($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])]; + if (!empty($selId)) : + $maquinaModel = model('App\Models\Presupuestos\MaquinaModel'); + + $selOption = $maquinaModel->where('id', $selId)->findColumn('nombre'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getTipologiasLibroListItems($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('TipologiasLibros.tipologiasLibro'))])]; + if (!empty($selId)) : + $tipologiasLibroModel = model('App\Models\Presupuestos\TipologiasLibroModel'); + + $selOption = $tipologiasLibroModel->where('id', $selId)->findColumn('nombre'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getPapelImpresionListItems3($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelImpresions.papelImpresion'))])]; + if (!empty($selId)) : + $papelImpresionModel = model('App\Models\Presupuestos\PapelImpresionModel'); + + $selOption = $papelImpresionModel->where('id', $selId)->findColumn('nombre'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getMaquinasTarifasImpresionListItems4($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifasImpresion'))])]; + if (!empty($selId)) : + $maquinasTarifasImpresionModel = model('App\Models\Presupuestos\MaquinasTarifasImpresionModel'); + + $selOption = $maquinasTarifasImpresionModel->where('id', $selId)->findColumn('precio'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getUserListItems($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])]; + if (!empty($selId)) : + $userModel = model('App\Models\Presupuestos\UserModel'); + + $selOption = $userModel->where('id_user', $selId)->findColumn('first_name'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getMaquinasTarifasImpresionListItems3($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifasImpresion'))])]; + if (!empty($selId)) : + $maquinasTarifasImpresionModel = model('App\Models\Presupuestos\MaquinasTarifasImpresionModel'); + + $selOption = $maquinasTarifasImpresionModel->where('id', $selId)->findColumn('id'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getUserListItems3($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])]; + if (!empty($selId)) : + $userModel = model('App\Models\Presupuestos\UserModel'); + + $selOption = $userModel->where('id_user', $selId)->findColumn('first_name'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getPapelImpresionListItems($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelImpresions.papelImpresion'))])]; + if (!empty($selId)) : + $papelImpresionModel = model('App\Models\Presupuestos\PapelImpresionModel'); + + $selOption = $papelImpresionModel->where('id', $selId)->findColumn('nombre'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getTiposImpresionListItems($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('TiposImpresions.tiposImpresion'))])]; + if (!empty($selId)) : + $tiposImpresionModel = model('App\Models\Presupuestos\TiposImpresionModel'); + + $selOption = $tiposImpresionModel->where('id', $selId)->findColumn('nombre'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getMaquinasTarifasImpresionListItems($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifasImpresion'))])]; + if (!empty($selId)) : + $maquinasTarifasImpresionModel = model('App\Models\Presupuestos\MaquinasTarifasImpresionModel'); + + $selOption = $maquinasTarifasImpresionModel->where('id', $selId)->findColumn('precio'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getPapelGenericoListItems4($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelGenericoes.papelGenerico'))])]; + if (!empty($selId)) : + $papelGenericoModel = model('App\Models\Presupuestos\PapelGenericoModel'); + + $selOption = $papelGenericoModel->where('id', $selId)->findColumn('nombre'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + + protected function getMaquinaListItems4($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])]; + if (!empty($selId)) : + $maquinaModel = model('App\Models\Presupuestos\MaquinaModel'); + + $selOption = $maquinaModel->where('id', $selId)->findColumn('nombre'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getUserListItems2($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])]; + if (!empty($selId)) : + $userModel = model('App\Models\Presupuestos\UserModel'); + + $selOption = $userModel->where('id_user', $selId)->findColumn('first_name'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getPapelGenericoListItems($selId = null) + { + $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelGenericoes.papelGenerico'))])]; + if (!empty($selId)) : + $papelGenericoModel = model('App\Models\Presupuestos\PapelGenericoModel'); + + $selOption = $papelGenericoModel->where('id', $selId)->findColumn('nombre'); + if (!empty($selOption)) : + $data[$selId] = $selOption[0]; + endif; + endif; + return $data; + } + + + protected function getPaginasCubiertaOptions() + { + $paginasCubiertaOptions = [ + '' => lang('Basic.global.pleaseSelect'), + '4x0' => '4x0', + '4x4' => '4x4', + ]; + return $paginasCubiertaOptions; + } + + + + protected function getPaginasPortadaOptions() + { + $paginasPortadaOptions = [ + '' => lang('Basic.global.pleaseSelect'), + '4x0' => '4x0', + '4x4' => '4x4', + ]; + return $paginasPortadaOptions; + } + */ } - \ No newline at end of file diff --git a/ci4/app/Controllers/Presupuestos/Js_loader.php b/ci4/app/Controllers/Presupuestos/Js_loader.php new file mode 100644 index 00000000..f753fee7 --- /dev/null +++ b/ci4/app/Controllers/Presupuestos/Js_loader.php @@ -0,0 +1,25 @@ +load->view('themes/backend/vuexy/form/presupuestos/cosidotapablanda/comparador.js', $data); + $this->output->set_content_type('text/javascript'); + } + + +} + \ No newline at end of file diff --git a/ci4/app/Controllers/Test.php b/ci4/app/Controllers/Test.php index 04f3b0b2..29368205 100644 --- a/ci4/app/Controllers/Test.php +++ b/ci4/app/Controllers/Test.php @@ -2,7 +2,7 @@ namespace App\Controllers; -use App\Models\Tarifas\TarifaAcabadoLineaModel; +use App\Models\Configuracion\PapelGenericoModel; class Test extends BaseController { @@ -15,11 +15,10 @@ class Test extends BaseController public function index() { - /* - $papel = new Papelesimpresion(); - var_dump($papel->datatablePG());*/ - $session = session(); - var_dump($session->id_user); + $model = new PapelGenericoModel(); + echo '
';
+        var_dump($model->getGramajeComparador('CARTULINA GRÁFICA ESTUCADA 1/C'));
+        echo '
'; } } \ No newline at end of file diff --git a/ci4/app/Entities/Configuracion/PapelFormatoEntity.php b/ci4/app/Entities/Configuracion/PapelFormatoEntity.php new file mode 100644 index 00000000..fa6c3d37 --- /dev/null +++ b/ci4/app/Entities/Configuracion/PapelFormatoEntity.php @@ -0,0 +1,22 @@ + null, + "ancho" => null, + "alto" => null, + "is_deleted" => 0, + "deleted_at" => null, + "created_at" => null, + "updated_at" => null, + ]; + protected $casts = [ + "ancho" => "float", + "alto" => "float", + "is_deleted" => "int", + ]; +} diff --git a/ci4/app/Entities/Presupuestos/PresupuestoEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoEntity.php new file mode 100644 index 00000000..c5b91ca7 --- /dev/null +++ b/ci4/app/Entities/Presupuestos/PresupuestoEntity.php @@ -0,0 +1,320 @@ + null, + "version" => 0, + "cliente_id" => null, + "tarifa_cliente_id" => null, + "user_created_id" => 1, + "user_update_id" => null, + "forma_pago_id" => null, + "tipo_impresion_id" => null, + "tipologia_id" => null, + "pais_id" => 1, + "serie_id" => null, + "catalogo_id" => null, + "estado_id" => 1, + "inc_rei" => null, + "causa_cancelacion" => null, + "retractilado" => false, + "retractilado5" => false, + "guardas" => false, + "faja_color" => false, + "recoger_en_taller" => false, + "ferro" => false, + "ferro_digital" => false, + "marcapaginas" => false, + "prototipo" => false, + "papel_formato_id" => null, + "papel_formato_personalizado" => false, + "papel_formato_ancho" => null, + "papel_formato_alto" => null, + "titulo" => "", + "autor" => null, + "coleccion" => null, + "numero_edicion" => null, + "isbn" => null, + "referencia_cliente" => null, + "paginas" => null, + "tirada" => null, + "solapas" => false, + "solapas_ancho" => 0.0, + "cosido" => false, + "sobrecubiertas" => false, + "sobrecubiertas_ancho" => 0.0, + "merma" => null, + "merma_portada" => 6.0, + "imagenes_bn_interior" => false, + "comentarios" => null, + "comentarios_safekat" => null, + "comentarios_pdf" => null, + "comentarios_tarifa" => null, + "en_produccion" => false, + "en_espera" => false, + "modo_comparador" => false, + "paginas_negro" => null, + "paginas_negro_hq" => false, + "paginas_negro_papel_id" => null, + "paginas_negro_papel_impresion_id" => null, + "paginas_negro_forma_id" => null, + "paginas_negro_gramaje" => null, + "paginas_negro_pliegos_libro" => null, + "paginas_negro_pliegos_pedido" => null, + "paginas_negro_pliegos_precio" => null, + "paginas_negro_libro" => null, + "paginas_negro_pedido" => null, + "paginas_negro_mano" => null, + "paginas_negro_peso" => null, + "paginas_negro_maquina_id" => null, + "paginas_negro_tarifa_impresion_id" => null, + "paginas_negro_click" => null, + "paginas_negro_precio" => null, + "paginas_negro_check_papel_total" => true, + "paginas_negro_check_impresion_total" => true, + "paginas_color" => null, + "paginas_color_papel_id" => null, + "paginas_color_papel_impresion_id" => null, + "paginas_color_forma_id" => null, + "paginas_color_gramaje" => null, + "paginas_color_pliegos_libro" => null, + "paginas_color_pliegos_pedido" => null, + "paginas_color_pliegos_precio" => null, + "paginas_color_libro" => null, + "paginas_color_pedido" => null, + "paginas_color_mano" => null, + "paginas_color_peso" => null, + "paginas_color_maquina_id" => null, + "paginas_color_tarifa_impresion_id" => null, + "paginas_color_click" => null, + "paginas_color_precio" => null, + "paginas_color_check_papel_total" => true, + "paginas_color_check_impresion_total" => true, + "paginas_color_posicion" => null, + "paginas_cubierta" => null, + "paginas_cubierta_papel_id" => null, + "paginas_cubierta_papel_impresion_id" => null, + "paginas_cubierta_forma_id" => null, + "paginas_cubierta_gramaje" => null, + "paginas_cubierta_pliegos_libro" => null, + "paginas_cubierta_pliegos_pedido" => null, + "paginas_cubierta_pliegos_precio" => null, + "paginas_cubierta_libro" => null, + "paginas_cubierta_pedido" => null, + "paginas_cubierta_mano" => null, + "paginas_cubierta_peso" => null, + "paginas_cubierta_maquina_id" => null, + "paginas_cubierta_tarifa_impresion_id" => null, + "paginas_cubierta_click" => null, + "paginas_cubierta_precio" => null, + "paginas_cubierta_check_papel_total" => true, + "paginas_cubierta_check_impresion_total" => true, + "paginas_sobrecubierta" => null, + "paginas_sobrecubierta_papel_id" => null, + "paginas_sobrecubierta_papel_impresion_id" => null, + "paginas_sobrecubierta_forma_id" => null, + "paginas_sobrecubierta_gramaje" => null, + "paginas_sobrecubierta_pliegos_libro" => null, + "paginas_sobrecubierta_pliegos_pedido" => null, + "paginas_sobrecubierta_pliegos_precio" => null, + "paginas_sobrecubierta_libro" => null, + "paginas_sobrecubierta_pedido" => null, + "paginas_sobrecubierta_mano" => null, + "paginas_sobrecubierta_peso" => null, + "paginas_sobrecubierta_maquina_id" => null, + "paginas_sobrecubierta_tarifa_impresion_id" => null, + "paginas_sobrecubierta_click" => null, + "paginas_sobrecubierta_precio" => null, + "paginas_sobrecubierta_check_papel_total" => true, + "paginas_sobrecubierta_check_impresion_total" => true, + "lomo" => null, + "isDig" => false, + "total_presupuesto" => null, + "total_pedido" => null, + "total_peso" => null, + "total_click" => null, + "total_preimpresion" => null, + "total_preimpresion_margen" => null, + "total_manipulado" => null, + "total_acabado" => null, + "total_envios" => null, + "envios_recoge_cliente" => false, + "margen" => null, + "margen_extra" => 0.0, + "margen_manual" => null, + "descuento" => 0.0, + "base_imponible" => null, + "total_margen" => null, + "total_margen_extra" => null, + "total_descuento" => null, + "total" => null, + "forzar_total" => 0, + "total_calculado" => null, + "total_confirmado" => null, + "total_confirmado_user_id" => null, + "total_confirmado_update_at" => null, + "tirada_alternativa_json_data" => null, + "aprobado_user_id" => null, + "aprobado_at" => null, + "aprobado_json_data" => null, + "comparador_json_data" => null, + "fecha_entrega_real_at" => null, + "fecha_entrega_real_aviso" => false, + "fecha_impresion_at" => null, + "fecha_encuardenado_at" => null, + "fecha_externo_at" => null, + "fecha_ferro_subido_at" => null, + "responsable" => null, + "pedido_espera_fecha" => null, + "pedido_espera_user_id" => null, + "is_deleted" => 0, + "deleted_at" => null, + "created_at" => null, + "updated_at" => null, + ]; + protected $casts = [ + "version" => "int", + "cliente_id" => "int", + "tarifa_cliente_id" => "?int", + "user_created_id" => "int", + "user_update_id" => "?int", + "forma_pago_id" => "?int", + "tipo_impresion_id" => "?int", + "tipologia_id" => "?int", + "pais_id" => "int", + "serie_id" => "?int", + "catalogo_id" => "?int", + "estado_id" => "int", + "inc_rei" => "?int", + "retractilado" => "boolean", + "retractilado5" => "boolean", + "guardas" => "boolean", + "faja_color" => "boolean", + "recoger_en_taller" => "boolean", + "ferro" => "boolean", + "ferro_digital" => "boolean", + "marcapaginas" => "boolean", + "prototipo" => "boolean", + "papel_formato_id" => "int", + "papel_formato_personalizado" => "boolean", + "papel_formato_ancho" => "?float", + "papel_formato_alto" => "?float", + "paginas" => "int", + "tirada" => "int", + "solapas" => "boolean", + "solapas_ancho" => "float", + "cosido" => "boolean", + "sobrecubiertas" => "boolean", + "sobrecubiertas_ancho" => "float", + "merma" => "float", + "merma_portada" => "float", + "imagenes_bn_interior" => "boolean", + "en_produccion" => "boolean", + "en_espera" => "boolean", + "modo_comparador" => "boolean", + "paginas_negro" => "?int", + "paginas_negro_hq" => "boolean", + "paginas_negro_papel_id" => "?int", + "paginas_negro_papel_impresion_id" => "?int", + "paginas_negro_forma_id" => "?int", + "paginas_negro_gramaje" => "?float", + "paginas_negro_pliegos_libro" => "?float", + "paginas_negro_pliegos_pedido" => "?float", + "paginas_negro_pliegos_precio" => "?float", + "paginas_negro_libro" => "?float", + "paginas_negro_pedido" => "?float", + "paginas_negro_mano" => "?float", + "paginas_negro_peso" => "?float", + "paginas_negro_maquina_id" => "?int", + "paginas_negro_tarifa_impresion_id" => "?int", + "paginas_negro_click" => "?float", + "paginas_negro_precio" => "?float", + "paginas_negro_check_papel_total" => "boolean", + "paginas_negro_check_impresion_total" => "boolean", + "paginas_color" => "?int", + "paginas_color_papel_id" => "?int", + "paginas_color_papel_impresion_id" => "?int", + "paginas_color_forma_id" => "?int", + "paginas_color_gramaje" => "?float", + "paginas_color_pliegos_libro" => "?float", + "paginas_color_pliegos_pedido" => "?float", + "paginas_color_pliegos_precio" => "?float", + "paginas_color_libro" => "?float", + "paginas_color_pedido" => "?float", + "paginas_color_mano" => "?float", + "paginas_color_peso" => "?float", + "paginas_color_maquina_id" => "?int", + "paginas_color_tarifa_impresion_id" => "?int", + "paginas_color_click" => "?float", + "paginas_color_precio" => "?float", + "paginas_color_check_papel_total" => "boolean", + "paginas_color_check_impresion_total" => "boolean", + "paginas_cubierta_papel_id" => "?int", + "paginas_cubierta_papel_impresion_id" => "?int", + "paginas_cubierta_forma_id" => "?int", + "paginas_cubierta_gramaje" => "?float", + "paginas_cubierta_pliegos_libro" => "?float", + "paginas_cubierta_pliegos_pedido" => "?float", + "paginas_cubierta_pliegos_precio" => "?float", + "paginas_cubierta_libro" => "?float", + "paginas_cubierta_pedido" => "float", + "paginas_cubierta_mano" => "?float", + "paginas_cubierta_peso" => "?float", + "paginas_cubierta_maquina_id" => "?int", + "paginas_cubierta_tarifa_impresion_id" => "?int", + "paginas_cubierta_click" => "?float", + "paginas_cubierta_precio" => "?float", + "paginas_cubierta_check_papel_total" => "boolean", + "paginas_cubierta_check_impresion_total" => "boolean", + "paginas_sobrecubierta_papel_id" => "?int", + "paginas_sobrecubierta_papel_impresion_id" => "?int", + "paginas_sobrecubierta_forma_id" => "?int", + "paginas_sobrecubierta_gramaje" => "?float", + "paginas_sobrecubierta_pliegos_libro" => "?float", + "paginas_sobrecubierta_pliegos_pedido" => "?float", + "paginas_sobrecubierta_pliegos_precio" => "?float", + "paginas_sobrecubierta_libro" => "?float", + "paginas_sobrecubierta_pedido" => "?float", + "paginas_sobrecubierta_mano" => "?float", + "paginas_sobrecubierta_peso" => "?float", + "paginas_sobrecubierta_maquina_id" => "?int", + "paginas_sobrecubierta_tarifa_impresion_id" => "?int", + "paginas_sobrecubierta_click" => "?float", + "paginas_sobrecubierta_precio" => "?float", + "paginas_sobrecubierta_check_papel_total" => "boolean", + "paginas_sobrecubierta_check_impresion_total" => "boolean", + "lomo" => "?int", + "isDig" => "boolean", + "total_presupuesto" => "?float", + "total_pedido" => "?float", + "total_peso" => "?float", + "total_click" => "?float", + "total_preimpresion" => "?float", + "total_preimpresion_margen" => "?float", + "total_manipulado" => "?float", + "total_acabado" => "?float", + "total_envios" => "?float", + "envios_recoge_cliente" => "boolean", + "margen" => "?float", + "margen_extra" => "float", + "margen_manual" => "?float", + "descuento" => "float", + "base_imponible" => "?float", + "total_margen" => "?float", + "total_margen_extra" => "?float", + "total_descuento" => "?float", + "total" => "?float", + "forzar_total" => "float", + "total_calculado" => "?float", + "total_confirmado" => "?float", + "total_confirmado_user_id" => "?int", + "aprobado_user_id" => "?int", + "fecha_entrega_real_aviso" => "?boolean", + "pedido_espera_user_id" => "?int", + "is_deleted" => "int", + ]; +} diff --git a/ci4/app/Entities/Presupuestos/PresupuestoEstadoEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoEstadoEntity.php new file mode 100644 index 00000000..b5858f56 --- /dev/null +++ b/ci4/app/Entities/Presupuestos/PresupuestoEstadoEntity.php @@ -0,0 +1,19 @@ + null, + "estado" => null, + "is_deleted" => 0, + "deleted_at" => null, + "created_at" => null, + "updated_at" => null, + ]; + protected $casts = [ + "is_deleted" => "int", + ]; +} diff --git a/ci4/app/Filters/LoginAuthFilter.php b/ci4/app/Filters/LoginAuthFilter.php index 9be92731..a8cd6ff5 100644 --- a/ci4/app/Filters/LoginAuthFilter.php +++ b/ci4/app/Filters/LoginAuthFilter.php @@ -127,7 +127,7 @@ class LoginAuthFilter implements FilterInterface */ public function whiteListController(){ return [ - '', + 'Js_loader', 'BaseController', 'Home', 'Login', diff --git a/ci4/app/Language/en/Presupuestos.php b/ci4/app/Language/en/Presupuestos.php new file mode 100644 index 00000000..a5ae9bb9 --- /dev/null +++ b/ci4/app/Language/en/Presupuestos.php @@ -0,0 +1,827 @@ + 'Budget for Softcover Stitched Book', + + 'presupuestoCosidotapablandaList' => 'List of budgets for Softcover Stitched Books', + 'presupuesto' => 'Budget', + + 'datosPresupuesto' => 'Budget information', + 'datosLibro' => 'Book information', + 'datosPresupuestoCliente' => 'Client budget data (comparator)', + + 'id' => 'Budget Number', + 'created_at' => 'Date', + 'clienteId' => 'Cliend', + 'comercial' => 'Sales agent', + 'titulo' => 'Title', + 'paisId' => 'País', + 'incRei' => 'Incident \ Reprint', + 'paginas' => 'Pages', + 'tirada' => 'Print', + 'totalPapelPedido' => 'Total paper budget', + 'presupuestoEstado' => 'State', + 'presupuestoEstadoBorrador' => 'Draft', + 'presupuestoEstadoAceptado' => 'Acepted', + 'incidencia' => 'Incident', + 'reimpresion' => 'Reprint', + 'reimpresion' => 'Free of charge', + 'autor' => 'Author', + 'coleccion' => 'Collection', + 'numeroEdicion' => 'Edition number', + 'isbn' => 'ISBN', + 'referenciaCliente' => 'Customer reference', + 'papelFormatoId' => "Size", + 'papelFormatoPersonalizado' => 'Custom size', + 'papelFormatoAncho' => 'Width', + 'papelFormatoAlto' => 'Height', + 'cosido' => 'Sewn', + 'ferro' => 'Ferro', + 'ferroDigital' => 'Digital Ferro', + 'prototipo' => 'Prototype', + 'imagenesBnInterior' => 'B/W pictures inside', + 'recogerEnTaller' => 'Pick up in workshop', + 'marcapaginas' => 'Bookmark', + 'merma' => 'Weakening', + 'mermaportada' => 'Cover weakening', + 'tipoImpresion' => 'Printing type', + 'papelesComparadorCosidoTapaBlanda' => 'Interior and cover papers', + 'posicionPagColor' => 'Color pages position', + 'colorPageInstructions' => 'Enter the position of the color pages within the book. E.g., 3,5,7 or 4-10,20,155.', + 'numeroPaginas' => 'Nº Pages', + 'papel' => 'Paper', + 'gramaje' => 'Paper weight', + 'opcionesPresupuesto' => 'Budget options', + 'retractilado' => 'Individual shrink-wrapping', + 'retractilado5' => 'Shrink-wrapping in packs of 5', + 'Guardas' => 'Endpapers', + 'fajaColor' => 'Print color band ', + 'cubierta' => 'Cover', + 'sobrecubierta' => 'Dust jacket', + 'encuadernacion' => 'Binding', + 'solapasCubierta' => 'Cover dust jacket', + 'solapasAnchoCubierta' => 'Cover dust jacket width', + '1cara' => '1 side', + '2caras' => '2 sides', + + /* '4x0' => '4x0', + '4x4' => '4x4', + 'aprobadoAt' => 'Aprobado At', + 'aprobadoJsonData' => 'Aprobado Json Data', + 'aprobadoUserId' => 'Aprobado User', + 'autor' => 'Autor', + 'baseImponible' => 'Base Imponible', + 'catalogoId' => 'Catalogo ID', + 'causaCancelacion' => 'Causa Cancelacion', + 'coleccion' => 'Coleccion', + 'comentarios' => 'Comentarios', + 'comentariosPdf' => 'Comentarios Pdf', + 'comentariosSafekat' => 'Comentarios Safekat', + 'comentariosTarifa' => 'Comentarios Tarifa', + 'comparadorJsonData' => 'Comparador Json Data', + 'cosido' => 'Cosido', + 'createdAt' => 'Created At', + 'cubiertas' => 'Cubiertas', + 'cubiertasAncho' => 'Cubiertas Ancho', + 'deletedAt' => 'Deleted At', + 'descuento' => 'Descuento', + 'enEspera' => 'EN Espera', + 'enProduccion' => 'EN Produccion', + 'enviosRecogeCliente' => 'Envios Recoge Cliente', + 'estadoId' => 'Estado', + 'facturaId' => 'Factura ID', + 'fechaEncuardenadoAt' => 'Fecha Encuardenado At', + 'fechaEntregaRealAt' => 'Fecha Entrega Real At', + 'fechaEntregaRealWarning' => 'Fecha Entrega Real Warning', + 'fechaExternoAt' => 'Fecha Externo At', + 'fechaFerroSubidoAt' => 'Fecha Ferro Subido At', + 'fechaImpresionAt' => 'Fecha Impresion At', + 'ferro' => 'Ferro', + 'ferroDigital' => 'Ferro Digital', + 'formaPagoId' => 'Forma Pago', + 'forzarTotal' => 'Forzar Total', + 'imagenesBnInterior' => 'Imagenes Bn Interior', + 'isDeleted' => 'Is Deleted', + 'isbn' => 'Isbn', + 'isdig' => 'Isdig', + 'lomo' => 'Lomo', + 'marcapaginas' => 'Marcapaginas', + 'margen' => 'Margen', + 'margenExtra' => 'Margen Extra', + 'margenManual' => 'Margen Manual', + 'merma' => 'Merma', + 'mermaPortada' => 'Merma Portada', + 'modoComparador' => 'Modo Comparador', + 'moduleTitle' => 'Presupuestos', + 'numeroEdicion' => 'Numero Edicion', + 'paginasColor' => 'Paginas Color', + 'paginasColorCheckImpresionTotal' => 'Paginas Color Check Impresion Total', + 'paginasColorCheckPapelTotal' => 'Paginas Color Check Papel Total', + 'paginasColorClick' => 'Paginas Color Click', + 'paginasColorFormaId' => 'Paginas Color Forma ID', + 'paginasColorGramaje' => 'Paginas Color Gramaje', + 'paginasColorLibro' => 'Paginas Color Libro', + 'paginasColorMano' => 'Paginas Color Mano', + 'paginasColorMaquinaId' => 'Paginas Color Maquina', + 'paginasColorPapelId' => 'Paginas Color Papel', + 'paginasColorPapelImpresionId' => 'Paginas Color Papel Impresion', + 'paginasColorPedido' => 'Paginas Color Pedido', + 'paginasColorPeso' => 'Paginas Color Peso', + 'paginasColorPliegosLibro' => 'Paginas Color Pliegos Libro', + 'paginasColorPliegosPedido' => 'Paginas Color Pliegos Pedido', + 'paginasColorPliegosPrecio' => 'Paginas Color Pliegos Precio', + 'paginasColorPosicion' => 'Paginas Color Posicion', + 'paginasColorPrecio' => 'Paginas Color Precio', + 'paginasColorTarifaImpresionId' => 'Paginas Color Tarifa Impresion', + 'paginasCubierta' => 'Paginas Cubierta', + 'paginasCubiertaCheckImpresionTotal' => 'Paginas Cubierta Check Impresion Total', + 'paginasCubiertaCheckPapelTotal' => 'Paginas Cubierta Check Papel Total', + 'paginasCubiertaClick' => 'Paginas Cubierta Click', + 'paginasCubiertaFormaId' => 'Paginas Cubierta Forma ID', + 'paginasCubiertaGramaje' => 'Paginas Cubierta Gramaje', + 'paginasCubiertaLibro' => 'Paginas Cubierta Libro', + 'paginasCubiertaMano' => 'Paginas Cubierta Mano', + 'paginasCubiertaMaquinaId' => 'Paginas Cubierta Maquina', + 'paginasCubiertaPapelId' => 'Paginas Cubierta Papel', + 'paginasCubiertaPapelImpresionId' => 'Paginas Cubierta Papel Impresion', + 'paginasCubiertaPedido' => 'Paginas Cubierta Pedido', + 'paginasCubiertaPeso' => 'Paginas Cubierta Peso', + 'paginasCubiertaPliegosLibro' => 'Paginas Cubierta Pliegos Libro', + 'paginasCubiertaPliegosPedido' => 'Paginas Cubierta Pliegos Pedido', + 'paginasCubiertaPliegosPrecio' => 'Paginas Cubierta Pliegos Precio', + 'paginasCubiertaPrecio' => 'Paginas Cubierta Precio', + 'paginasCubiertaTarifaImpresionId' => 'Paginas Cubierta Tarifa Impresion', + 'paginasNegro' => 'Paginas Negro', + 'paginasNegroCheckImpresionTotal' => 'Paginas Negro Check Impresion Total', + 'paginasNegroCheckPapelTotal' => 'Paginas Negro Check Papel Total', + 'paginasNegroClick' => 'Paginas Negro Click', + 'paginasNegroFormaId' => 'Paginas Negro Forma ID', + 'paginasNegroGramaje' => 'Paginas Negro Gramaje', + 'paginasNegroHq' => 'Paginas Negro Hq', + 'paginasNegroLibro' => 'Paginas Negro Libro', + 'paginasNegroMano' => 'Paginas Negro Mano', + 'paginasNegroMaquinaId' => 'Paginas Negro Maquina', + 'paginasNegroPapelId' => 'Paginas Negro Papel', + 'paginasNegroPapelImpresionId' => 'Paginas Negro Papel Impresion', + 'paginasNegroPedido' => 'Paginas Negro Pedido', + 'paginasNegroPeso' => 'Paginas Negro Peso', + 'paginasNegroPliegosLibro' => 'Paginas Negro Pliegos Libro', + 'paginasNegroPliegosPedido' => 'Paginas Negro Pliegos Pedido', + 'paginasNegroPliegosPrecio' => 'Paginas Negro Pliegos Precio', + 'paginasNegroPrecio' => 'Paginas Negro Precio', + 'paginasNegroTarifaImpresionId' => 'Paginas Negro Tarifa Impresion', + 'paginasPortada' => 'Paginas Portada', + 'paginasPortadaCheckImpresionTotal' => 'Paginas Portada Check Impresion Total', + 'paginasPortadaCheckPapelTotal' => 'Paginas Portada Check Papel Total', + 'paginasPortadaClick' => 'Paginas Portada Click', + 'paginasPortadaFormaId' => 'Paginas Portada Forma ID', + 'paginasPortadaGramaje' => 'Paginas Portada Gramaje', + 'paginasPortadaLibro' => 'Paginas Portada Libro', + 'paginasPortadaMano' => 'Paginas Portada Mano', + 'paginasPortadaMaquinaId' => 'Paginas Portada Maquina', + 'paginasPortadaPapelId' => 'Paginas Portada Papel', + 'paginasPortadaPapelImpresionId' => 'Paginas Portada Papel Impresion', + 'paginasPortadaPedido' => 'Paginas Portada Pedido', + 'paginasPortadaPeso' => 'Paginas Portada Peso', + 'paginasPortadaPliegosLibro' => 'Paginas Portada Pliegos Libro', + 'paginasPortadaPliegosPedido' => 'Paginas Portada Pliegos Pedido', + 'paginasPortadaPliegosPrecio' => 'Paginas Portada Pliegos Precio', + 'paginasPortadaPrecio' => 'Paginas Portada Precio', + 'paginasPortadaTarifaImpresionId' => 'Paginas Portada Tarifa Impresion', + 'papelFormatoAlto' => 'Papel Formato Alto', + 'papelFormatoAncho' => 'Papel Formato Ancho', + 'papelFormatoId' => 'Papel Formato', + 'papelFormatoPersonalizado' => 'Papel Formato Personalizado', + 'pedidoEsperaFecha' => 'Pedido Espera Fecha', + 'pedidoEsperaUserId' => 'Pedido Espera User', + 'pedidoLibroConjuntoId' => 'Pedido Libro Conjunto ID', + 'presupuesto' => 'Presupuesto', + 'presupuestoList' => 'Presupuesto List', + 'presupuestos' => 'Presupuestos', + 'recogerEnTaller' => 'Recoger EN Taller', + 'referenciaCliente' => 'Referencia Cliente', + 'responsable' => 'Responsable', + 'serieId' => 'Serie ID', + 'solapas' => 'Solapas', + 'solapasAncho' => 'Solapas Ancho', + 'tarifaClienteId' => 'Tarifa Cliente ID', + 'tipoImpresionId' => 'Tipo Impresion', + 'tipologiaId' => 'Tipologia', + 'tiradaAlternativaJsonData' => 'Tirada Alternativa Json Data', + 'total' => 'Total', + 'totalAcabado' => 'Total Acabado', + 'totalCalculado' => 'Total Calculado', + 'totalClick' => 'Total Click', + 'totalConfirmado' => 'Total Confirmado', + 'totalConfirmadoUpdateAt' => 'Total Confirmado Update At', + 'totalConfirmadoUserId' => 'Total Confirmado User', + 'totalDescuento' => 'Total Descuento', + 'totalEnvios' => 'Total Envios', + 'totalManipulado' => 'Total Manipulado', + 'totalMargen' => 'Total Margen', + 'totalMargenExtra' => 'Total Margen Extra', + 'totalPeso' => 'Total Peso', + 'totalPreimpresion' => 'Total Preimpresion', + 'totalPreimpresionMargen' => 'Total Preimpresion Margen', + 'totalPresupuesto' => 'Total Presupuesto', + 'ubicacionId' => 'Ubicacion', + 'updatedAt' => 'Updated At', + 'userCreatedId' => 'User Created', + 'userUpdateId' => 'User Update', + 'version' => 'Version', + 'wsExternoJsonData' => 'Ws Externo Json Data', + 'validation' => [ + 'aprobado_at' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'aprobado_json_data' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'base_imponible' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'catalogo_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'causa_cancelacion' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'coleccion' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'comparador_json_data' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'factura_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'fecha_encuardenado_at' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'fecha_entrega_real_at' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'fecha_externo_at' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'fecha_ferro_subido_at' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'fecha_impresion_at' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'inc_rei' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'isbn' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'lomo' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'margen' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'margen_manual' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'numero_edicion' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'paginas_color' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'paginas_color_click' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_forma_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'paginas_color_gramaje' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_mano' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_peso' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_pliegos_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_pliegos_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_pliegos_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_posicion' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'paginas_color_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_click' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_forma_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'paginas_cubierta_gramaje' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_mano' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_peso' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_pliegos_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_pliegos_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_pliegos_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'paginas_negro_click' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_forma_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'paginas_negro_gramaje' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_mano' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_peso' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_pliegos_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_pliegos_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_pliegos_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_click' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_forma_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'paginas_portada_gramaje' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_mano' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_peso' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_pliegos_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_pliegos_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_pliegos_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'papel_formato_alto' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'papel_formato_ancho' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'pedido_espera_fecha' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'pedido_libro_conjunto_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'responsable' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'serie_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'tarifa_cliente_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'tirada_alternativa_json_data' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'total' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_acabado' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_calculado' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_click' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_confirmado' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_confirmado_update_at' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'total_descuento' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_envios' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_manipulado' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_margen' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_margen_extra' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_peso' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_preimpresion' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_preimpresion_margen' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_presupuesto' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'user_update_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'ws_externo_json_data' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'autor' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'required' => 'The {field} field is required.', + + ], + + 'comentarios' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'required' => 'The {field} field is required.', + + ], + + 'comentarios_pdf' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'required' => 'The {field} field is required.', + + ], + + 'comentarios_safekat' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'required' => 'The {field} field is required.', + + ], + + 'comentarios_tarifa' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'required' => 'The {field} field is required.', + + ], + + 'cubiertas_ancho' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'descuento' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'forzar_total' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'is_deleted' => [ + 'integer' => 'The {field} field must contain an integer.', + 'required' => 'The {field} field is required.', + + ], + + 'margen_extra' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'merma' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'merma_portada' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'paginas' => [ + 'integer' => 'The {field} field must contain an integer.', + 'required' => 'The {field} field is required.', + + ], + + 'paginas_cubierta' => [ + 'in_list' => 'The {field} field must be one of: {param}.', + 'required' => 'The {field} field is required.', + + ], + + 'paginas_portada' => [ + 'in_list' => 'The {field} field must be one of: {param}.', + 'required' => 'The {field} field is required.', + + ], + + 'paginas_portada_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'referencia_cliente' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'required' => 'The {field} field is required.', + + ], + + 'solapas_ancho' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'tirada' => [ + 'integer' => 'The {field} field must contain an integer.', + 'required' => 'The {field} field is required.', + + ], + + 'titulo' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'required' => 'The {field} field is required.', + + ], + + 'user_created_id' => [ + 'integer' => 'The {field} field must contain an integer.', + 'required' => 'The {field} field is required.', + + ], + + 'version' => [ + 'integer' => 'The {field} field must contain an integer.', + 'required' => 'The {field} field is required.', + + ], + + + ], */ + + +]; diff --git a/ci4/app/Language/es/Presupuestos.php b/ci4/app/Language/es/Presupuestos.php new file mode 100644 index 00000000..30fffaec --- /dev/null +++ b/ci4/app/Language/es/Presupuestos.php @@ -0,0 +1,847 @@ + 'Presupuesto Libro Cosido Tapa Blanda', + + 'presupuestoCosidotapablandaList' => 'Lista presupuestos Libros Cosido Tapa Blanda', + 'presupuesto' => 'Presupuesto', + + 'datosPresupuesto' => 'Datos generales del presupuesto', + 'datosLibro' => 'Datos del libro', + 'datosPresupuestoCliente' => 'Datos presupuesto cliente (comparador)', + + 'id' => 'Número Presupuesto', + 'created_at' => 'Fecha', + 'clienteId' => 'Cliente', + 'comercial' => 'Comercial', + 'titulo' => 'Título', + 'paisId' => 'País', + 'incRei' => 'Incidencia \ Reimpresión', + 'paginas' => 'Paginas', + 'tirada' => 'Tirada', + 'totalPedido' => 'Total Presupuesto', + 'presupuestoEstado' => 'Estado', + 'presupuestoEstadoBorrador' => 'Borrador', + 'presupuestoEstadoAceptado' => 'Aceptado', + 'incidencia' => 'Incidencia', + 'reimpresion' => 'Reimpresion', + 'sinCargo' => 'Sin cargo', + 'autor' => 'Autor', + 'coleccion' => 'Colección', + 'numeroEdicion' => 'Número de edición', + 'isbn' => 'ISBN', + 'referenciaCliente' => 'Referencia del cliente', + 'papelFormatoId' => "Tamaño", + 'papelFormatoPersonalizado' => 'Tamaño personalizado', + 'papelFormatoAncho' => 'Ancho', + 'papelFormatoAlto' => 'Alto', + 'cosido' => 'Cosido', + 'ferro' => 'Ferro', + 'ferroDigital' => 'Ferro Digital', + 'prototipo' => 'Prototipo', + 'imagenesBnInterior' => 'Imágenes B/N interior', + 'recogerEnTaller' => 'Recoger en taller', + 'marcapaginas' => 'Marcapáginas', + 'merma' => 'Merma', + 'mermaportada' => 'Merma portada', + 'tipoImpresion' => 'Tipo de impresión', + 'papelesComparadorCosidoTapaBlanda' => 'Papeles interior y cubierta', + 'posicionPagColor' => 'Posición páginas a color', + 'colorPageInstructions' => 'Introduzca la posición de las páginas a color dentro del libro. Ej: 3,5,7 ó 4-10,20,155', + 'numeroPaginas' => 'Nº Páginas', + 'papel' => 'Papel', + 'gramaje' => 'Gramaje', + 'opcionesPresupuesto' => 'Opciones presupuesto', + 'retractilado' => 'Retractilado individual', + 'retractilado5' => 'Retractilado de 5', + 'Guardas' => 'Guardas', + 'fajaColor' => 'Imprimir faja a color', + 'compInteriorPlana' => 'Interior en plana', + 'compInteriorRotativa' => 'Interior en rotativa', + 'compCubiertaSobrecubierta' => 'Cubierta y sobrecubierta', + 'tipo' => 'Tipo', + 'marca' => 'Marca', + 'maquina' => 'Máquina', + 'numeroPliegos' => 'Nº Pliegos', + 'pliegosPedido' => 'Pliegos pedido', + 'precioPliego' => 'Precio pliegos', + 'libro' => 'Libro', + 'totalPapelPedido' => 'Total papel pedido', + 'lomo' => 'Lomo', + 'peso' => 'Peso', + 'click' => 'Click', + 'totalClicks' => 'Total clicks', + 'precioPagNegro' => 'Precio pág. negro', + 'precioPagColor' => 'Precio pág. color', + 'totalTinta' => 'Total tinta', + 'totalCorte' => 'Total corte', + 'total' => 'Total', + 'cubierta' => 'Cubierta', + 'sobrecubierta' => 'Sobrecubierta', + 'encuadernacion' => 'Encuadernación', + 'solapasCubierta' => 'Solapas cubierta', + 'solapasAnchoCubierta' => 'Ancho solapas cubierta', + '1cara' => '1 cara', + '2caras' => '2 caras', + + /* '4x0' => '4x0', + '4x4' => '4x4', + 'aprobadoAt' => 'Aprobado At', + 'aprobadoJsonData' => 'Aprobado Json Data', + 'aprobadoUserId' => 'Aprobado User', + 'autor' => 'Autor', + 'baseImponible' => 'Base Imponible', + 'catalogoId' => 'Catalogo ID', + 'causaCancelacion' => 'Causa Cancelacion', + 'coleccion' => 'Coleccion', + 'comentarios' => 'Comentarios', + 'comentariosPdf' => 'Comentarios Pdf', + 'comentariosSafekat' => 'Comentarios Safekat', + 'comentariosTarifa' => 'Comentarios Tarifa', + 'comparadorJsonData' => 'Comparador Json Data', + 'cosido' => 'Cosido', + 'createdAt' => 'Created At', + 'cubiertas' => 'Cubiertas', + 'cubiertasAncho' => 'Cubiertas Ancho', + 'deletedAt' => 'Deleted At', + 'descuento' => 'Descuento', + 'enEspera' => 'EN Espera', + 'enProduccion' => 'EN Produccion', + 'enviosRecogeCliente' => 'Envios Recoge Cliente', + 'estadoId' => 'Estado', + 'facturaId' => 'Factura ID', + 'fechaEncuardenadoAt' => 'Fecha Encuardenado At', + 'fechaEntregaRealAt' => 'Fecha Entrega Real At', + 'fechaEntregaRealWarning' => 'Fecha Entrega Real Warning', + 'fechaExternoAt' => 'Fecha Externo At', + 'fechaFerroSubidoAt' => 'Fecha Ferro Subido At', + 'fechaImpresionAt' => 'Fecha Impresion At', + 'ferro' => 'Ferro', + 'ferroDigital' => 'Ferro Digital', + 'formaPagoId' => 'Forma Pago', + 'forzarTotal' => 'Forzar Total', + 'imagenesBnInterior' => 'Imagenes Bn Interior', + 'isDeleted' => 'Is Deleted', + 'isbn' => 'Isbn', + 'isdig' => 'Isdig', + 'lomo' => 'Lomo', + 'marcapaginas' => 'Marcapaginas', + 'margen' => 'Margen', + 'margenExtra' => 'Margen Extra', + 'margenManual' => 'Margen Manual', + 'merma' => 'Merma', + 'mermaPortada' => 'Merma Portada', + 'modoComparador' => 'Modo Comparador', + 'moduleTitle' => 'Presupuestos', + 'numeroEdicion' => 'Numero Edicion', + 'paginasColor' => 'Paginas Color', + 'paginasColorCheckImpresionTotal' => 'Paginas Color Check Impresion Total', + 'paginasColorCheckPapelTotal' => 'Paginas Color Check Papel Total', + 'paginasColorClick' => 'Paginas Color Click', + 'paginasColorFormaId' => 'Paginas Color Forma ID', + 'paginasColorGramaje' => 'Paginas Color Gramaje', + 'paginasColorLibro' => 'Paginas Color Libro', + 'paginasColorMano' => 'Paginas Color Mano', + 'paginasColorMaquinaId' => 'Paginas Color Maquina', + 'paginasColorPapelId' => 'Paginas Color Papel', + 'paginasColorPapelImpresionId' => 'Paginas Color Papel Impresion', + 'paginasColorPedido' => 'Paginas Color Pedido', + 'paginasColorPeso' => 'Paginas Color Peso', + 'paginasColorPliegosLibro' => 'Paginas Color Pliegos Libro', + 'paginasColorPliegosPedido' => 'Paginas Color Pliegos Pedido', + 'paginasColorPliegosPrecio' => 'Paginas Color Pliegos Precio', + 'paginasColorPosicion' => 'Paginas Color Posicion', + 'paginasColorPrecio' => 'Paginas Color Precio', + 'paginasColorTarifaImpresionId' => 'Paginas Color Tarifa Impresion', + 'paginasCubierta' => 'Paginas Cubierta', + 'paginasCubiertaCheckImpresionTotal' => 'Paginas Cubierta Check Impresion Total', + 'paginasCubiertaCheckPapelTotal' => 'Paginas Cubierta Check Papel Total', + 'paginasCubiertaClick' => 'Paginas Cubierta Click', + 'paginasCubiertaFormaId' => 'Paginas Cubierta Forma ID', + 'paginasCubiertaGramaje' => 'Paginas Cubierta Gramaje', + 'paginasCubiertaLibro' => 'Paginas Cubierta Libro', + 'paginasCubiertaMano' => 'Paginas Cubierta Mano', + 'paginasCubiertaMaquinaId' => 'Paginas Cubierta Maquina', + 'paginasCubiertaPapelId' => 'Paginas Cubierta Papel', + 'paginasCubiertaPapelImpresionId' => 'Paginas Cubierta Papel Impresion', + 'paginasCubiertaPedido' => 'Paginas Cubierta Pedido', + 'paginasCubiertaPeso' => 'Paginas Cubierta Peso', + 'paginasCubiertaPliegosLibro' => 'Paginas Cubierta Pliegos Libro', + 'paginasCubiertaPliegosPedido' => 'Paginas Cubierta Pliegos Pedido', + 'paginasCubiertaPliegosPrecio' => 'Paginas Cubierta Pliegos Precio', + 'paginasCubiertaPrecio' => 'Paginas Cubierta Precio', + 'paginasCubiertaTarifaImpresionId' => 'Paginas Cubierta Tarifa Impresion', + 'paginasNegro' => 'Paginas Negro', + 'paginasNegroCheckImpresionTotal' => 'Paginas Negro Check Impresion Total', + 'paginasNegroCheckPapelTotal' => 'Paginas Negro Check Papel Total', + 'paginasNegroClick' => 'Paginas Negro Click', + 'paginasNegroFormaId' => 'Paginas Negro Forma ID', + 'paginasNegroGramaje' => 'Paginas Negro Gramaje', + 'paginasNegroHq' => 'Paginas Negro Hq', + 'paginasNegroLibro' => 'Paginas Negro Libro', + 'paginasNegroMano' => 'Paginas Negro Mano', + 'paginasNegroMaquinaId' => 'Paginas Negro Maquina', + 'paginasNegroPapelId' => 'Paginas Negro Papel', + 'paginasNegroPapelImpresionId' => 'Paginas Negro Papel Impresion', + 'paginasNegroPedido' => 'Paginas Negro Pedido', + 'paginasNegroPeso' => 'Paginas Negro Peso', + 'paginasNegroPliegosLibro' => 'Paginas Negro Pliegos Libro', + 'paginasNegroPliegosPedido' => 'Paginas Negro Pliegos Pedido', + 'paginasNegroPliegosPrecio' => 'Paginas Negro Pliegos Precio', + 'paginasNegroPrecio' => 'Paginas Negro Precio', + 'paginasNegroTarifaImpresionId' => 'Paginas Negro Tarifa Impresion', + 'paginasPortada' => 'Paginas Portada', + 'paginasPortadaCheckImpresionTotal' => 'Paginas Portada Check Impresion Total', + 'paginasPortadaCheckPapelTotal' => 'Paginas Portada Check Papel Total', + 'paginasPortadaClick' => 'Paginas Portada Click', + 'paginasPortadaFormaId' => 'Paginas Portada Forma ID', + 'paginasPortadaGramaje' => 'Paginas Portada Gramaje', + 'paginasPortadaLibro' => 'Paginas Portada Libro', + 'paginasPortadaMano' => 'Paginas Portada Mano', + 'paginasPortadaMaquinaId' => 'Paginas Portada Maquina', + 'paginasPortadaPapelId' => 'Paginas Portada Papel', + 'paginasPortadaPapelImpresionId' => 'Paginas Portada Papel Impresion', + 'paginasPortadaPedido' => 'Paginas Portada Pedido', + 'paginasPortadaPeso' => 'Paginas Portada Peso', + 'paginasPortadaPliegosLibro' => 'Paginas Portada Pliegos Libro', + 'paginasPortadaPliegosPedido' => 'Paginas Portada Pliegos Pedido', + 'paginasPortadaPliegosPrecio' => 'Paginas Portada Pliegos Precio', + 'paginasPortadaPrecio' => 'Paginas Portada Precio', + 'paginasPortadaTarifaImpresionId' => 'Paginas Portada Tarifa Impresion', + 'papelFormatoAlto' => 'Papel Formato Alto', + 'papelFormatoAncho' => 'Papel Formato Ancho', + 'papelFormatoId' => 'Papel Formato', + 'papelFormatoPersonalizado' => 'Papel Formato Personalizado', + 'pedidoEsperaFecha' => 'Pedido Espera Fecha', + 'pedidoEsperaUserId' => 'Pedido Espera User', + 'pedidoLibroConjuntoId' => 'Pedido Libro Conjunto ID', + 'presupuesto' => 'Presupuesto', + 'presupuestoList' => 'Presupuesto List', + 'presupuestos' => 'Presupuestos', + 'recogerEnTaller' => 'Recoger EN Taller', + 'referenciaCliente' => 'Referencia Cliente', + 'responsable' => 'Responsable', + 'serieId' => 'Serie ID', + 'solapas' => 'Solapas', + 'solapasAncho' => 'Solapas Ancho', + 'tarifaClienteId' => 'Tarifa Cliente ID', + 'tipoImpresionId' => 'Tipo Impresion', + 'tipologiaId' => 'Tipologia', + 'tiradaAlternativaJsonData' => 'Tirada Alternativa Json Data', + 'total' => 'Total', + 'totalAcabado' => 'Total Acabado', + 'totalCalculado' => 'Total Calculado', + 'totalClick' => 'Total Click', + 'totalConfirmado' => 'Total Confirmado', + 'totalConfirmadoUpdateAt' => 'Total Confirmado Update At', + 'totalConfirmadoUserId' => 'Total Confirmado User', + 'totalDescuento' => 'Total Descuento', + 'totalEnvios' => 'Total Envios', + 'totalManipulado' => 'Total Manipulado', + 'totalMargen' => 'Total Margen', + 'totalMargenExtra' => 'Total Margen Extra', + 'totalPeso' => 'Total Peso', + 'totalPreimpresion' => 'Total Preimpresion', + 'totalPreimpresionMargen' => 'Total Preimpresion Margen', + 'totalPresupuesto' => 'Total Presupuesto', + 'ubicacionId' => 'Ubicacion', + 'updatedAt' => 'Updated At', + 'userCreatedId' => 'User Created', + 'userUpdateId' => 'User Update', + 'version' => 'Version', + 'wsExternoJsonData' => 'Ws Externo Json Data', + 'validation' => [ + 'aprobado_at' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'aprobado_json_data' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'base_imponible' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'catalogo_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'causa_cancelacion' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'coleccion' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'comparador_json_data' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'factura_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'fecha_encuardenado_at' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'fecha_entrega_real_at' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'fecha_externo_at' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'fecha_ferro_subido_at' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'fecha_impresion_at' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'inc_rei' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'isbn' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'lomo' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'margen' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'margen_manual' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'numero_edicion' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'paginas_color' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'paginas_color_click' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_forma_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'paginas_color_gramaje' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_mano' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_peso' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_pliegos_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_pliegos_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_pliegos_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_color_posicion' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'paginas_color_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_click' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_forma_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'paginas_cubierta_gramaje' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_mano' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_peso' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_pliegos_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_pliegos_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_pliegos_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_cubierta_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'paginas_negro_click' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_forma_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'paginas_negro_gramaje' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_mano' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_peso' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_pliegos_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_pliegos_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_pliegos_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_negro_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_click' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_forma_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'paginas_portada_gramaje' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_mano' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_peso' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_pliegos_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_pliegos_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_pliegos_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'paginas_portada_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'papel_formato_alto' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'papel_formato_ancho' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'pedido_espera_fecha' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'pedido_libro_conjunto_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'responsable' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'serie_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'tarifa_cliente_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'tirada_alternativa_json_data' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'total' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_acabado' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_calculado' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_click' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_confirmado' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_confirmado_update_at' => [ + 'valid_date' => 'The {field} field must contain a valid date.', + + ], + + 'total_descuento' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_envios' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_manipulado' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_margen' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_margen_extra' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_peso' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_preimpresion' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_preimpresion_margen' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'total_presupuesto' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + + ], + + 'user_update_id' => [ + 'integer' => 'The {field} field must contain an integer.', + + ], + + 'ws_externo_json_data' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + + ], + + 'autor' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'required' => 'The {field} field is required.', + + ], + + 'comentarios' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'required' => 'The {field} field is required.', + + ], + + 'comentarios_pdf' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'required' => 'The {field} field is required.', + + ], + + 'comentarios_safekat' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'required' => 'The {field} field is required.', + + ], + + 'comentarios_tarifa' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'required' => 'The {field} field is required.', + + ], + + 'cubiertas_ancho' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'descuento' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'forzar_total' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'is_deleted' => [ + 'integer' => 'The {field} field must contain an integer.', + 'required' => 'The {field} field is required.', + + ], + + 'margen_extra' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'merma' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'merma_portada' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'paginas' => [ + 'integer' => 'The {field} field must contain an integer.', + 'required' => 'The {field} field is required.', + + ], + + 'paginas_cubierta' => [ + 'in_list' => 'The {field} field must be one of: {param}.', + 'required' => 'The {field} field is required.', + + ], + + 'paginas_portada' => [ + 'in_list' => 'The {field} field must be one of: {param}.', + 'required' => 'The {field} field is required.', + + ], + + 'paginas_portada_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'referencia_cliente' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'required' => 'The {field} field is required.', + + ], + + 'solapas_ancho' => [ + 'decimal' => 'The {field} field must contain a decimal number.', + 'required' => 'The {field} field is required.', + + ], + + 'tirada' => [ + 'integer' => 'The {field} field must contain an integer.', + 'required' => 'The {field} field is required.', + + ], + + 'titulo' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'required' => 'The {field} field is required.', + + ], + + 'user_created_id' => [ + 'integer' => 'The {field} field must contain an integer.', + 'required' => 'The {field} field is required.', + + ], + + 'version' => [ + 'integer' => 'The {field} field must contain an integer.', + 'required' => 'The {field} field is required.', + + ], + + + ], */ + + +]; diff --git a/ci4/app/Models/Configuracion/PapelFormatoModel.php b/ci4/app/Models/Configuracion/PapelFormatoModel.php new file mode 100644 index 00000000..7c4d2464 --- /dev/null +++ b/ci4/app/Models/Configuracion/PapelFormatoModel.php @@ -0,0 +1,96 @@ + "t1.id", + 2 => "t1.ancho", + 3 => "t1.alto", + 4 => "t1.created_at", + 5 => "t1.updated_at", + ]; + + protected $allowedFields = ["ancho", "alto"]; + protected $returnType = "App\Entities\Configuracion\PapelFormatoEntity"; + + protected $useTimestamps = true; + protected $useSoftDeletes = false; + + protected $createdField = "created_at"; + + protected $updatedField = "updated_at"; + + public static $labelField = "ancho"; + + protected $validationRules = [ + "alto" => [ + "label" => "LgPapelFormatoes.alto", + "rules" => "required|decimal", + ], + "ancho" => [ + "label" => "LgPapelFormatoes.ancho", + "rules" => "required|decimal", + ], + ]; + + protected $validationMessages = [ + "alto" => [ + "decimal" => "LgPapelFormatoes.validation.alto.decimal", + "required" => "LgPapelFormatoes.validation.alto.required", + ], + "ancho" => [ + "decimal" => "LgPapelFormatoes.validation.ancho.decimal", + "required" => "LgPapelFormatoes.validation.ancho.required", + ], + ]; + + /** + * Get resource data. + * + * @param string $search + * + * @return \CodeIgniter\Database\BaseBuilder + */ + public function getResource(string $search = "") + { + $builder = $this->db + ->table($this->table . " t1") + ->select( + "t1.id AS id, t1.ancho AS ancho, t1.alto AS alto, t1.created_at AS created_at, t1.updated_at AS updated_at" + ); + + return empty($search) + ? $builder + : $builder + ->groupStart() + ->like("t1.id", $search) + ->orLike("t1.ancho", $search) + ->orLike("t1.alto", $search) + ->orLike("t1.created_at", $search) + ->orLike("t1.updated_at", $search) + ->orLike("t1.id", $search) + ->orLike("t1.ancho", $search) + ->orLike("t1.alto", $search) + ->orLike("t1.created_at", $search) + ->orLike("t1.updated_at", $search) + ->groupEnd(); + } + + public function getElementsForMenu(){ + return $this->db + ->table($this->table . " t1") + ->select( + "t1.id AS id, CONCAT(t1.ancho, ' x ', t1.alto) AS tamanio" + )->get()->getResultObject(); + } +} diff --git a/ci4/app/Models/Configuracion/PapelGenericoModel.php b/ci4/app/Models/Configuracion/PapelGenericoModel.php index 88a2e6a7..1df24bcc 100644 --- a/ci4/app/Models/Configuracion/PapelGenericoModel.php +++ b/ci4/app/Models/Configuracion/PapelGenericoModel.php @@ -1,4 +1,5 @@ "t1.show_in_client", ]; - protected $allowedFields = ["nombre", "code", "code_ot", "show_in_client","deleted_at","is_deleted"]; + protected $allowedFields = ["nombre", "code", "code_ot", "show_in_client", "deleted_at", "is_deleted"]; protected $returnType = "App\Entities\Configuracion\PapelGenerico"; protected $useTimestamps = true; @@ -79,15 +80,79 @@ class PapelGenericoModel extends \App\Models\GoBaseModel 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(); + } + + + public function getPapelForComparador($tipo, $is_cubierta = null, $is_sobrecubierta = null) + { + /* + 1.-> Tipo impresion + 2.-> Maquina + 3.-> Papeles impresion asociados a esa maquina + 4.-> papeles genericos que aparecen en esos papeles impresion + */ + $builder = $this->db + ->table($this->table . " t1") + ->select( + "t1.nombre AS papel_generico" + ) + ->join("lg_papel_impresion t2", "t2.papel_generico_id = t1.id", "left") + ->join("lg_maquina_papel_impresion t3", "t3.papel_impresion_id = t2.id", "left") + ->join("lg_maquinas t4", "t3.maquina_id = t4.id", "left") + ->join("lg_maquinas_tarifas_impresion t5", "t5.maquina_id = t4.id", "left") + + ->where("t1.is_deleted", 0) + ->where("t2.is_deleted", 0) + ->where("t4.is_deleted", 0) + ->where("t4.tipo", "impresion") + ->where("t5.tipo", $tipo); + + if(!is_null($is_cubierta)){ + if($is_cubierta==true){ + $builder->where("t2.cubierta", 1); + } + else if($is_sobrecubierta==true){ + $builder->where("t2.sobrecubierta", 1); + } + } + + return array_unique(array_column($builder->orderBy("t1.nombre", "asc")->get()->getResultArray(), 'papel_generico')); + } + + public function getGramajeComparador(string $papel_generico_nombre="") + { + $builder = $this->db + ->table($this->table . " t1") + ->select( + "t2.gramaje AS text" + ) + ->join("lg_papel_impresion t2", "t2.papel_generico_id = t1.id", "left") + + ->where("t1.is_deleted", 0) + ->where("t2.is_deleted", 0) + ->where("t1.nombre", $papel_generico_nombre); + + $values = $builder->orderBy("t2.gramaje", "asc")->get()->getResultObject(); + $id = 1; + foreach ($values as $value){ + $value->id = $id; + $id++; + } + $values_array = array_map( function( $value ) { + return $value->text; + }, $values ); + $unique_values = array_unique($values_array); + return array_values(array_intersect_key($values, $unique_values)); + } } diff --git a/ci4/app/Models/Presupuestos/PresupuestoEstadoModel.php b/ci4/app/Models/Presupuestos/PresupuestoEstadoModel.php new file mode 100644 index 00000000..59f330f1 --- /dev/null +++ b/ci4/app/Models/Presupuestos/PresupuestoEstadoModel.php @@ -0,0 +1,88 @@ + "t1.id", + 2 => "t1.estado", + 3 => "t1.is_deleted", + 4 => "t1.created_at", + 5 => "t1.updated_at", + ]; + + protected $allowedFields = ["estado", "is_deleted"]; + protected $returnType = "App\Entities\Presupuestos\PresupuestoEstadoEntity"; + + protected $useTimestamps = true; + protected $useSoftDeletes = false; + + protected $createdField = "created_at"; + + protected $updatedField = "updated_at"; + + public static $labelField = "estado"; + + protected $validationRules = [ + "estado" => [ + "label" => "PresupuestoEstados.estado", + "rules" => "trim|required|max_length[50]", + ], + "is_deleted" => [ + "label" => "PresupuestoEstados.isDeleted", + "rules" => "required|integer", + ], + ]; + + protected $validationMessages = [ + "estado" => [ + "max_length" => "PresupuestoEstados.validation.estado.max_length", + "required" => "PresupuestoEstados.validation.estado.required", + ], + "is_deleted" => [ + "integer" => "PresupuestoEstados.validation.is_deleted.integer", + "required" => "PresupuestoEstados.validation.is_deleted.required", + ], + ]; + + /** + * Get resource data. + * + * @param string $search + * + * @return \CodeIgniter\Database\BaseBuilder + */ + public function getResource(string $search = "") + { + $builder = $this->db + ->table($this->table . " t1") + ->select( + "t1.id AS id, t1.estado AS estado, t1.is_deleted AS is_deleted, t1.created_at AS created_at, t1.updated_at AS updated_at" + ); + + return empty($search) + ? $builder + : $builder + ->groupStart() + ->like("t1.id", $search) + ->orLike("t1.estado", $search) + ->orLike("t1.is_deleted", $search) + ->orLike("t1.created_at", $search) + ->orLike("t1.updated_at", $search) + ->orLike("t1.id", $search) + ->orLike("t1.estado", $search) + ->orLike("t1.is_deleted", $search) + ->orLike("t1.created_at", $search) + ->orLike("t1.updated_at", $search) + ->groupEnd(); + } +} diff --git a/ci4/app/Models/Presupuestos/PresupuestoModel.php b/ci4/app/Models/Presupuestos/PresupuestoModel.php new file mode 100644 index 00000000..39ea2f6f --- /dev/null +++ b/ci4/app/Models/Presupuestos/PresupuestoModel.php @@ -0,0 +1,1080 @@ + "t1.id", + 1 => "t1.created_at", + 2 => "t2.nombre", + 3 => "t3.first_name", + 4 => "t1.titulo", + 5 => "t4.nombre", + 6 => "t5.nombre", + 7 => "t1.inc_rei", + 8 => "t1.paginas", + 9 => "t1.tirada", + 10 => "t1.total_pedido", + 11 => "t6.estado", + ]; + + protected $allowedFields = [ + "version", + "cliente_id", + "tarifa_cliente_id", + "user_created_id", + "user_update_id", + "forma_pago_id", + "tipo_impresion_id", + "tipologia_id", + "pais_id", + "serie_id", + "catalogo_id", + "estado_id", + "inc_rei", + "causa_cancelacion", + "retractilado", + "retractilado5", + "guardas", + "faja_color", + "recoger_en_taller", + "ferro", + "ferro_digital", + "marcapaginas", + "prototipo", + "papel_formato_id", + "papel_formato_personalizado", + "papel_formato_ancho", + "papel_formato_alto", + "titulo", + "autor", + "coleccion", + "numero_edicion", + "isbn", + "referencia_cliente", + "paginas", + "tirada", + "solapas", + "solapas_ancho", + "cosido", + "sobrecubiertas", + "sobrecubiertas_ancho", + "merma", + "merma_portada", + "imagenes_bn_interior", + "comentarios", + "comentarios_safekat", + "comentarios_pdf", + "comentarios_tarifa", + "en_produccion", + "en_espera", + "modo_comparador", + "paginas_negro", + "paginas_negro_hq", + "paginas_negro_papel_id", + "paginas_negro_papel_impresion_id", + "paginas_negro_forma_id", + "paginas_negro_gramaje", + "paginas_negro_pliegos_libro", + "paginas_negro_pliegos_pedido", + "paginas_negro_pliegos_precio", + "paginas_negro_libro", + "paginas_negro_pedido", + "paginas_negro_mano", + "paginas_negro_peso", + "paginas_negro_maquina_id", + "paginas_negro_tarifa_impresion_id", + "paginas_negro_click", + "paginas_negro_precio", + "paginas_negro_check_papel_total", + "paginas_negro_check_impresion_total", + "paginas_color", + "paginas_color_papel_id", + "paginas_color_papel_impresion_id", + "paginas_color_forma_id", + "paginas_color_gramaje", + "paginas_color_pliegos_libro", + "paginas_color_pliegos_pedido", + "paginas_color_pliegos_precio", + "paginas_color_libro", + "paginas_color_pedido", + "paginas_color_mano", + "paginas_color_peso", + "paginas_color_maquina_id", + "paginas_color_tarifa_impresion_id", + "paginas_color_click", + "paginas_color_precio", + "paginas_color_check_papel_total", + "paginas_color_check_impresion_total", + "paginas_color_posicion", + "paginas_cubierta", + "paginas_cubierta_papel_id", + "paginas_cubierta_papel_impresion_id", + "paginas_cubierta_forma_id", + "paginas_cubierta_gramaje", + "paginas_cubierta_pliegos_libro", + "paginas_cubierta_pliegos_pedido", + "paginas_cubierta_pliegos_precio", + "paginas_cubierta_libro", + "paginas_cubierta_pedido", + "paginas_cubierta_mano", + "paginas_cubierta_peso", + "paginas_cubierta_maquina_id", + "paginas_cubierta_tarifa_impresion_id", + "paginas_cubierta_click", + "paginas_cubierta_precio", + "paginas_cubierta_check_papel_total", + "paginas_cubierta_check_impresion_total", + "paginas_sobrecubierta", + "paginas_sobrecubierta_papel_id", + "paginas_sobrecubierta_papel_impresion_id", + "paginas_sobrecubierta_forma_id", + "paginas_sobrecubierta_gramaje", + "paginas_sobrecubierta_pliegos_libro", + "paginas_sobrecubierta_pliegos_pedido", + "paginas_sobrecubierta_pliegos_precio", + "paginas_sobrecubierta_libro", + "paginas_sobrecubierta_pedido", + "paginas_sobrecubierta_mano", + "paginas_sobrecubierta_peso", + "paginas_sobrecubierta_maquina_id", + "paginas_sobrecubierta_tarifa_impresion_id", + "paginas_sobrecubierta_click", + "paginas_sobrecubierta_precio", + "paginas_sobrecubierta_check_papel_total", + "paginas_sobrecubierta_check_impresion_total", + "lomo", + "isDig", + "total_presupuesto", + "total_pedido", + "total_peso", + "total_click", + "total_preimpresion", + "total_preimpresion_margen", + "total_manipulado", + "total_acabado", + "total_envios", + "envios_recoge_cliente", + "margen", + "margen_extra", + "margen_manual", + "descuento", + "base_imponible", + "total_margen", + "total_margen_extra", + "total_descuento", + "total", + "forzar_total", + "total_calculado", + "total_confirmado", + "total_confirmado_user_id", + "total_confirmado_update_at", + "tirada_alternativa_json_data", + "aprobado_user_id", + "aprobado_at", + "aprobado_json_data", + "comparador_json_data", + "fecha_entrega_real_at", + "fecha_entrega_real_aviso", + "fecha_impresion_at", + "fecha_encuardenado_at", + "fecha_externo_at", + "fecha_ferro_subido_at", + "responsable", + "pedido_espera_fecha", + "pedido_espera_user_id", + "is_deleted", + ]; + protected $returnType = "App\Entities\Presupuestos\PresupuestoEntity"; + + protected $useTimestamps = true; + protected $useSoftDeletes = false; + + protected $createdField = "created_at"; + + protected $updatedField = "updated_at"; + + public static $labelField = "titulo"; + + protected $validationRules = [ + "aprobado_at" => [ + "label" => "Presupuestos.aprobadoAt", + "rules" => "valid_date|permit_empty", + ], + "aprobado_json_data" => [ + "label" => "Presupuestos.aprobadoJsonData", + "rules" => "trim|max_length[16313]", + ], + "autor" => [ + "label" => "Presupuestos.autor", + "rules" => "trim|required|max_length[150]", + ], + "base_imponible" => [ + "label" => "Presupuestos.baseImponible", + "rules" => "decimal|permit_empty", + ], + "catalogo_id" => [ + "label" => "Presupuestos.catalogoId", + "rules" => "integer|permit_empty", + ], + "causa_cancelacion" => [ + "label" => "Presupuestos.causaCancelacion", + "rules" => "trim|max_length[16313]", + ], + "coleccion" => [ + "label" => "Presupuestos.coleccion", + "rules" => "trim|max_length[255]", + ], + "comentarios" => [ + "label" => "Presupuestos.comentarios", + "rules" => "trim|required|max_length[16313]", + ], + "comentarios_pdf" => [ + "label" => "Presupuestos.comentariosPdf", + "rules" => "trim|required|max_length[16313]", + ], + "comentarios_safekat" => [ + "label" => "Presupuestos.comentariosSafekat", + "rules" => "trim|required|max_length[16313]", + ], + "comentarios_tarifa" => [ + "label" => "Presupuestos.comentariosTarifa", + "rules" => "trim|required|max_length[16313]", + ], + "comparador_json_data" => [ + "label" => "Presupuestos.comparadorJsonData", + "rules" => "trim|max_length[16313]", + ], + "sobrecubiertas_ancho" => [ + "label" => "Presupuestos.sobrecubiertasAncho", + "rules" => "required|decimal", + ], + "descuento" => [ + "label" => "Presupuestos.descuento", + "rules" => "required|decimal", + ], + "fecha_encuardenado_at" => [ + "label" => "Presupuestos.fechaEncuardenadoAt", + "rules" => "valid_date|permit_empty", + ], + "fecha_entrega_real_at" => [ + "label" => "Presupuestos.fechaEntregaRealAt", + "rules" => "valid_date|permit_empty", + ], + "fecha_externo_at" => [ + "label" => "Presupuestos.fechaExternoAt", + "rules" => "valid_date|permit_empty", + ], + "fecha_ferro_subido_at" => [ + "label" => "Presupuestos.fechaFerroSubidoAt", + "rules" => "valid_date|permit_empty", + ], + "fecha_impresion_at" => [ + "label" => "Presupuestos.fechaImpresionAt", + "rules" => "valid_date|permit_empty", + ], + "forzar_total" => [ + "label" => "Presupuestos.forzarTotal", + "rules" => "required|decimal", + ], + "inc_rei" => [ + "label" => "Presupuestos.incRei", + "rules" => "integer|permit_empty", + ], + "is_deleted" => [ + "label" => "Presupuestos.isDeleted", + "rules" => "required|integer", + ], + "isbn" => [ + "label" => "Presupuestos.isbn", + "rules" => "trim|max_length[50]", + ], + "lomo" => [ + "label" => "Presupuestos.lomo", + "rules" => "integer|permit_empty", + ], + "margen" => [ + "label" => "Presupuestos.margen", + "rules" => "decimal|permit_empty", + ], + "margen_extra" => [ + "label" => "Presupuestos.margenExtra", + "rules" => "required|decimal", + ], + "margen_manual" => [ + "label" => "Presupuestos.margenManual", + "rules" => "decimal|permit_empty", + ], + "merma" => [ + "label" => "Presupuestos.merma", + "rules" => "required|decimal", + ], + "merma_portada" => [ + "label" => "Presupuestos.mermaPortada", + "rules" => "required|decimal", + ], + "numero_edicion" => [ + "label" => "Presupuestos.numeroEdicion", + "rules" => "trim|max_length[50]", + ], + "paginas" => [ + "label" => "Presupuestos.paginas", + "rules" => "required|integer", + ], + "paginas_color" => [ + "label" => "Presupuestos.paginasColor", + "rules" => "integer|permit_empty", + ], + "paginas_color_click" => [ + "label" => "Presupuestos.paginasColorClick", + "rules" => "decimal|permit_empty", + ], + "paginas_color_forma_id" => [ + "label" => "Presupuestos.paginasColorFormaId", + "rules" => "integer|permit_empty", + ], + "paginas_color_gramaje" => [ + "label" => "Presupuestos.paginasColorGramaje", + "rules" => "decimal|permit_empty", + ], + "paginas_color_libro" => [ + "label" => "Presupuestos.paginasColorLibro", + "rules" => "decimal|permit_empty", + ], + "paginas_color_mano" => [ + "label" => "Presupuestos.paginasColorMano", + "rules" => "decimal|permit_empty", + ], + "paginas_color_pedido" => [ + "label" => "Presupuestos.paginasColorPedido", + "rules" => "decimal|permit_empty", + ], + "paginas_color_peso" => [ + "label" => "Presupuestos.paginasColorPeso", + "rules" => "decimal|permit_empty", + ], + "paginas_color_pliegos_libro" => [ + "label" => "Presupuestos.paginasColorPliegosLibro", + "rules" => "decimal|permit_empty", + ], + "paginas_color_pliegos_pedido" => [ + "label" => "Presupuestos.paginasColorPliegosPedido", + "rules" => "decimal|permit_empty", + ], + "paginas_color_pliegos_precio" => [ + "label" => "Presupuestos.paginasColorPliegosPrecio", + "rules" => "decimal|permit_empty", + ], + "paginas_color_posicion" => [ + "label" => "Presupuestos.paginasColorPosicion", + "rules" => "trim|max_length[16313]", + ], + "paginas_color_precio" => [ + "label" => "Presupuestos.paginasColorPrecio", + "rules" => "decimal|permit_empty", + ], + "paginas_sobrecubierta" => [ + "label" => "Presupuestos.paginasCubierta", + "rules" => "required|in_list[4x0,4x4]", + ], + "paginas_sobrecubierta_click" => [ + "label" => "Presupuestos.paginasCubiertaClick", + "rules" => "decimal|permit_empty", + ], + "paginas_sobrecubierta_forma_id" => [ + "label" => "Presupuestos.paginasCubiertaFormaId", + "rules" => "integer|permit_empty", + ], + "paginas_sobrecubierta_gramaje" => [ + "label" => "Presupuestos.paginasCubiertaGramaje", + "rules" => "decimal|permit_empty", + ], + "paginas_sobrecubierta_libro" => [ + "label" => "Presupuestos.paginasCubiertaLibro", + "rules" => "decimal|permit_empty", + ], + "paginas_sobrecubierta_mano" => [ + "label" => "Presupuestos.paginasCubiertaMano", + "rules" => "decimal|permit_empty", + ], + "paginas_sobrecubierta_pedido" => [ + "label" => "Presupuestos.paginasCubiertaPedido", + "rules" => "decimal|permit_empty", + ], + "paginas_sobrecubierta_peso" => [ + "label" => "Presupuestos.paginasCubiertaPeso", + "rules" => "decimal|permit_empty", + ], + "paginas_sobrecubierta_pliegos_libro" => [ + "label" => "Presupuestos.paginasCubiertaPliegosLibro", + "rules" => "decimal|permit_empty", + ], + "paginas_sobrecubierta_pliegos_pedido" => [ + "label" => "Presupuestos.paginasCubiertaPliegosPedido", + "rules" => "decimal|permit_empty", + ], + "paginas_sobrecubierta_pliegos_precio" => [ + "label" => "Presupuestos.paginasCubiertaPliegosPrecio", + "rules" => "decimal|permit_empty", + ], + "paginas_sobrecubierta_precio" => [ + "label" => "Presupuestos.paginasCubiertaPrecio", + "rules" => "decimal|permit_empty", + ], + "paginas_negro" => [ + "label" => "Presupuestos.paginasNegro", + "rules" => "integer|permit_empty", + ], + "paginas_negro_click" => [ + "label" => "Presupuestos.paginasNegroClick", + "rules" => "decimal|permit_empty", + ], + "paginas_negro_forma_id" => [ + "label" => "Presupuestos.paginasNegroFormaId", + "rules" => "integer|permit_empty", + ], + "paginas_negro_gramaje" => [ + "label" => "Presupuestos.paginasNegroGramaje", + "rules" => "decimal|permit_empty", + ], + "paginas_negro_libro" => [ + "label" => "Presupuestos.paginasNegroLibro", + "rules" => "decimal|permit_empty", + ], + "paginas_negro_mano" => [ + "label" => "Presupuestos.paginasNegroMano", + "rules" => "decimal|permit_empty", + ], + "paginas_negro_pedido" => [ + "label" => "Presupuestos.paginasNegroPedido", + "rules" => "decimal|permit_empty", + ], + "paginas_negro_peso" => [ + "label" => "Presupuestos.paginasNegroPeso", + "rules" => "decimal|permit_empty", + ], + "paginas_negro_pliegos_libro" => [ + "label" => "Presupuestos.paginasNegroPliegosLibro", + "rules" => "decimal|permit_empty", + ], + "paginas_negro_pliegos_pedido" => [ + "label" => "Presupuestos.paginasNegroPliegosPedido", + "rules" => "decimal|permit_empty", + ], + "paginas_negro_pliegos_precio" => [ + "label" => "Presupuestos.paginasNegroPliegosPrecio", + "rules" => "decimal|permit_empty", + ], + "paginas_negro_precio" => [ + "label" => "Presupuestos.paginasNegroPrecio", + "rules" => "decimal|permit_empty", + ], + "paginas_cubierta" => [ + "label" => "Presupuestos.paginasPortada", + "rules" => "required|in_list[4x0,4x4]", + ], + "paginas_cubierta_click" => [ + "label" => "Presupuestos.paginasPortadaClick", + "rules" => "decimal|permit_empty", + ], + "paginas_cubierta_forma_id" => [ + "label" => "Presupuestos.paginasPortadaFormaId", + "rules" => "integer|permit_empty", + ], + "paginas_cubierta_gramaje" => [ + "label" => "Presupuestos.paginasPortadaGramaje", + "rules" => "decimal|permit_empty", + ], + "paginas_cubierta_libro" => [ + "label" => "Presupuestos.paginasPortadaLibro", + "rules" => "decimal|permit_empty", + ], + "paginas_cubierta_mano" => [ + "label" => "Presupuestos.paginasPortadaMano", + "rules" => "decimal|permit_empty", + ], + "paginas_cubierta_pedido" => [ + "label" => "Presupuestos.paginasPortadaPedido", + "rules" => "required|decimal", + ], + "paginas_cubierta_peso" => [ + "label" => "Presupuestos.paginasPortadaPeso", + "rules" => "decimal|permit_empty", + ], + "paginas_cubierta_pliegos_libro" => [ + "label" => "Presupuestos.paginasPortadaPliegosLibro", + "rules" => "decimal|permit_empty", + ], + "paginas_cubierta_pliegos_pedido" => [ + "label" => "Presupuestos.paginasPortadaPliegosPedido", + "rules" => "decimal|permit_empty", + ], + "paginas_cubierta_pliegos_precio" => [ + "label" => "Presupuestos.paginasPortadaPliegosPrecio", + "rules" => "decimal|permit_empty", + ], + "paginas_cubierta_precio" => [ + "label" => "Presupuestos.paginasPortadaPrecio", + "rules" => "decimal|permit_empty", + ], + "papel_formato_alto" => [ + "label" => "Presupuestos.papelFormatoAlto", + "rules" => "decimal|permit_empty", + ], + "papel_formato_ancho" => [ + "label" => "Presupuestos.papelFormatoAncho", + "rules" => "decimal|permit_empty", + ], + "pedido_espera_fecha" => [ + "label" => "Presupuestos.pedidoEsperaFecha", + "rules" => "valid_date|permit_empty", + ], + "referencia_cliente" => [ + "label" => "Presupuestos.referenciaCliente", + "rules" => "trim|required|max_length[100]", + ], + "responsable" => [ + "label" => "Presupuestos.responsable", + "rules" => "trim|max_length[32]", + ], + "serie_id" => [ + "label" => "Presupuestos.serieId", + "rules" => "integer|permit_empty", + ], + "solapas_ancho" => [ + "label" => "Presupuestos.solapasAncho", + "rules" => "required|decimal", + ], + "tarifa_cliente_id" => [ + "label" => "Presupuestos.tarifaClienteId", + "rules" => "integer|permit_empty", + ], + "tirada" => [ + "label" => "Presupuestos.tirada", + "rules" => "required|integer", + ], + "tirada_alternativa_json_data" => [ + "label" => "Presupuestos.tiradaAlternativaJsonData", + "rules" => "trim|max_length[16313]", + ], + "titulo" => [ + "label" => "Presupuestos.titulo", + "rules" => "trim|required|max_length[300]", + ], + "total" => [ + "label" => "Presupuestos.total", + "rules" => "decimal|permit_empty", + ], + "total_acabado" => [ + "label" => "Presupuestos.totalAcabado", + "rules" => "decimal|permit_empty", + ], + "total_calculado" => [ + "label" => "Presupuestos.totalCalculado", + "rules" => "decimal|permit_empty", + ], + "total_click" => [ + "label" => "Presupuestos.totalClick", + "rules" => "decimal|permit_empty", + ], + "total_confirmado" => [ + "label" => "Presupuestos.totalConfirmado", + "rules" => "decimal|permit_empty", + ], + "total_confirmado_update_at" => [ + "label" => "Presupuestos.totalConfirmadoUpdateAt", + "rules" => "valid_date|permit_empty", + ], + "total_descuento" => [ + "label" => "Presupuestos.totalDescuento", + "rules" => "decimal|permit_empty", + ], + "total_envios" => [ + "label" => "Presupuestos.totalEnvios", + "rules" => "decimal|permit_empty", + ], + "total_manipulado" => [ + "label" => "Presupuestos.totalManipulado", + "rules" => "decimal|permit_empty", + ], + "total_margen" => [ + "label" => "Presupuestos.totalMargen", + "rules" => "decimal|permit_empty", + ], + "total_margen_extra" => [ + "label" => "Presupuestos.totalMargenExtra", + "rules" => "decimal|permit_empty", + ], + "total_pedido" => [ + "label" => "Presupuestos.totalPedido", + "rules" => "decimal|permit_empty", + ], + "total_peso" => [ + "label" => "Presupuestos.totalPeso", + "rules" => "decimal|permit_empty", + ], + "total_preimpresion" => [ + "label" => "Presupuestos.totalPreimpresion", + "rules" => "decimal|permit_empty", + ], + "total_preimpresion_margen" => [ + "label" => "Presupuestos.totalPreimpresionMargen", + "rules" => "decimal|permit_empty", + ], + "total_presupuesto" => [ + "label" => "Presupuestos.totalPresupuesto", + "rules" => "decimal|permit_empty", + ], + "user_created_id" => [ + "label" => "Presupuestos.userCreatedId", + "rules" => "required|integer", + ], + "user_update_id" => [ + "label" => "Presupuestos.userUpdateId", + "rules" => "integer|permit_empty", + ], + "version" => [ + "label" => "Presupuestos.version", + "rules" => "required|integer", + ], + ]; + + protected $validationMessages = [ + "aprobado_at" => [ + "valid_date" => "Presupuestos.validation.aprobado_at.valid_date", + ], + "aprobado_json_data" => [ + "max_length" => "Presupuestos.validation.aprobado_json_data.max_length", + ], + "autor" => [ + "max_length" => "Presupuestos.validation.autor.max_length", + "required" => "Presupuestos.validation.autor.required", + ], + "base_imponible" => [ + "decimal" => "Presupuestos.validation.base_imponible.decimal", + ], + "catalogo_id" => [ + "integer" => "Presupuestos.validation.catalogo_id.integer", + ], + "causa_cancelacion" => [ + "max_length" => "Presupuestos.validation.causa_cancelacion.max_length", + ], + "coleccion" => [ + "max_length" => "Presupuestos.validation.coleccion.max_length", + ], + "comentarios" => [ + "max_length" => "Presupuestos.validation.comentarios.max_length", + "required" => "Presupuestos.validation.comentarios.required", + ], + "comentarios_pdf" => [ + "max_length" => "Presupuestos.validation.comentarios_pdf.max_length", + "required" => "Presupuestos.validation.comentarios_pdf.required", + ], + "comentarios_safekat" => [ + "max_length" => "Presupuestos.validation.comentarios_safekat.max_length", + "required" => "Presupuestos.validation.comentarios_safekat.required", + ], + "comentarios_tarifa" => [ + "max_length" => "Presupuestos.validation.comentarios_tarifa.max_length", + "required" => "Presupuestos.validation.comentarios_tarifa.required", + ], + "comparador_json_data" => [ + "max_length" => "Presupuestos.validation.comparador_json_data.max_length", + ], + "sobrecubiertas_ancho" => [ + "decimal" => "Presupuestos.validation.sobrecubiertas_ancho.decimal", + "required" => "Presupuestos.validation.sobrecubiertas_ancho.required", + ], + "descuento" => [ + "decimal" => "Presupuestos.validation.descuento.decimal", + "required" => "Presupuestos.validation.descuento.required", + ], + "fecha_encuardenado_at" => [ + "valid_date" => "Presupuestos.validation.fecha_encuardenado_at.valid_date", + ], + "fecha_entrega_real_at" => [ + "valid_date" => "Presupuestos.validation.fecha_entrega_real_at.valid_date", + ], + "fecha_externo_at" => [ + "valid_date" => "Presupuestos.validation.fecha_externo_at.valid_date", + ], + "fecha_ferro_subido_at" => [ + "valid_date" => "Presupuestos.validation.fecha_ferro_subido_at.valid_date", + ], + "fecha_impresion_at" => [ + "valid_date" => "Presupuestos.validation.fecha_impresion_at.valid_date", + ], + "forzar_total" => [ + "decimal" => "Presupuestos.validation.forzar_total.decimal", + "required" => "Presupuestos.validation.forzar_total.required", + ], + "inc_rei" => [ + "integer" => "Presupuestos.validation.inc_rei.integer", + ], + "is_deleted" => [ + "integer" => "Presupuestos.validation.is_deleted.integer", + "required" => "Presupuestos.validation.is_deleted.required", + ], + "isbn" => [ + "max_length" => "Presupuestos.validation.isbn.max_length", + ], + "lomo" => [ + "integer" => "Presupuestos.validation.lomo.integer", + ], + "margen" => [ + "decimal" => "Presupuestos.validation.margen.decimal", + ], + "margen_extra" => [ + "decimal" => "Presupuestos.validation.margen_extra.decimal", + "required" => "Presupuestos.validation.margen_extra.required", + ], + "margen_manual" => [ + "decimal" => "Presupuestos.validation.margen_manual.decimal", + ], + "merma" => [ + "decimal" => "Presupuestos.validation.merma.decimal", + "required" => "Presupuestos.validation.merma.required", + ], + "merma_portada" => [ + "decimal" => "Presupuestos.validation.merma_portada.decimal", + "required" => "Presupuestos.validation.merma_portada.required", + ], + "numero_edicion" => [ + "max_length" => "Presupuestos.validation.numero_edicion.max_length", + ], + "paginas" => [ + "integer" => "Presupuestos.validation.paginas.integer", + "required" => "Presupuestos.validation.paginas.required", + ], + "paginas_color" => [ + "integer" => "Presupuestos.validation.paginas_color.integer", + ], + "paginas_color_click" => [ + "decimal" => "Presupuestos.validation.paginas_color_click.decimal", + ], + "paginas_color_forma_id" => [ + "integer" => "Presupuestos.validation.paginas_color_forma_id.integer", + ], + "paginas_color_gramaje" => [ + "decimal" => "Presupuestos.validation.paginas_color_gramaje.decimal", + ], + "paginas_color_libro" => [ + "decimal" => "Presupuestos.validation.paginas_color_libro.decimal", + ], + "paginas_color_mano" => [ + "decimal" => "Presupuestos.validation.paginas_color_mano.decimal", + ], + "paginas_color_pedido" => [ + "decimal" => "Presupuestos.validation.paginas_color_pedido.decimal", + ], + "paginas_color_peso" => [ + "decimal" => "Presupuestos.validation.paginas_color_peso.decimal", + ], + "paginas_color_pliegos_libro" => [ + "decimal" => "Presupuestos.validation.paginas_color_pliegos_libro.decimal", + ], + "paginas_color_pliegos_pedido" => [ + "decimal" => "Presupuestos.validation.paginas_color_pliegos_pedido.decimal", + ], + "paginas_color_pliegos_precio" => [ + "decimal" => "Presupuestos.validation.paginas_color_pliegos_precio.decimal", + ], + "paginas_color_posicion" => [ + "max_length" => "Presupuestos.validation.paginas_color_posicion.max_length", + ], + "paginas_color_precio" => [ + "decimal" => "Presupuestos.validation.paginas_color_precio.decimal", + ], + "paginas_sobrecubierta" => [ + "in_list" => "Presupuestos.validation.paginas_sobrecubierta.in_list", + "required" => "Presupuestos.validation.paginas_sobrecubierta.required", + ], + "paginas_sobrecubierta_click" => [ + "decimal" => "Presupuestos.validation.paginas_sobrecubierta_click.decimal", + ], + "paginas_sobrecubierta_forma_id" => [ + "integer" => "Presupuestos.validation.paginas_sobrecubierta_forma_id.integer", + ], + "paginas_sobrecubierta_gramaje" => [ + "decimal" => "Presupuestos.validation.paginas_sobrecubierta_gramaje.decimal", + ], + "paginas_sobrecubierta_libro" => [ + "decimal" => "Presupuestos.validation.paginas_sobrecubierta_libro.decimal", + ], + "paginas_sobrecubierta_mano" => [ + "decimal" => "Presupuestos.validation.paginas_sobrecubierta_mano.decimal", + ], + "paginas_sobrecubierta_pedido" => [ + "decimal" => "Presupuestos.validation.paginas_sobrecubierta_pedido.decimal", + ], + "paginas_sobrecubierta_peso" => [ + "decimal" => "Presupuestos.validation.paginas_sobrecubierta_peso.decimal", + ], + "paginas_sobrecubierta_pliegos_libro" => [ + "decimal" => "Presupuestos.validation.paginas_sobrecubierta_pliegos_libro.decimal", + ], + "paginas_sobrecubierta_pliegos_pedido" => [ + "decimal" => "Presupuestos.validation.paginas_sobrecubierta_pliegos_pedido.decimal", + ], + "paginas_sobrecubierta_pliegos_precio" => [ + "decimal" => "Presupuestos.validation.paginas_sobrecubierta_pliegos_precio.decimal", + ], + "paginas_sobrecubierta_precio" => [ + "decimal" => "Presupuestos.validation.paginas_sobrecubierta_precio.decimal", + ], + "paginas_negro" => [ + "integer" => "Presupuestos.validation.paginas_negro.integer", + ], + "paginas_negro_click" => [ + "decimal" => "Presupuestos.validation.paginas_negro_click.decimal", + ], + "paginas_negro_forma_id" => [ + "integer" => "Presupuestos.validation.paginas_negro_forma_id.integer", + ], + "paginas_negro_gramaje" => [ + "decimal" => "Presupuestos.validation.paginas_negro_gramaje.decimal", + ], + "paginas_negro_libro" => [ + "decimal" => "Presupuestos.validation.paginas_negro_libro.decimal", + ], + "paginas_negro_mano" => [ + "decimal" => "Presupuestos.validation.paginas_negro_mano.decimal", + ], + "paginas_negro_pedido" => [ + "decimal" => "Presupuestos.validation.paginas_negro_pedido.decimal", + ], + "paginas_negro_peso" => [ + "decimal" => "Presupuestos.validation.paginas_negro_peso.decimal", + ], + "paginas_negro_pliegos_libro" => [ + "decimal" => "Presupuestos.validation.paginas_negro_pliegos_libro.decimal", + ], + "paginas_negro_pliegos_pedido" => [ + "decimal" => "Presupuestos.validation.paginas_negro_pliegos_pedido.decimal", + ], + "paginas_negro_pliegos_precio" => [ + "decimal" => "Presupuestos.validation.paginas_negro_pliegos_precio.decimal", + ], + "paginas_negro_precio" => [ + "decimal" => "Presupuestos.validation.paginas_negro_precio.decimal", + ], + "paginas_cubierta" => [ + "in_list" => "Presupuestos.validation.paginas_cubierta.in_list", + "required" => "Presupuestos.validation.paginas_cubierta.required", + ], + "paginas_cubierta_click" => [ + "decimal" => "Presupuestos.validation.paginas_cubierta_click.decimal", + ], + "paginas_cubierta_forma_id" => [ + "integer" => "Presupuestos.validation.paginas_cubierta_forma_id.integer", + ], + "paginas_cubierta_gramaje" => [ + "decimal" => "Presupuestos.validation.paginas_cubierta_gramaje.decimal", + ], + "paginas_cubierta_libro" => [ + "decimal" => "Presupuestos.validation.paginas_cubierta_libro.decimal", + ], + "paginas_cubierta_mano" => [ + "decimal" => "Presupuestos.validation.paginas_cubierta_mano.decimal", + ], + "paginas_cubierta_pedido" => [ + "decimal" => "Presupuestos.validation.paginas_cubierta_pedido.decimal", + "required" => "Presupuestos.validation.paginas_cubierta_pedido.required", + ], + "paginas_cubierta_peso" => [ + "decimal" => "Presupuestos.validation.paginas_cubierta_peso.decimal", + ], + "paginas_cubierta_pliegos_libro" => [ + "decimal" => "Presupuestos.validation.paginas_cubierta_pliegos_libro.decimal", + ], + "paginas_cubierta_pliegos_pedido" => [ + "decimal" => "Presupuestos.validation.paginas_cubierta_pliegos_pedido.decimal", + ], + "paginas_cubierta_pliegos_precio" => [ + "decimal" => "Presupuestos.validation.paginas_cubierta_pliegos_precio.decimal", + ], + "paginas_cubierta_precio" => [ + "decimal" => "Presupuestos.validation.paginas_cubierta_precio.decimal", + ], + "papel_formato_alto" => [ + "decimal" => "Presupuestos.validation.papel_formato_alto.decimal", + ], + "papel_formato_ancho" => [ + "decimal" => "Presupuestos.validation.papel_formato_ancho.decimal", + ], + "pedido_espera_fecha" => [ + "valid_date" => "Presupuestos.validation.pedido_espera_fecha.valid_date", + ], + "referencia_cliente" => [ + "max_length" => "Presupuestos.validation.referencia_cliente.max_length", + "required" => "Presupuestos.validation.referencia_cliente.required", + ], + "responsable" => [ + "max_length" => "Presupuestos.validation.responsable.max_length", + ], + "serie_id" => [ + "integer" => "Presupuestos.validation.serie_id.integer", + ], + "solapas_ancho" => [ + "decimal" => "Presupuestos.validation.solapas_ancho.decimal", + "required" => "Presupuestos.validation.solapas_ancho.required", + ], + "tarifa_cliente_id" => [ + "integer" => "Presupuestos.validation.tarifa_cliente_id.integer", + ], + "tirada" => [ + "integer" => "Presupuestos.validation.tirada.integer", + "required" => "Presupuestos.validation.tirada.required", + ], + "tirada_alternativa_json_data" => [ + "max_length" => "Presupuestos.validation.tirada_alternativa_json_data.max_length", + ], + "titulo" => [ + "max_length" => "Presupuestos.validation.titulo.max_length", + "required" => "Presupuestos.validation.titulo.required", + ], + "total" => [ + "decimal" => "Presupuestos.validation.total.decimal", + ], + "total_acabado" => [ + "decimal" => "Presupuestos.validation.total_acabado.decimal", + ], + "total_calculado" => [ + "decimal" => "Presupuestos.validation.total_calculado.decimal", + ], + "total_click" => [ + "decimal" => "Presupuestos.validation.total_click.decimal", + ], + "total_confirmado" => [ + "decimal" => "Presupuestos.validation.total_confirmado.decimal", + ], + "total_confirmado_update_at" => [ + "valid_date" => "Presupuestos.validation.total_confirmado_update_at.valid_date", + ], + "total_descuento" => [ + "decimal" => "Presupuestos.validation.total_descuento.decimal", + ], + "total_envios" => [ + "decimal" => "Presupuestos.validation.total_envios.decimal", + ], + "total_manipulado" => [ + "decimal" => "Presupuestos.validation.total_manipulado.decimal", + ], + "total_margen" => [ + "decimal" => "Presupuestos.validation.total_margen.decimal", + ], + "total_margen_extra" => [ + "decimal" => "Presupuestos.validation.total_margen_extra.decimal", + ], + "total_pedido" => [ + "decimal" => "Presupuestos.validation.total_pedido.decimal", + ], + "total_peso" => [ + "decimal" => "Presupuestos.validation.total_peso.decimal", + ], + "total_preimpresion" => [ + "decimal" => "Presupuestos.validation.total_preimpresion.decimal", + ], + "total_preimpresion_margen" => [ + "decimal" => "Presupuestos.validation.total_preimpresion_margen.decimal", + ], + "total_presupuesto" => [ + "decimal" => "Presupuestos.validation.total_presupuesto.decimal", + ], + "user_created_id" => [ + "integer" => "Presupuestos.validation.user_created_id.integer", + "required" => "Presupuestos.validation.user_created_id.required", + ], + "user_update_id" => [ + "integer" => "Presupuestos.validation.user_update_id.integer", + ], + "version" => [ + "integer" => "Presupuestos.validation.version.integer", + "required" => "Presupuestos.validation.version.required", + ], + ]; + public function findAllWithAllRelations(string $selcols = "*", int $limit = null, int $offset = 0) + { + $sql = + "SELECT t1." . + $selcols . + ", t2.nombre AS cliente, t3.nombre AS forma_pago, t4.nombre AS tipo_impresion, t5.nombre AS tipologia, t6.nombre AS pais, t8.estado AS estado, t9.id AS papel_formato, t10.nombre AS paginas_negro_papel, t11.nombre AS paginas_negro_papel_impresion, t12.nombre AS paginas_negro_maquina, t13.precio AS paginas_negro_tarifa_impresion, t14.nombre AS paginas_color_papel, t15.nombre AS paginas_color_papel_impresion, t16.nombre AS paginas_color_maquina, t17.precio AS paginas_color_tarifa_impresion, t18.nombre AS paginas_cubierta_papel, t19.nombre AS paginas_cubierta_papel_impresion, t20.nombre AS paginas_cubierta_maquina, t21.id AS paginas_cubierta_tarifa_impresion, t22.nombre AS paginas_sobrecubierta_papel, t23.nombre AS paginas_sobrecubierta_papel_impresion, t24.nombre AS paginas_sobrecubierta_maquina, t25.precio AS paginas_sobrecubierta_tarifa_impresion, t26.first_name AS total_confirmado_user, t27.first_name AS aprobado_user, t28.first_name AS pedido_espera_user FROM " . + $this->table . + " t1 LEFT JOIN clientes t2 ON t1.cliente_id = t2.id LEFT JOIN lg_formas_pago t3 ON t1.forma_pago_id = t3.id LEFT JOIN lg_tipos_impresion t4 ON t1.tipo_impresion_id = t4.id LEFT JOIN lg_tipologias_libros t5 ON t1.tipologia_id = t5.id LEFT JOIN lg_paises t6 ON t1.pais_id = t6.id = t7.id LEFT JOIN presupuesto_estados t8 ON t1.estado_id = t8.id LEFT JOIN lg_papel_formato t9 ON t1.papel_formato_id = t9.id LEFT JOIN lg_papel_generico t10 ON t1.paginas_negro_papel_id = t10.id LEFT JOIN lg_papel_impresion t11 ON t1.paginas_negro_papel_impresion_id = t11.id LEFT JOIN lg_maquinas t12 ON t1.paginas_negro_maquina_id = t12.id LEFT JOIN lg_maquinas_tarifas_impresion t13 ON t1.paginas_negro_tarifa_impresion_id = t13.id LEFT JOIN lg_papel_generico t14 ON t1.paginas_color_papel_id = t14.id LEFT JOIN lg_papel_impresion t15 ON t1.paginas_color_papel_impresion_id = t15.id LEFT JOIN lg_maquinas t16 ON t1.paginas_color_maquina_id = t16.id LEFT JOIN lg_maquinas_tarifas_impresion t17 ON t1.paginas_color_tarifa_impresion_id = t17.id LEFT JOIN lg_papel_generico t18 ON t1.paginas_cubierta_papel_id = t18.id LEFT JOIN lg_papel_impresion t19 ON t1.paginas_cubierta_papel_impresion_id = t19.id LEFT JOIN lg_maquinas t20 ON t1.paginas_cubierta_maquina_id = t20.id LEFT JOIN lg_maquinas_tarifas_impresion t21 ON t1.paginas_cubierta_tarifa_impresion_id = t21.id LEFT JOIN lg_papel_generico t22 ON t1.paginas_sobrecubierta_papel_id = t22.id LEFT JOIN lg_papel_impresion t23 ON t1.paginas_sobrecubierta_papel_impresion_id = t23.id LEFT JOIN lg_maquinas t24 ON t1.paginas_sobrecubierta_maquina_id = t24.id LEFT JOIN lg_maquinas_tarifas_impresion t25 ON t1.paginas_sobrecubierta_tarifa_impresion_id = t25.id LEFT JOIN auth_user t26 ON t1.total_confirmado_user_id = t26.id_user LEFT JOIN auth_user t27 ON t1.aprobado_user_id = t27.id_user LEFT JOIN auth_user t28 ON t1.pedido_espera_user_id = t28.id_user"; + if (!is_null($limit) && intval($limit) > 0) { + $sql .= " LIMIT " . intval($limit); + } + + if (!is_null($offset) && intval($offset) > 0) { + $sql .= " OFFSET " . intval($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 = "") + { + $builder = $this->db + ->table($this->table . " t1") + ->select( + "t1.id AS id, t1.created_at AS fecha, t2.nombre AS cliente, + CONCAT(t3.first_name, ' ', t3.last_name) AS comercial, t1.titulo AS titulo, + t5.nombre AS pais, t1.inc_rei AS inc_rei, t1.paginas AS paginas, t1.tirada AS tirada, + t1.total_pedido AS total_pedido, t6.estado AS estado" + ); + $builder->join("clientes t2", "t1.cliente_id = t2.id", "left"); + $builder->join("auth_user t3", "t1.user_update_id = t3.id_user", "left"); + $builder->join("lg_paises t5", "t1.pais_id = t5.id", "left"); + $builder->join("presupuesto_estados t6", "t1.estado_id = t6.id", "left"); + + return empty($search) + ? $builder + : $builder + ->groupStart() + ->like("t1.id", $search) + ->orLike("t1.created_at", $search) + ->orLike("t2.nombre", $search) + ->orLike("t3.first_name", $search) + ->orLike("t3.last_name", $search) + ->orLike("t1.titulo", $search) + ->orLike("t4.nombre", $search) + ->orLike("t5.nombre", $search) + ->orLike("t1.inc_rei", $search) + ->orLike("t1.paginas", $search) + ->orLike("t1.tirada", $search) + ->orLike("t1.total_pedido ", $search) + ->orLike("t6.estado", $search) + ->orLike("t1.id", $search) + ->orLike("t1.created_at", $search) + ->orLike("t2.nombre", $search) + ->orLike("t3.first_name", $search) + ->orLike("t3.last_name", $search) + ->orLike("t1.titulo", $search) + ->orLike("t4.nombre", $search) + ->orLike("t5.nombre", $search) + ->orLike("t1.inc_rei", $search) + ->orLike("t1.paginas", $search) + ->orLike("t1.tirada", $search) + ->orLike("t1.total_pedido ", $search) + ->orLike("t6.estado", $search) + ->groupEnd(); + } +} diff --git a/ci4/app/Services/PresupuestoService.php b/ci4/app/Services/PresupuestoService.php new file mode 100644 index 00000000..6c2eb28d --- /dev/null +++ b/ci4/app/Services/PresupuestoService.php @@ -0,0 +1,27 @@ + +
+
+ + +
+ +
+ + +
+ +
+ + \ No newline at end of file diff --git a/ci4/app/Views/themes/backend/vuexy/form/configuracion/papelformato/viewPapelFormatoForm.php b/ci4/app/Views/themes/backend/vuexy/form/configuracion/papelformato/viewPapelFormatoForm.php new file mode 100644 index 00000000..e67af5db --- /dev/null +++ b/ci4/app/Views/themes/backend/vuexy/form/configuracion/papelformato/viewPapelFormatoForm.php @@ -0,0 +1,26 @@ +include("Themes/_commonPartialsBs/select2bs5") ?> +include("Themes/_commonPartialsBs/sweetalert") ?> +extend("Themes/" . config("Basics")->theme["name"] . "/AdminLayout/defaultLayout") ?> +section("content") ?> +
+
+
+
+

+
+
+ +
+ + getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?> + +
+ +
+
+
+
+endSection() ?> diff --git a/ci4/app/Views/themes/backend/vuexy/form/configuracion/papelformato/viewPapelFormatoList.php b/ci4/app/Views/themes/backend/vuexy/form/configuracion/papelformato/viewPapelFormatoList.php new file mode 100644 index 00000000..30b4a86a --- /dev/null +++ b/ci4/app/Views/themes/backend/vuexy/form/configuracion/papelformato/viewPapelFormatoList.php @@ -0,0 +1,187 @@ +include('Themes/_commonPartialsBs/datatables') ?> +include('Themes/_commonPartialsBs/sweetalert') ?> +extend('Themes/'.config('Basics')->theme['name'].'/AdminLayout/defaultLayout') ?> +section('content'); ?> +
+
+ +
+
+

+
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +endSection() ?> + + +section('additionalInlineJs') ?> + + const lastColNr = $('#tableOfPapelesformatos').find("tr:first th").length - 1; + const actionBtns = function(data) { + return ` +
+ + +
+ `; + }; + theTable = $('#tableOfPapelesformatos').DataTable({ + processing: true, + serverSide: true, + autoWidth: true, + responsive: true, + scrollX: true, + lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ], + pageLength: 10, + lengthChange: true, + "dom": 'lfrtipB', // 'lfBrtip', // you can try different layout combinations by uncommenting one or the other + // "dom": '<"top"lf><"clear">rt<"bottom"ipB><"clear">', // remember to comment this line if you uncomment the above + "buttons": [ + 'copy', 'csv', 'excel', 'print', { + extend: 'pdfHtml5', + orientation: 'landscape', + pageSize: 'A4' + } + ], + stateSave: true, + order: [[1, 'asc']], + language: { + url: "/assets/dt/languages[$currentLocale] ?? config('Basics')->i18n ?>.json" + }, + ajax : $.fn.dataTable.pipeline( { + url: '', + method: 'POST', + headers: {'X-Requested-With': 'XMLHttpRequest'}, + async: true, + }), + columnDefs: [ + { + orderable: false, + searchable: false, + targets: [0,lastColNr] + } + ], + columns : [ + { 'data': actionBtns }, + { 'data': 'id' }, + { 'data': 'ancho' }, + { 'data': 'alto' }, + { 'data': 'created_at' }, + { 'data': 'updated_at' }, + { 'data': actionBtns } + ] + }); + + + theTable.on( 'draw.dt', function () { + + const dateCols = [4, 5]; + const shortDateFormat = ''; + const dateTimeFormat = ''; + + for (let coln of dateCols) { + theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) { + const datestr = cell.innerHTML; + const dateStrLen = datestr.toString().trim().length; + if (dateStrLen > 0) { + let dateTimeParts= datestr.split(/[- :]/); // regular expression split that creates array with: year, month, day, hour, minutes, seconds values + dateTimeParts[1]--; // monthIndex begins with 0 for January and ends with 11 for December so we need to decrement by one + const d = new Date(...dateTimeParts); // new Date(datestr); + const md = moment(d); + const usingThisFormat = dateStrLen > 11 ? dateTimeFormat : shortDateFormat; + const formattedDateStr = md.format(usingThisFormat); + cell.innerHTML = formattedDateStr; + } + }); + } + }); + +$(document).on('click', '.btn-edit', function(e) { + window.location.href = `/${$(this).attr('data-id')}/edit`; + }); + +$(document).on('click', '.btn-delete', function(e) { + Swal.fire({ + title: '', + text: '', + icon: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + confirmButtonText: '', + cancelButtonText: '', + cancelButtonColor: '#d33' + }) + .then((result) => { + const dataId = $(this).data('id'); + const row = $(this).closest('tr'); + if (result.value) { + $.ajax({ + url: `/${dataId}`, + method: 'DELETE', + }).done((data, textStatus, jqXHR) => { + Toast.fire({ + icon: 'success', + title: data.msg ?? jqXHR.statusText, + }); + + theTable.clearPipeline(); + theTable.row($(row)).invalidate().draw(); + }).fail((jqXHR, textStatus, errorThrown) => { + Toast.fire({ + icon: 'error', + title: jqXHR.responseJSON.messages.error, + }); + }) + } + }); + }); + + + + +endSection() ?> + + +section('css') ?> + +endSection() ?> + + +section('additionalExternalJs') ?> + + + + + + + + + + +endSection() ?> + diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_cosidotapablandaFormItems.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_cosidotapablandaFormItems.php new file mode 100644 index 00000000..bcb20c95 --- /dev/null +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_cosidotapablandaFormItems.php @@ -0,0 +1,1318 @@ +
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+ +
+ + +
+ + + +
+
+ + +
+
+ +
+ + +
+ + + + + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+ + +
+ +
+
+ + +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ + +
+
+ +
+
+
+
+ + +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+ + +
+ +
+ + +
+ +
+ +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+ + +
+ +
+
+ + +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ + +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+ + +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
\ No newline at end of file diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems.php new file mode 100644 index 00000000..b458aaf7 --- /dev/null +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems.php @@ -0,0 +1,262 @@ +
+
+

+ +

+ +
+
+ + +
+
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ solapas == true ? 'checked' : ''; ?>> + +
+ +
+ +
+ +
+ +
+
+ + +
+
+ + +
+
+ + + + +
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+ papel_formato_personalizado == true ? 'checked' : ''; ?>> + +
+ +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ +
+ +
+ + + +
+ + + + + + + + +
+
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ + +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+ + +
+ + +
+ +
+
+
+ +
+
+
+ + +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+ +
+ +
+
+
+ +
+
+
+ +
+ +
+
+
+
\ No newline at end of file diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems.php new file mode 100644 index 00000000..8bf30aaa --- /dev/null +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems.php @@ -0,0 +1,409 @@ +
+
+

+ +

+ +
+
+ + +
+
+
+
+
+
+
+ +
+
+ + + + + +
+
+
+
+
+ +
+
+

+
+
+

+
+
+

+
+
+

+
+
+
+
+
+
+ + +
+
+

+
+
+ +
+
+ +
+
+ +
+
+
+
+
+ + +
+
+

+
+
+ +
+
+ +
+
+ +
+
+
+
+
+ + +
+
+

+
+
+ +
+
+ +
+
+ +
+
+
+
+
+ + +
+
+

+
+
+ +
+
+ +
+
+ +
+
+
+
+
+ + +
+
+

+
+
+ +
+
+ +
+
+ +
+
+
+
+
+ + + +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+ + +
+
+ +
+

+
+
+ + + +
+
+

+ +

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
: 0.00
+ +
+
+
+
+ + +
+
+

+ +

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
:0.00
+ +
+
+
+
+ +
+
+

+ +

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
:0.00
+ + +
+
+
+
+ + + +
+
+
+
\ No newline at end of file diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoItems.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoItems.php new file mode 100644 index 00000000..8429d740 --- /dev/null +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoItems.php @@ -0,0 +1,169 @@ +
+
+

+ +

+ +
+
+ + +
+
+
+ + +
+
+ +
+
+ + "> +
+
+ +
+
+ + +
+
+ +
+
+ + + +
+ +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ + + +
+
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ +
+ + + +
+
+
+ + +
+
+ +
+
+ + +
+
+ + +
+ +
+
+
+
\ No newline at end of file diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems.php new file mode 100644 index 00000000..37982a92 --- /dev/null +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems.php @@ -0,0 +1,33 @@ +
+
+

+ +

+ +
+
+
+
+ + + +
+
+
+
+
+
\ No newline at end of file diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/comparador.js b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/comparador.js new file mode 100644 index 00000000..c91da748 --- /dev/null +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/comparador.js @@ -0,0 +1,197 @@ +/******************************* + * Eventos asociados a elementos HTML + *******************************/ +$("#solapas").on("click", function () { + var e = document.getElementById('div_solapas_ancho'); + if (document.getElementById('solapas').checked) { + e.style.display = "flex"; + } + else { + e.style.display = "none"; + } +}); + +$('#tipoImpresion').on("change", function () { + updatePapelesComparador(); +}); + +$('#tipoImpresion').on("change", function () { + updatePapelesComparador(); +}); + +$('#compRetractilado').on("change", function () { + checkRetractiladoComparador(this); +}); + +$('#compRetractilado5').on("change", function () { + checkRetractiladoComparador(this); +}); + +$('#imagenesBnInterior').on("change", function () { + var e = document.getElementById('tipoImpresion'); + var optionToHide = e.querySelector("option[value='negro']"); + + if (document.getElementById('imagenesBnInterior').checked) { + optionToHide.setAttribute('disabled', 'disabled') + + if (e.value == 'negro') { + e.value = 'negrohq'; + } + } + else { + optionToHide.removeAttribute('disabled'); + } + $('#tipoImpresion').select2(); +}); + +$('#compPosPaginasColor').on("keyup", function () { + computarPaginasColor(this.value); +}); + + +// Este evento recoloca los headers de las tablas cuando se pulsa el +// boton del acordeon +$('.accordion-button').on('click', function (e) { + $.fn.dataTable.tables({ visible: true, api: true }).columns.adjust(); +}); + + + + + +/******************************* + * Metodos + *******************************/ +function init_comparador() { + updatePapelesComparador(); + const paginasColor = document.getElementById('compCalPaginasColor'); + if (paginasColor.value.length > 0) { + computarPaginasColor(paginasColor.value); + } + +} + + +function computarPaginasColor(string) { + + var numbers = []; + for (const [, beginStr, endStr] of string.matchAll(/(\d+)(?:-(\d+))?/g)) { + const [begin, end] = [beginStr, endStr].map(Number); + numbers.push(begin); + if (endStr !== undefined) { + for (let num = begin + 1; num <= end; num++) { + numbers.push(num); + } + } + } + var numbers2 = []; + numbers.forEach(function (value, i) { + // Si es impar y no está el siguiente par hay que añadirlo + if (value % 2 != 0 && numbers[i + 1] != value + 1) { + numbers2.push(value + 1); + } + }); + numbers = numbers.concat(numbers2); + numbers.sort(function (a, b) { + return a - b; + }); + calPagesTextarea = document.getElementById('compCalPaginasColor'); + calPagesTextarea.value = numbers; + autosize.update(calPagesTextarea); +} + +function checkRetractiladoComparador(element) { + + switch (element.id) { + case 'compRetractilado': + if (document.getElementById(element.id).checked) { + document.getElementById('compRetractilado5').checked = false; + } + break; + case 'compRetractilado5': + if (document.getElementById(element.id).checked) { + document.getElementById('compRetractilado').checked = false; + } + break; + default: + break; + } + +} + +function updatePapelesComparador() { + + var e = document.getElementById("tipoImpresion"); + elements_negro = document.getElementsByClassName('comp-negro-selected'); + elements_negrohq = document.getElementsByClassName('comp-negrohq-selected'); + elements_color = document.getElementsByClassName('comp-color-selected'); + elements_colorhq = document.getElementsByClassName('comp-colorhq-selected'); + switch (e.value) { + case "negro": + Array.from(elements_color).forEach(element => { + element.style.display = "none"; + }); + Array.from(elements_negro).forEach(element => { + element.style.display = "flex"; + }); + Array.from(elements_negrohq).forEach(element => { + element.style.display = "none"; + }); + Array.from(elements_colorhq).forEach(element => { + element.style.display = "none"; + }); + break; + + case "negrohq": + Array.from(elements_color).forEach(element => { + element.style.display = "none"; + }); + Array.from(elements_negro).forEach(element => { + element.style.display = "none"; + }); + Array.from(elements_negrohq).forEach(element => { + element.style.display = "flex"; + }); + Array.from(elements_colorhq).forEach(element => { + element.style.display = "none"; + }); + break; + + case "color": + Array.from(elements_negro).forEach(element => { + element.style.display = "flex"; + }); + Array.from(elements_negrohq).forEach(element => { + element.style.display = "none"; + }); + Array.from(elements_color).forEach(element => { + element.style.display = "flex"; + }); + Array.from(elements_colorhq).forEach(element => { + element.style.display = "none"; + }); + break; + + case "colorhq": + Array.from(elements_negro).forEach(element => { + element.style.display = "none"; + }); + Array.from(elements_negrohq).forEach(element => { + element.style.display = "flex"; + }); + Array.from(elements_color).forEach(element => { + element.style.display = "none"; + }); + Array.from(elements_colorhq).forEach(element => { + element.style.display = "flex"; + }); + break; + + default: + break; + } + + + + +} 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 new file mode 100644 index 00000000..0b877195 --- /dev/null +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaForm.php @@ -0,0 +1,403 @@ +include('themes/_commonPartialsBs/datatables') ?> +include("themes/_commonPartialsBs/select2bs5") ?> +include("themes/_commonPartialsBs/sweetalert") ?> +extend('themes/backend/vuexy/main/defaultlayout') ?> + +section("content") ?> +
+
+
+
+

+
+
+ + + getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?> + + + +
+ " + /> + "btn btn-secondary float-start",]) ?> +
+
+
+
+
+endSection() ?> + + + + + +section("additionalInlineJs") ?> + + $('#clienteId').select2({ + allowClear: false, + ajax: { + url: '', + type: 'post', + dataType: 'json', + + data: function (params) { + return { + id: 'id', + text: 'nombre', + searchTerm: params.term, + : v + }; + }, + delay: 60, + processResults: function (response) { + yeniden(response.); + return { + results: response.menu + }; + }, + cache: true + } + }); + + $('#incRei').select2({ + allowClear: false, + }); + + $('#paisId').select2({ + allowClear: false, + }); + + $('#papelFormatoId').select2({ + allowClear: false, + }); + + $('#tipoImpresion').select2({ + allowClear: false, + }); + + $('#compPapelNegro').select2({ + allowClear: false, + }); + + $('#compGramajeNegro').select2({ + allowClear: false, + }); + + $('#compPapelNegrohq').select2({ + allowClear: false, + }); + + $('#compGramajeNegrohq').select2({ + allowClear: false, + }); + + $('#compPapelColor').select2({ + allowClear: false, + }); + + $('#compPapelColorhq').select2({ + allowClear: false, + }); + + $('#compGramajeColor').select2({ + allowClear: false, + }); + + $('#compPapelCubierta').select2({ + allowClear: false, + }); + + $('#compGramajeCubierta').select2({ + allowClear: false, + }); + + $('#encuadernacion').select2({ + allowClear: false, + }); + + $('#compPaginasCubierta').select2({ + allowClear: false, + minimumResultsForSearch: Infinity, + }); + + + + +endSection() ?> + + + + + +section("additionalInlineJs") ?> + + autosize($('#compCalPaginasColor')); + + + + $('#papelFormatoPersonalizado').on("click",function(){ + var checkbox = document.getElementById('papelFormatoPersonalizado'); + if(checkbox.checked == true){ + document.getElementById("papelFormatoAncho").style.display = "block"; + document.getElementById("papelFormatoAlto").style.display = "block"; + $('#papelFormatoId').next(".select2-container").hide(); + document.getElementById("label_papelFormatoId").innerHTML = + " (" + + " x )*"; + } + else{ + document.getElementById("papelFormatoAncho").style.display = "none"; + document.getElementById("papelFormatoAlto").style.display = "none"; + $('#papelFormatoId').next(".select2-container").show(); + document.getElementById("label_papelFormatoId").innerHTML = + "*"; + } + }); + + + init_comparador(); + + + var tableCompIntPlana = new DataTable('#tableCompIntPlana',{ + scrollX: true, + searching: false, + paging: false, + info: false, + ordering: false, + responsive: true, + language: { + url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/i18n ?>.json" + }, + }); + + + var tableCompIntRotativa = new DataTable('#tableCompIntRotativa',{ + scrollX: true, + searching: false, + paging: false, + info: false, + ordering: false, + responsive: true, + language: { + url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/i18n ?>.json" + }, + }); + + var tableCompIntCubierta = new DataTable('#tableCompCubierta',{ + scrollX: true, + searching: false, + paging: false, + info: false, + ordering: false, + responsive: true, + language: { + url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/i18n ?>.json" + }, + }); + + var tableCompIntSobrecubierta = new DataTable('#tableCompSobrecubierta',{ + scrollX: true, + searching: false, + paging: false, + info: false, + ordering: false, + responsive: true, + language: { + url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/i18n ?>.json" + }, + }); + + + + $('#compPapelNegro').on('select2:select', function (e){ + + $('#compGramajeNegro').val(null).trigger('change'); + $('#compGramajeNegro').prop('disabled', false); + $('#compPapelNegro').find('option[value="0"]').remove(); + $('#compGramajeNegro').select2({ + allowClear: true, + minimumResultsForSearch: Infinity, + ajax: { + url: '', + type: 'post', + dataType: 'json', + + data: function (params) { + return { + tipo: 'gramaje', + datos: $('#compPapelNegro').select2('data')[0].text.trim() , + : v + }; + }, + delay: 60, + processResults: function (response) { + yeniden(response.); + return { + results: response.menu + }; + }, + cache: true + } + }); + }); + + + $('#compPapelNegrohq').on('select2:select', function (e){ + + $('#compGramajeNegrohq').val(null).trigger('change'); + $('#compGramajeNegrohq').prop('disabled', false); + $('#compPapelNegrohq').find('option[value="0"]').remove(); + $('#compGramajeNegrohq').select2({ + allowClear: true, + minimumResultsForSearch: Infinity, + ajax: { + url: '', + type: 'post', + dataType: 'json', + + data: function (params) { + return { + tipo: 'gramaje', + datos: $('#compPapelNegrohq').select2('data')[0].text.trim() , + : v + }; + }, + delay: 60, + processResults: function (response) { + yeniden(response.); + return { + results: response.menu + }; + }, + cache: true + } + }); + }); + + + $('#compPapelColor').on('select2:select', function (e){ + + $('#compGramajeColor').val(null).trigger('change'); + $('#compGramajeColor').prop('disabled', false); + $('#compPapelColor').find('option[value="0"]').remove(); + $('#compGramajeColor').select2({ + allowClear: true, + minimumResultsForSearch: Infinity, + ajax: { + url: '', + type: 'post', + dataType: 'json', + + data: function (params) { + return { + tipo: 'gramaje', + datos: $('#compPapelColor').select2('data')[0].text.trim() , + : v + }; + }, + delay: 60, + processResults: function (response) { + yeniden(response.); + return { + results: response.menu + }; + }, + cache: true + } + }); + }); + + + $('#compPapelColorhq').on('select2:select', function (e){ + + $('#compGramajeColorhq').val(null).trigger('change'); + $('#compGramajeColorhq').prop('disabled', false); + $('#compPapelColorhq').find('option[value="0"]').remove(); + $('#compGramajeColorhq').select2({ + allowClear: true, + minimumResultsForSearch: Infinity, + ajax: { + url: '', + type: 'post', + dataType: 'json', + + data: function (params) { + return { + tipo: 'gramaje', + datos: $('#compPapelColorhq').select2('data')[0].text.trim() , + : v + }; + }, + delay: 60, + processResults: function (response) { + yeniden(response.); + return { + results: response.menu + }; + }, + cache: true + } + }); + }); + + $('#compPapelCubierta').on('select2:select', function (e){ + + $('#compGramajeCubierta').val(null).trigger('change'); + $('#compGramajeCubierta').prop('disabled', false); + $('#compPapelCubierta').find('option[value="0"]').remove(); + $('#compGramajeCubierta').select2({ + allowClear: true, + minimumResultsForSearch: Infinity, + ajax: { + url: '', + type: 'post', + dataType: 'json', + + data: function (params) { + return { + tipo: 'gramaje', + datos: $('#compPapelCubierta').select2('data')[0].text.trim() , + : v + }; + }, + delay: 60, + processResults: function (response) { + yeniden(response.); + return { + results: response.menu + }; + }, + cache: true + } + }); + }); + + + + +endSection() ?> + +section('css') ?> + + + + + +endSection() ?> + +section('additionalExternalJs') ?> + + +endSection() ?> + + +section('additionalExternalJs') ?> + + + + +endSection() ?> \ No newline at end of file diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaList.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaList.php new file mode 100644 index 00000000..994f1fdd --- /dev/null +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaList.php @@ -0,0 +1,195 @@ +include('themes/_commonPartialsBs/select2bs5') ?> +include('themes/_commonPartialsBs/datatables') ?> +include('themes/_commonPartialsBs/sweetalert') ?> +include('themes/_commonPartialsBs/_confirm2delete') ?> +extend('themes/backend/vuexy/main/defaultlayout') ?> +section('content'); ?> +
+
+ +
+
+

+ 'btn btn-primary float-end']); ?> +
+
+ + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +endSection() ?> + + +section('additionalInlineJs') ?> + + const lastColNr = $('#tableOfPresupuestos').find("tr:first th").length - 1; + const actionBtns = function(data) { + return ` + +
+ + +
+ `; + }; + theTable = $('#tableOfPresupuestos').DataTable({ + processing: true, + serverSide: true, + autoWidth: true, + responsive: true, + scrollX: true, + lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ], + pageLength: 50, + lengthChange: true, + "dom": 'lfBrtip', + "buttons": [ + 'colvis', 'copy', 'csv', 'excel', 'print', { + extend: 'pdfHtml5', + orientation: 'landscape', + pageSize: 'A4' + } + ], + stateSave: true, + order: [[1, 'asc']], + language: { + url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/i18n ?>.json" + }, + ajax : $.fn.dataTable.pipeline( { + url: '', + method: 'POST', + headers: {'X-Requested-With': 'XMLHttpRequest'}, + async: true, + }), + columnDefs: [ + { + orderable: false, + searchable: false, + targets: [lastColNr] + } + ], + columns : [ + { 'data': 'id' }, + { 'data': 'fecha' }, + { 'data': 'cliente' }, + { 'data': 'comercial' }, + { 'data': 'titulo' }, + { 'data': 'pais' }, + { 'data': 'inc_rei' }, + { 'data': 'paginas' }, + { 'data': 'tirada' }, + { 'data': 'total_pedido' }, + { 'data': 'estado' }, + { 'data': actionBtns } + ] +}); + + +theTable.on( 'draw.dt', function () { + + const dateCols = [1]; + const priceCols = [9]; + + for (let coln of dateCols) { + theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) { + const datestr = cell.innerHTML; + const dateStrLen = datestr.toString().trim().length; + if (dateStrLen > 0) { + let dateTimeParts= datestr.split(/[- :]/); // regular expression split that creates array with: year, month, day, hour, minutes, seconds values + dateTimeParts[1]--; // monthIndex begins with 0 for January and ends with 11 for December so we need to decrement by one + const d = new Date(...dateTimeParts); // new Date(datestr); + cell.innerHTML = d.toLocaleDateString(); + } + }); + } + + for (let coln of priceCols) { + theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) { + cell.innerHTML = parseFloat(cell.innerHTML).toFixed(2); + + }); + } +}); + + +$(document).on('click', '.btn-edit', function(e) { + window.location.href = `/presupuestos/cosidotapablanda/edit/${$(this).attr('data-id')}`; +}); + + +$(document).on('click', '.btn-delete', function(e) { + $(".btn-remove").attr('data-id', $(this).attr('data-id')); +}); + + +$(document).on('click', '.btn-remove', function(e) { + const dataId = $(this).attr('data-id'); + const row = $(this).closest('tr'); + if ($.isNumeric(dataId)) { + $.ajax({ + url: `/presupuestos/cosidotapablanda/delete/${dataId}`, + method: 'GET', + }).done((data, textStatus, jqXHR) => { + $('#confirm2delete').modal('toggle'); + theTable.clearPipeline(); + theTable.row($(row)).invalidate().draw(); + popSuccessAlert(data.msg ?? jqXHR.statusText); + }).fail((jqXHR, textStatus, errorThrown) => { + popErrorAlert(jqXHR.responseJSON.messages.error) + }) + } +}); + + + + + +endSection() ?> + + +section('css') ?> + +endSection() ?> + + +section('additionalExternalJs') ?> + + + + + + + + + + + + +endSection() ?> + diff --git a/ci4/app/Views/themes/backend/vuexy/main/defaultlayout.php b/ci4/app/Views/themes/backend/vuexy/main/defaultlayout.php index bd145fa5..35dbc375 100644 --- a/ci4/app/Views/themes/backend/vuexy/main/defaultlayout.php +++ b/ci4/app/Views/themes/backend/vuexy/main/defaultlayout.php @@ -335,6 +335,16 @@ if (!empty($token) && $tfa == false) { +\n"; + foreach ($global_js_variables as $name => $value): + echo "\t" . "var $name = $value;" . "\n"; + endforeach; + echo "\n"; +} +?> +