diff --git a/ci4/app/Config/Routes.php b/ci4/app/Config/Routes.php index 7cdc04d9..a894926d 100644 --- a/ci4/app/Config/Routes.php +++ b/ci4/app/Config/Routes.php @@ -294,6 +294,8 @@ $routes->group('papelesimpresion', ['namespace' => 'App\Controllers\Configuracio $routes->post('menuitems', 'Papelesimpresion::menuItems', ['as' => 'menuItemsOfPapelesImpresion']); $routes->post('duplicate/(:num)', 'Papelesimpresion::duplicate/$1', ['as' => 'duplicatePapelImpresion']); $routes->get('select', 'Papelesimpresion::papel_impresion_select', ['as' => 'papelImpresionSelect']); + $routes->get('show/(:num)', 'Papelesimpresion::papel_impresion_find/$1', ['as' => 'showPapelImpresion']); + }); $routes->resource('papelesimpresion', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Papelesimpresion', 'except' => 'show,new,create,update']); diff --git a/ci4/app/Controllers/Configuracion/Papelesimpresion.php b/ci4/app/Controllers/Configuracion/Papelesimpresion.php index 253e2256..ad24dfd2 100755 --- a/ci4/app/Controllers/Configuracion/Papelesimpresion.php +++ b/ci4/app/Controllers/Configuracion/Papelesimpresion.php @@ -474,4 +474,9 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController $data = $this->model->querySelect($q)->get()->getResultArray(); return $this->response->setJSON($data); } + public function papel_impresion_find(int $papel_impresion_id) + { + $piEntity = $this->model->find($papel_impresion_id); + return $this->response->setJSON($piEntity); + } } diff --git a/ci4/app/Controllers/Produccion/Ordentrabajo.php b/ci4/app/Controllers/Produccion/Ordentrabajo.php index 9a66de2c..6ab94f39 100755 --- a/ci4/app/Controllers/Produccion/Ordentrabajo.php +++ b/ci4/app/Controllers/Produccion/Ordentrabajo.php @@ -132,14 +132,14 @@ class Ordentrabajo extends BaseController { $logo = config(LogoImpresion::class); - $q = $this->otModel->getDatatableQuery()->where("ordenes_trabajo.estado","F"); + $q = $this->otModel->getDatatableQuery()->where("ordenes_trabajo.estado", "F"); // return $this->response->setJSON($q->get()->getResultArray()); return DataTable::of($q) - ->add("logo",fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo))) + ->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo))) ->edit( "fecha_encuadernado_at", - fn($q) => Time::createFromFormat("Y-m-d",$q->fecha_encuadernado_at)->format("d/m/Y") - ) + fn($q) => Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") + ) ->add("action", fn($q) => $q->id) ->toJson(true); } @@ -147,14 +147,14 @@ class Ordentrabajo extends BaseController { $logo = config(LogoImpresion::class); - $q = $this->otModel->getDatatableQuery()->whereIn("ordenes_trabajo.estado",["I","PM"]); + $q = $this->otModel->getDatatableQuery()->whereIn("ordenes_trabajo.estado", ["I", "PM"]); // return $this->response->setJSON($q->get()->getResultArray()); return DataTable::of($q) - ->add("logo",fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo))) + ->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo))) ->edit( "fecha_encuadernado_at", - fn($q) => Time::createFromFormat("Y-m-d",$q->fecha_encuadernado_at)->format("d/m/Y") - ) + fn($q) => Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") + ) ->add("action", fn($q) => $q->id) ->toJson(true); } @@ -162,14 +162,14 @@ class Ordentrabajo extends BaseController { $logo = config(LogoImpresion::class); - $q = $this->otModel->getDatatableQuery()->where("ferro_ok_at",null); + $q = $this->otModel->getDatatableQuery()->where("ferro_ok_at", null); // return $this->response->setJSON($q->get()->getResultArray()); return DataTable::of($q) - ->add("logo",fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo))) + ->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo))) ->edit( "fecha_encuadernado_at", - fn($q) => Time::createFromFormat("Y-m-d",$q->fecha_encuadernado_at)->format("d/m/Y") - ) + fn($q) => Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") + ) ->add("action", fn($q) => $q->id) ->toJson(true); } @@ -177,14 +177,14 @@ class Ordentrabajo extends BaseController { $logo = config(LogoImpresion::class); - $q = $this->otModel->getDatatableQuery()->where("ferro_ok_at is NOT NULL",NULL,FALSE); + $q = $this->otModel->getDatatableQuery()->where("ferro_ok_at is NOT NULL", NULL, FALSE); // return $this->response->setJSON($q->get()->getResultArray()); return DataTable::of($q) - ->add("logo",fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo))) + ->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo))) ->edit( "fecha_encuadernado_at", - fn($q) => Time::createFromFormat("Y-m-d",$q->fecha_encuadernado_at)->format("d/m/Y") - ) + fn($q) => Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") + ) ->add("action", fn($q) => $q->id) ->toJson(true); } @@ -194,7 +194,8 @@ class Ordentrabajo extends BaseController $q = $this->produccionService->papelGramajeDatatableQuery(); return DataTable::of($q) ->edit("tiempoReal", fn($q) => float_seconds_to_hhmm_string($q->tiempoReal * 3600)) - ->add("action" , fn($q) => ["title" => lang('Produccion.datatable.filter_by_task'),'data' => $q]) + ->add("metros", fn($q) => $q->maquina_ancho*$q->totalTirada/1000) + ->add("action", fn($q) => ["title" => lang('Produccion.datatable.filter_by_task'), 'data' => $q]) ->toJson(true); } public function reset_tareas(int $orden_trabajo_id) diff --git a/ci4/app/Language/es/Produccion.php b/ci4/app/Language/es/Produccion.php index 01772f79..2e61fa7c 100644 --- a/ci4/app/Language/es/Produccion.php +++ b/ci4/app/Language/es/Produccion.php @@ -23,7 +23,9 @@ return [ "tiempo" => "Tiempo", "progreso" => "Progreso", "logo" => "Logo impresion", - "filter_by_task" => "Filtrar por tarea" + "filter_by_task" => "Filtrar por tarea", + "metros" => "Metros" + ], "task" => [ @@ -68,7 +70,7 @@ return [ "preview_pdf" => "Previsualizar PDF", "imprimir_codigo_safekat" => "Imprimir código SAFEKAT", "imprimir_ferro" => "Imprimir ferro", - "planning_rotativa" => "Planning rotativa", + "planning_rotativa" => "Tareas rotativa", "solapa" => "Solapa", "papel_gramajes" => "Papel y gramajes" diff --git a/ci4/app/Models/Configuracion/PapelImpresionModel.php b/ci4/app/Models/Configuracion/PapelImpresionModel.php index 4a7979d1..914a315e 100755 --- a/ci4/app/Models/Configuracion/PapelImpresionModel.php +++ b/ci4/app/Models/Configuracion/PapelImpresionModel.php @@ -376,7 +376,7 @@ class PapelImpresionModel extends \App\Models\BaseModel "nombre as name", ]); if ($query) { - $q->like("name", $query); + $q->orLike("nombre", $query); } return $q; } diff --git a/ci4/app/Services/ProductionService.php b/ci4/app/Services/ProductionService.php index 0e84042a..057d499e 100644 --- a/ci4/app/Services/ProductionService.php +++ b/ci4/app/Services/ProductionService.php @@ -440,6 +440,7 @@ class ProductionService extends BaseService "orden_trabajo_tareas.nombre", "lgmp.nombre as maquina_presupuesto_linea", "orden_trabajo_tareas.maquina_id as maquina_tarea", + "lg_maquinas.nombre as maquina_nombre", "lg_imposiciones.id as imposicion_id", "orden_trabajo_tareas.tiempo_estimado", @@ -467,6 +468,8 @@ class ProductionService extends BaseService "lg_papel_impresion.nombre as papelImpresionNombre", "lg_papel_impresion.gramaje as papelImpresionGramaje", "COUNT(orden_trabajo_tareas.id) as tareasCount", + "CAST(JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_ancho') AS DOUBLE) as maquina_ancho", + "CAST(JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_alto') AS DOUBLE) as maquina_alto", "SUM(ordenes_trabajo.total_tirada) as totalTirada", "SUM(orden_trabajo_tareas.tiempo_real) as tiempoReal" ]) @@ -474,7 +477,8 @@ class ProductionService extends BaseService ->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left") ->join("lg_papel_impresion","presupuesto_linea.papel_impresion_id = lg_papel_impresion.id","left") ->where("orden_trabajo_tareas.deleted_at", null) - ->where("orden_trabajo_tareas.presupuesto_linea_id IS NOT NULL", NULL,FALSE); + ->where("orden_trabajo_tareas.presupuesto_linea_id IS NOT NULL", NULL,FALSE) + ->groupBy('lg_papel_impresion.id'); diff --git a/ci4/app/Views/themes/vuexy/components/tables/planning_papel_gramaje_table.php b/ci4/app/Views/themes/vuexy/components/tables/planning_papel_gramaje_table.php index a30ad7d1..221a00e7 100644 --- a/ci4/app/Views/themes/vuexy/components/tables/planning_papel_gramaje_table.php +++ b/ci4/app/Views/themes/vuexy/components/tables/planning_papel_gramaje_table.php @@ -7,6 +7,7 @@