diff --git a/ci4/app/Config/Routes.php b/ci4/app/Config/Routes.php index 9ec4772e..3c1b4e7d 100644 --- a/ci4/app/Config/Routes.php +++ b/ci4/app/Config/Routes.php @@ -479,6 +479,13 @@ $routes->group('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos }); $routes->resource('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Cosidotapablanda', 'except' => 'show,new,create,update']); +$routes->group('serviciospresupuesto', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) { + $routes->post('datatable', 'PresupuestoAcabados::datatable', ['as' => 'dataTableOfPresupuestoAcabados']); + $routes->post('datatable_editor', 'PresupuestoAcabados::datatable_editor', ['as' => 'editorOfPresupuestoAcabados']); +}); + + + /* * -------------------------------------------------------------------- * Additional Routing diff --git a/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php b/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php index 5a678caf..853f5b5a 100644 --- a/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php +++ b/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php @@ -733,8 +733,8 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController $model = model('App\Models\Tarifas\TarifaacabadoModel'); $data = $model->getServiciosAcabadoSelector(); array_unshift($data, (object)array( - "id" => 0, - "nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.servicioAcabado'))]) + "value" => 0, + "label" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.servicioAcabado'))]) )); return $data; } diff --git a/ci4/app/Controllers/Presupuestos/PresupuestoAcabados.php b/ci4/app/Controllers/Presupuestos/PresupuestoAcabados.php index b88a868d..d4550e25 100644 --- a/ci4/app/Controllers/Presupuestos/PresupuestoAcabados.php +++ b/ci4/app/Controllers/Presupuestos/PresupuestoAcabados.php @@ -28,182 +28,24 @@ class PresupuestoAcabados extends \App\Controllers\GoBaseResourceController protected $modelName = PresupuestoAcabadoModel::class; protected $format = 'json'; - protected static $singularObjectName = 'Contacto de cliente'; - protected static $singularObjectNameCc = 'contactoDeCliente'; - protected static $pluralObjectName = 'Contactos de cliente'; - protected static $pluralObjectNameCc = 'contactosDeCliente'; + protected static $singularObjectName = 'Presupuesto acabado'; + protected static $singularObjectNameCc = 'presupuestoAcabado'; + protected static $pluralObjectName = 'Presupuestos acabado'; + protected static $pluralObjectNameCc = 'presupuestosAcabado'; protected static $controllerSlug = 'presupuesto-acabados'; - protected static $viewPath = 'themes/backend/vuexy/form/clientes/contactos/'; + protected static $viewPath = 'themes/backend/vuexy/form/presupuestos/'; protected $indexRoute = 'contactoDeClienteList'; public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) { - $this->viewData['pageTitle'] = lang('ClienteContactos.moduleTitle'); - $this->viewData['usingSweetAlert'] = true; parent::initController($request, $response, $logger); } - public function index() - { - - $viewData = [ - 'currentModule' => static::$controllerSlug, - 'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('ClienteContactos.contactoDeCliente')]), - 'clienteContactoEntity' => new ClienteContactoEntity(), - 'usingServerSideDataTable' => true, - - ]; - - $viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class - - return view(static::$viewPath . 'viewContactoDeClienteList', $viewData); - } - - - public function add() - { - - - $requestMethod = $this->request->getMethod(); - - if ($requestMethod === 'post') : - - $nullIfEmpty = true; // !(phpversion() >= '8.1'); - - $postData = $this->request->getPost(); - - $sanitizedData = $this->sanitized($postData, $nullIfEmpty); - - - $noException = true; - if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) : - - - if ($this->canValidate()) : - try { - $successfulResult = $this->model->skipValidation(true)->save($sanitizedData); - } catch (\Exception $e) { - $noException = false; - $this->dealWithException($e); - } - else: - $this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]); - $this->session->setFlashdata('formErrors', $this->model->errors()); - endif; - - $thenRedirect = true; // Change this to false if you want your user to stay on the form after submission - endif; - if ($noException && $successfulResult) : - - $id = $this->model->db->insertID(); - - $message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.'; - - if ($thenRedirect) : - if (!empty($this->indexRoute)) : - return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message); - else: - return $this->redirect2listView('sweet-success', $message); - endif; - else: - $this->session->setFlashData('sweet-success', $message); - endif; - - endif; // $noException && $successfulResult - - endif; // ($requestMethod === 'post') - - $this->viewData['clienteContactoEntity'] = isset($sanitizedData) ? new ClienteContactoEntity($sanitizedData) : new ClienteContactoEntity(); - $this->viewData['clienteList'] = $this->getClienteListItems($clienteContactoEntity->cliente_id ?? null); - - $this->viewData['formAction'] = route_to('createContactoDeCliente'); - - $this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('ClienteContactos.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix'); - - - return $this->displayForm(__METHOD__); - } // end function add() - - public function edit($requestedId = null) - { - - if ($requestedId == null) : - return $this->redirect2listView(); - endif; - $id = filter_var($requestedId, FILTER_SANITIZE_URL); - $clienteContactoEntity = $this->model->find($id); - - if ($clienteContactoEntity == false) : - $message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('ClienteContactos.contactoDeCliente')), $id]); - return $this->redirect2listView('sweet-error', $message); - endif; - - $requestMethod = $this->request->getMethod(); - - if ($requestMethod === 'post') : - - $nullIfEmpty = true; // !(phpversion() >= '8.1'); - - $postData = $this->request->getPost(); - - $sanitizedData = $this->sanitized($postData, $nullIfEmpty); - - - $noException = true; - if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) : - - - if ($this->canValidate()) : - try { - $successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData); - } catch (\Exception $e) { - $noException = false; - $this->dealWithException($e); - } - else: - $this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('ClienteContactos.contactoDeCliente'))]); - $this->session->setFlashdata('formErrors', $this->model->errors()); - - endif; - - $clienteContactoEntity->fill($sanitizedData); - - $thenRedirect = false; - endif; - if ($noException && $successfulResult) : - $id = $clienteContactoEntity->id ?? $id; - $message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.'; - - if ($thenRedirect) : - if (!empty($this->indexRoute)) : - return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message); - else: - return $this->redirect2listView('sweet-success', $message); - endif; - else: - $this->session->setFlashData('sweet-success', $message); - endif; - - endif; // $noException && $successfulResult - endif; // ($requestMethod === 'post') - - $this->viewData['clienteContactoEntity'] = $clienteContactoEntity; - $this->viewData['clienteList'] = $this->getClienteListItems($clienteContactoEntity->cliente_id ?? null); - - $this->viewData['formAction'] = route_to('updateContactoDeCliente', $id); - - $this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('ClienteContactos.moduleTitle') . ' ' . lang('Basic.global.edit3'); - - - return $this->displayForm(__METHOD__, $id); - } // end function edit(...) - - public function datatable() { if ($this->request->isAJAX()) { @@ -217,24 +59,17 @@ class PresupuestoAcabados extends \App\Controllers\GoBaseResourceController $length = $reqData['length'] ?? 5; $search = $reqData['search']['value']; $requestedOrder = $reqData['order']['0']['column'] ?? 1; - $order = ClienteContactoModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 1]; + $order = PresupuestoAcabadoModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 1]; $dir = $reqData['order']['0']['dir'] ?? 'asc'; - $id_C = $reqData['id_cliente'] ?? -1; + $id_P = $reqData['id_presupuesto'] ?? -1; - $resourceData = $this->model->getResource("", $id_C)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject(); - - /*$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject(); - foreach ($resourceData as $item) : - if (isset($item->apellidos) && strlen($item->apellidos) > 100) : - $item->apellidos = character_limiter($item->apellidos, 100); - endif; - endforeach;*/ + $resourceData = $this->model->getResource("", $id_P)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject(); return $this->respond(Collection::datatable( $resourceData, $this->model->getResource()->countAllResults(), - $this->model->getResource("", $id_C)->countAllResults() + $this->model->getResource("", $id_P)->countAllResults() )); } else { return $this->failUnauthorized('Invalid request', 403); @@ -247,30 +82,22 @@ class PresupuestoAcabados extends \App\Controllers\GoBaseResourceController include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php"); // Build our Editor instance and process the data coming from _POST - $response = Editor::inst( $db, 'cliente_contactos' ) + $response = Editor::inst( $db, 'presupuesto_acabados' ) ->fields( Field::inst( 'nombre' ) ->validator( 'Validate::notEmpty',array( - 'message' => 'Falta nombre' ) + 'message' => 'Selecciones servicios de acabado' ) ), - Field::inst( 'apellidos' ) + Field::inst( 'precio_unitario' ) ->validator( 'Validate::notEmpty',array( 'message' => 'Falta apellidos' ) ), - Field::inst( 'cargo' ) + Field::inst( 'precio_total' ) ->validator( 'Validate::notEmpty',array( 'message' => 'Falta cargp' ) ), - Field::inst( 'telefono' ) - ->validator( 'Validate::notEmpty',array( - 'message' => 'Falta telefono' ) - ), - Field::inst( 'email' ) - ->validator( 'Validate::notEmpty',array( - 'message' => 'Falta email' ) - ), - Field::inst( 'cliente_id' ), + Field::inst( 'presupuesto_id' ), ) ->validator( function($editor, $action, $data){ @@ -299,69 +126,6 @@ class PresupuestoAcabados extends \App\Controllers\GoBaseResourceController } } - public function allItemsSelect() - { - if ($this->request->isAJAX()) { - $onlyActiveOnes = true; - $reqVal = $this->request->getPost('val') ?? 'id'; - $menu = $this->model->getAllForMenu($reqVal . ', nombre', 'nombre', $onlyActiveOnes, false); - $nonItem = new \stdClass; - $nonItem->id = ''; - $nonItem->nombre = '- ' . lang('Basic.global.None') . ' -'; - array_unshift($menu, $nonItem); - $newTokenHash = csrf_hash(); - $csrfTokenName = csrf_token(); - $data = [ - 'menu' => $menu, - $csrfTokenName => $newTokenHash - ]; - return $this->respond($data); - } else { - return $this->failUnauthorized('Invalid request', 403); - } - } - - public function menuItems() - { - if ($this->request->isAJAX()) { - $searchStr = goSanitize($this->request->getPost('searchTerm'))[0]; - $reqId = goSanitize($this->request->getPost('id'))[0]; - $reqText = goSanitize($this->request->getPost('text'))[0]; - $onlyActiveOnes = false; - $columns2select = [$reqId ?? 'id', $reqText ?? 'nombre']; - $onlyActiveOnes = false; - $menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr); - $nonItem = new \stdClass; - $nonItem->id = ''; - $nonItem->text = '- ' . lang('Basic.global.None') . ' -'; - array_unshift($menu, $nonItem); - - $newTokenHash = csrf_hash(); - $csrfTokenName = csrf_token(); - $data = [ - 'menu' => $menu, - $csrfTokenName => $newTokenHash - ]; - return $this->respond($data); - } else { - return $this->failUnauthorized('Invalid request', 403); - } - } - - - protected function getClienteListItems($selId = null) - { - $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Clientes.cliente'))])]; - if (!empty($selId)) : - $clienteModel = model('App\Models\Clientes\ClienteModel'); - - $selOption = $clienteModel->where('id', $selId)->findColumn('nombre'); - if (!empty($selOption)) : - $data[$selId] = $selOption[0]; - endif; - endif; - return $data; - } } diff --git a/ci4/app/Controllers/Tarifas/Tarifaenvio.php b/ci4/app/Controllers/Tarifas/Tarifaenvio.php deleted file mode 100644 index 8d0c0046..00000000 --- a/ci4/app/Controllers/Tarifas/Tarifaenvio.php +++ /dev/null @@ -1,35 +0,0 @@ - null, "presupuesto_id" => null, "tarifa_acabado_id" => null, - "nombre" => null, - "precio" => null, "precio_unidad" => null, - "tirada" => null, + "precio_total" => null, "created_at" => null, "updated_at" => null, ]; protected $casts = [ "presupuesto_id" => "int", "tarifa_acabado_id" => "int", - "precio" => "float", "precio_unidad" => "float", - "tirada" => "int", + "precio_total" => "float", ]; } diff --git a/ci4/app/Language/es/Presupuestos.php b/ci4/app/Language/es/Presupuestos.php index d714c8c4..da934761 100644 --- a/ci4/app/Language/es/Presupuestos.php +++ b/ci4/app/Language/es/Presupuestos.php @@ -1,852 +1,863 @@ 'Presupuesto Libro Cosido Tapa Blanda', + 'moduleTitleCosidoTB' => 'Presupuesto Libro Cosido Tapa Blanda', - 'presupuestoCosidotapablandaList' => 'Lista presupuestos Libros Cosido Tapa Blanda', - 'presupuesto' => 'Presupuesto', + 'presupuestoCosidotapablandaList' => 'Lista presupuestos Libros Cosido Tapa Blanda', + 'presupuesto' => 'Presupuesto', - 'datosPresupuesto' => 'Datos generales del presupuesto', - 'datosLibro' => 'Datos del libro', + 'datosPresupuesto' => 'Datos generales del presupuesto', + 'datosLibro' => 'Datos del libro', 'datosServicios' => 'Otros Servicios', - 'datosPresupuestoCliente' => 'Datos presupuesto cliente (comparador)', + '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', - 'mermacubierta' => 'Merma cubierta', - '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', + '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', + 'mermacubierta' => 'Merma cubierta', + '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', + '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', 'servicioAcabado' => 'Servicio de acabado', 'servicioPreimpresion' => 'Servicio de preimpresión', 'servicioEncuadernado' => 'Servicio de encuadernado', 'servicioManipulado' => 'Servicio de manipulado', - /* '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.', - - ], + // Servicios + 'precioUnidad' => 'Precio unitario', + 'precioTotal' => 'Precio total', + + + 'validation' => [ + 'decimal' => 'El campo {field} debe contener un número decimal.', + 'requerido' => 'El campo {field} esta requerido.', + + ], + + + /* '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.', + '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.', + 'comparador_json_data' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', - ], + ], - 'factura_id' => [ - 'integer' => 'The {field} field must contain an integer.', + 'factura_id' => [ + 'integer' => 'The {field} field must contain an integer.', - ], + ], - 'fecha_encuardenado_at' => [ - 'valid_date' => 'The {field} field must contain a valid date.', + '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_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_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_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.', + 'fecha_impresion_at' => [ + 'valid_date' => 'The {field} field must contain a valid date.', - ], + ], - 'inc_rei' => [ - 'integer' => 'The {field} field must contain an integer.', + 'inc_rei' => [ + 'integer' => 'The {field} field must contain an integer.', - ], + ], - 'isbn' => [ - 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'isbn' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', - ], + ], - 'lomo' => [ - 'integer' => 'The {field} field must contain an integer.', + 'lomo' => [ + 'integer' => 'The {field} field must contain an integer.', - ], + ], - 'margen' => [ - 'decimal' => 'The {field} field must contain a decimal number.', + 'margen' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'margen_manual' => [ - '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.', + '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' => [ + 'integer' => 'The {field} field must contain an integer.', - ], + ], - 'paginas_color_click' => [ - 'decimal' => 'The {field} field must contain a decimal number.', + '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_forma_id' => [ + 'integer' => 'The {field} field must contain an integer.', - ], + ], - 'paginas_color_gramaje' => [ - 'decimal' => 'The {field} field must contain a decimal number.', + '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_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'paginas_color_mano' => [ - '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_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'paginas_color_peso' => [ - '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_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_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_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_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_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_click' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'paginas_cubierta_forma_id' => [ - 'integer' => 'The {field} field must contain an integer.', + '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_gramaje' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'paginas_cubierta_libro' => [ - '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_mano' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'paginas_cubierta_pedido' => [ - '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_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_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_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_pliegos_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'paginas_cubierta_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' => [ + 'integer' => 'The {field} field must contain an integer.', - ], + ], - 'paginas_negro_click' => [ - 'decimal' => 'The {field} field must contain a decimal number.', + '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_forma_id' => [ + 'integer' => 'The {field} field must contain an integer.', - ], + ], - 'paginas_negro_gramaje' => [ - 'decimal' => 'The {field} field must contain a decimal number.', + '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_libro' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'paginas_negro_mano' => [ - '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_pedido' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'paginas_negro_peso' => [ - '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_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_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_pliegos_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'paginas_negro_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_click' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'paginas_portada_forma_id' => [ - 'integer' => 'The {field} field must contain an integer.', + '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_gramaje' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'paginas_portada_libro' => [ - '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_mano' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'paginas_portada_peso' => [ - '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_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_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_pliegos_precio' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'paginas_portada_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_alto' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'papel_formato_ancho' => [ - '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_espera_fecha' => [ + 'valid_date' => 'The {field} field must contain a valid date.', - ], + ], - 'pedido_libro_conjunto_id' => [ - 'integer' => 'The {field} field must contain an integer.', + 'pedido_libro_conjunto_id' => [ + 'integer' => 'The {field} field must contain an integer.', - ], + ], - 'responsable' => [ - 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'responsable' => [ + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', - ], + ], - 'serie_id' => [ - 'integer' => 'The {field} field must contain an integer.', + 'serie_id' => [ + 'integer' => 'The {field} field must contain an integer.', - ], + ], - 'tarifa_cliente_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.', + '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' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'total_acabado' => [ - '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_calculado' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'total_click' => [ - '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' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'total_confirmado_update_at' => [ - 'valid_date' => 'The {field} field must contain a valid date.', + '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_descuento' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'total_envios' => [ - '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_manipulado' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'total_margen' => [ - '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_margen_extra' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'total_pedido' => [ - '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_peso' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'total_preimpresion' => [ - '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_preimpresion_margen' => [ + 'decimal' => 'The {field} field must contain a decimal number.', - ], + ], - 'total_presupuesto' => [ - '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.', + '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.', + '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.', + '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' => [ + '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_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_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.', + '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.', + '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.', + '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.', + '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.', + '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.', + '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' => [ + '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.', + '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' => [ + '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_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' => [ + '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.', + '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.', + '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.', + '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.', + '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.', + '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.', + '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.', + 'version' => [ + 'integer' => 'The {field} field must contain an integer.', + 'required' => 'The {field} field is required.', - ], + ], - ], */ + ], */ ]; diff --git a/ci4/app/Language/es/Tarifaacabado.php b/ci4/app/Language/es/Tarifaacabado.php index fdb1d0e9..c7024dc1 100644 --- a/ci4/app/Language/es/Tarifaacabado.php +++ b/ci4/app/Language/es/Tarifaacabado.php @@ -12,7 +12,7 @@ return [ 'precioMin' => 'Precio Mínimo', 'importeFijo' => 'Importe Fijo', 'mostrar_en_presupuesto' => 'Mostrar en presupuesto', - 'tarifaacabado' => 'Tarifas Acabado', + 'tarifaacabado' => 'Tarifa Acabado', 'tarifaacabadoList' => 'Lista Tarifas Acabado', 'tarifasacabado' => 'Tarifas Acabado', 'updatedAt' => 'Actualizado en', diff --git a/ci4/app/Models/Presupuestos/PresupuestoAcabadoModel.php b/ci4/app/Models/Presupuestos/PresupuestoAcabadoModel.php index 6d541baa..7612a4fb 100644 --- a/ci4/app/Models/Presupuestos/PresupuestoAcabadoModel.php +++ b/ci4/app/Models/Presupuestos/PresupuestoAcabadoModel.php @@ -14,9 +14,9 @@ class PresupuestoAcabadoModel extends \App\Models\GoBaseModel protected $useAutoIncrement = true; const SORTABLE = [ - 0 => "t1.nombre", - 1 => "t1.precio", - 2 => "t1.precio_unidad" + 0 => "t2.nombre", + 1 => "t1.precio_unidad", + 2 => "t1.precio_total" ]; protected $allowedFields = ["presupuesto_id", "tarifa_acabado_id", "nombre", "precio", "precio_unidad"]; @@ -31,38 +31,19 @@ class PresupuestoAcabadoModel extends \App\Models\GoBaseModel public static $labelField = "nombre"; protected $validationRules = [ - "precio" => [ - "label" => "ClienteContactos.precio", - "rules" => "trim|max_length[100]", + "precio_total" => [ + "label" => "Presupuestos.precioTotal", + "rules" => "decimal|required", ], ]; protected $validationMessages = [ - "precio" => [ - "max_length" => "ClienteContactos.validation.apellidos.max_length", + "precio_total" => [ + "decimal" => "Presupuestos.validation.decimal", + "requerido" => "Presupuestos.validation.decimal", ], ]; - public function findAllWithClientes(string $selcols = "*", int $limit = null, int $offset = 0) - { - $sql = - "SELECT t1." . - $selcols . - ", t2.nombre AS cliente_id FROM " . - $this->table . - " t1 LEFT JOIN clientes t2 ON t1.cliente_id = t2.id"; - if (!is_null($limit) && intval($limit) > 0) { - $sql .= " LIMIT " . $limit; - } - - if (!is_null($offset) && intval($offset) > 0) { - $sql .= " OFFSET " . $offset; - } - - $query = $this->db->query($sql); - $result = $query->getResultObject(); - return $result; - } /** * Get resource data. @@ -76,21 +57,19 @@ class PresupuestoAcabadoModel extends \App\Models\GoBaseModel $builder = $this->db ->table($this->table . " t1") ->select( - "t1.id AS id, t1.cargo AS cargo, t1.nombre AS nombre, t1.apellidos AS apellidos, t1.telefono AS telefono, t1.email AS email, t1.cliente_id AS cliente_id" + "t1.id AS id, t1.tarifa_acabado_id AS tarifa_acabado_id, t1.precio_unidad AS precio_unidad, t1.precio_total AS precio_total, t2.nombre AS nombre" ); $builder->where('t1.presupuesto_id', $presupuesto_id); - $builder->join("presupuestos t2", "t1.presupuesto_id = t2.id", "left"); + $builder->join("lg_tarifa_acabado t2", "t1.tarifa_acabado_id = t2.id", "left"); return empty($search) ? $builder : $builder ->groupStart() - ->like("t1.nombre", $search) - ->orLike("t1.nombre", $search) - ->orLike("t1.apellidos", $search) - ->orLike("t1.telefono", $search) - ->orLike("t1.email", $search) + ->like("t2.nombre", $search) + ->orlike("t1.precio_unidad", $search) + ->orLike("t1.precio_total", $search) ->groupEnd(); } } diff --git a/ci4/app/Models/Tarifas/TarifaacabadoModel.php b/ci4/app/Models/Tarifas/TarifaacabadoModel.php index 079296ee..ddadf1d5 100644 --- a/ci4/app/Models/Tarifas/TarifaacabadoModel.php +++ b/ci4/app/Models/Tarifas/TarifaacabadoModel.php @@ -103,7 +103,7 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel $builder = $this->db ->table($this->table . " t1") ->select( - "t1.id as id, t1.nombre AS nombre" + "t1.id as value, t1.nombre AS label" ) ->where("t1.is_deleted", 0) ->where("t1.mostrar_en_presupuesto", 1); 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 index 091b4b08..360ba020 100644 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems.php +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems.php @@ -247,7 +247,7 @@

@@ -301,7 +301,7 @@

@@ -353,7 +353,7 @@

diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.php index 113a843f..1277ecf9 100644 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.php +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.php @@ -64,7 +64,18 @@
-

Proximanente

+ + + + + + + + + + + +
@@ -85,4 +96,185 @@
-
\ No newline at end of file +
+ + + + + + + +section("additionalInlineJs") ?> + + const lastColNr = $('#tableOfServiciosAcabado').find("tr:first th").length - 1; + const url = window.location.href; + const url_parts = url.split('/'); + if(url_parts[url_parts.length-2] == 'edit'){ + id = url_parts[url_parts.length-1]; + } + else{ + id = 200000; // id=-1 + } + + const actionBtns = function(data) { + return ` + + + + `; + }; + + editor = new $.fn.dataTable.Editor( { + ajax: { + url: "", + headers: { + : v, + }, + }, + table : "#tableOfServiciosAcabado", + idSrc: 'id', + fields: [ { + "name": "tarifa_acabado_id", + "type": "select" + }, { + "name": "precio_unitario" + }, { + "name": "precio_total" + }, { + "name": "presupuesto_id", + "type": "hidden" + }, + ] + } ); + + // Generación de la lista de servicios de acabado (id, nombre) + const acabadosList = ; + editor.field( 'tarifa_acabado_id' ).update( acabadosList ); + + editor.on( 'preSubmit', function ( e, d, type ) { + if ( type === 'create'){ + d.data[0]['presupuesto_id'] = id; + } + else if(type === 'edit' ) { + for (v in d.data){ + d.data[v]['presupuesto_id'] = id; + } + } + }); + + editor.on( 'postSubmit', function ( e, json, data, action ) { + yeniden(json.); + }); + + editor.on( 'submitSuccess', function ( e, json, data, action ) { + theTable.clearPipeline(); + theTable.draw(); + }); + + // Activate an inline edit on click of a table cell + $('#tableOfServiciosAcabado').on( 'click', 'tbody span.edit', function (e) { + editor.inline( + theTable.cells(this.parentNode.parentNode, '*').nodes(), + { + cancelHtml: '', + cancelTrigger: 'span.cancel', + submitHtml: '', + submitTrigger: 'span.edit', + submit: 'allIfChanged' + } + ); + } ); + + + // Delete row + $('#tableOfServiciosAcabado').on( 'click', 'tbody span.remove', 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) { + editor + .create( false ) + .edit( this.parentNode, false) + .set( 'deleted_at', new Date().toISOString().slice(0, 19).replace('T', ' ') ) + .set( 'is_deleted', 1 ) + .submit(); + + } + }); + }); + + var theTable = $('#tableOfServiciosAcabado').DataTable( { + serverSide: true, + processing: true, + autoWidth: true, + responsive: true, + lengthMenu: [ 5, 10, 25], + order: [[ 0, "asc" ], [ 1, "asc" ]], + pageLength: 10, + lengthChange: true, + searching: false, + paging: true, + info: false, + dom: '<"mt-4"><"float-start"l><"mt-4 mb-3"p>', + ajax : $.fn.dataTable.pipeline( { + url: '', + data: { + id_presupuesto: id, + }, + method: 'POST', + headers: {'X-Requested-With': 'XMLHttpRequest'}, + async: true, + }), + columns: [ + {'data': 'tarifa_acabado_id', + render: function(data, type, row, meta) { + var value = acabadosList.find(element => element.value === data); + return value['label']; + }, + }, + { 'data': 'precio_unidad' }, + { 'data': 'precio_total' }, + { + data: actionBtns, + className: 'row-edit dt-center' + } + ], + columnDefs: [ + { + orderable: false, + searchable: false, + targets: [lastColNr] + }, + { + "orderData": [ 0, 1 ], + "targets": 0 + }, + + ], + language: { + url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/i18n ?>.json" + }, + buttons: [ { + className: 'btn btn-primary float-end me-sm-3 me-1', + extend: "createInline", + editor: editor, + formOptions: { + submitTrigger: -1, + submitHtml: '' + } + } ] + } ); + +endSection() ?> + diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaForm.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaForm.php index 92f1abc1..2331629f 100644 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaForm.php +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaForm.php @@ -477,11 +477,9 @@ endSection() ?> section('css') ?> - - endSection() ?> section('additionalExternalJs') ?> @@ -493,6 +491,8 @@ section('additionalExternalJs') ?> + + endSection() ?> \ No newline at end of file