diff --git a/ci4/app/Controllers/Produccion/Ordentrabajo.php b/ci4/app/Controllers/Produccion/Ordentrabajo.php
index 0fef800c..002f388c 100755
--- a/ci4/app/Controllers/Produccion/Ordentrabajo.php
+++ b/ci4/app/Controllers/Produccion/Ordentrabajo.php
@@ -193,8 +193,8 @@ class Ordentrabajo extends BaseController
$q = $this->produccionService->papelGramajeDatatableQuery();
return DataTable::of($q)
- ->edit("tiempoReal", fn($q) => $q->tiempoReal * 3600)
- ->add("action", fn($q) => ["title" => lang('Produccion.datatable.filter_by_task'), 'data' => $q])
+ ->edit("tiempoReal", fn($q) => $q->tiempoReal)
+ ->add("action", fn($q) => ["title" => lang('Produccion.datatable.filter_by_paper'), 'data' => $q])
->toJson(true);
}
public function papel_pliego_datatable()
@@ -202,8 +202,8 @@ class Ordentrabajo extends BaseController
$q = $this->produccionService->papelPliegoDatatableQuery();
return DataTable::of($q)
- ->edit("tiempoReal", fn($q) => $q->tiempoReal * 3600)
- ->add("action", fn($q) => ["title" => lang('Produccion.datatable.filter_by_task'), 'data' => $q])
+ ->edit("tiempoReal", fn($q) => $q->tiempoReal)
+ ->add("action", fn($q) => ["title" => lang('Produccion.datatable.filter_by_paper'), 'data' => $q])
->toJson(true);
}
public function reset_tareas(int $orden_trabajo_id)
@@ -297,6 +297,7 @@ class Ordentrabajo extends BaseController
{
$q = $this->produccionService->planningPlanaQueryDatatable();
return DataTable::of($q)
+ ->edit("tiempo_real_sum", fn($q) => $q->tiempo_real_sum)
->edit("fecha_entrega_real_at", fn($q) => $q->fecha_entrega_real_at ? Time::createFromFormat("Y-m-d", $q->fecha_entrega_real_at)->format("d/m/Y") : "")
->add("pliegos_check", fn($q) => $q->otId)
->add("action", fn($q) => $q)
diff --git a/ci4/app/Language/es/Produccion.php b/ci4/app/Language/es/Produccion.php
index da69474a..9ba1dcd0 100644
--- a/ci4/app/Language/es/Produccion.php
+++ b/ci4/app/Language/es/Produccion.php
@@ -24,6 +24,7 @@ return [
"progreso" => "Progreso",
"logo" => "Logo impresion",
"filter_by_task" => "Filtrar por tarea",
+ "filter_by_paper" => "Filtrar por papel",
"metros" => "Metros",
"corte" => "Corte",
"pliegos" => "Pliegos",
diff --git a/ci4/app/Services/ProductionService.php b/ci4/app/Services/ProductionService.php
index 15b8b2a8..cf7482df 100644
--- a/ci4/app/Services/ProductionService.php
+++ b/ci4/app/Services/ProductionService.php
@@ -329,6 +329,8 @@ class ProductionService extends BaseService
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
$ot_tareas["orden"] = $linea_maquina->orden_planning ?? 110;
$ot_tareas["maquina_id"] = $linea_maquina->id;
+ $ot_tareas["tiempo_estimado"] = $p_linea->tiempo;
+ $ot_tareas["tiempo_real"] = $p_linea->tiempo;
$ot_tareas["imposicion_id"] = null;
$this->otTarea->insert($ot_tareas);
$ot_tareas = [];
@@ -336,6 +338,8 @@ class ProductionService extends BaseService
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
$ot_tareas["presupuesto_encuadernado_id"] = $p_linea->id;
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? "";
+ $ot_tareas["tiempo_estimado"] = $p_linea->tiempo;
+ $ot_tareas["tiempo_real"] = $p_linea->tiempo;
$ot_tareas["orden"] = 110;
$this->otTarea->insert($ot_tareas);
}
@@ -443,13 +447,8 @@ class ProductionService extends BaseService
"lg_papel_formato.ancho as papel_ancho",
"lg_papel_formato.alto as papel_alto",
"presupuesto_linea.rotativa_metros_total as metros",
- // "JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_ancho') as maquina_ancho",
- // "JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_alto') as maquina_alto",
"lg_papel_impresion.nombre as papel_impresion",
"presupuesto_linea.gramaje as papel_gramaje",
-
-
-
])
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
->join("orden_trabajo_dates", "orden_trabajo_dates.orden_trabajo_id = ordenes_trabajo.id", "left")
@@ -460,11 +459,12 @@ class ProductionService extends BaseService
->join("lg_papel_impresion", "lg_papel_impresion.id = presupuesto_linea.papel_impresion_id", "left")
->join("lg_maquinas as lgmp", "lgmp.id = presupuesto_linea.maquina_id", "left")
->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_id", "left")
- // ->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
->whereIn("presupuesto_linea.tipo", $this->TIPOS_ROTATIVA)
->where('lg_maquinas.is_rotativa', true)
->where("orden_trabajo_tareas.deleted_at", null)
- ->orderBy("orden_trabajo_tareas.orden", "ASC");
+ ->orderBy("orden_trabajo_tareas.orden", "ASC")
+ ->groupBy('ordenes_trabajo.id');
+
return $q;
}
/**
@@ -488,9 +488,7 @@ class ProductionService extends BaseService
// "JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_alto') as maquina_alto",
"lg_papel_impresion.nombre as papel_impresion",
"presupuesto_linea.gramaje as papel_gramaje",
-
-
-
+ "SUM(orden_trabajo_tareas.tiempo_real) as tiempo_real_sum"
])
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
->join("orden_trabajo_dates", "orden_trabajo_dates.orden_trabajo_id = ordenes_trabajo.id", "left")
@@ -505,7 +503,9 @@ class ProductionService extends BaseService
->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA)
->where('lg_maquinas.is_rotativa', false)
->where("orden_trabajo_tareas.deleted_at", null)
- ->orderBy("orden_trabajo_tareas.orden", "ASC");
+ ->orderBy("orden_trabajo_tareas.orden", "ASC")
+ ->groupBy('ordenes_trabajo.id');
+
return $q;
}
/**
diff --git a/ci4/app/Views/themes/vuexy/components/tables/planning_plana_table.php b/ci4/app/Views/themes/vuexy/components/tables/planning_plana_table.php
index e0e9aac3..4a95b44b 100644
--- a/ci4/app/Views/themes/vuexy/components/tables/planning_plana_table.php
+++ b/ci4/app/Views/themes/vuexy/components/tables/planning_plana_table.php
@@ -14,6 +14,7 @@
= lang('Produccion.datatable.gramaje') ?> |
|
= lang('Produccion.datatable.pliegos') ?> |
+ = lang('Produccion.datatable.tiempo') ?> |
= lang('Basic.global.Action') ?> |
@@ -25,13 +26,14 @@
|
|
|
- |
+ |
|
|
+ |
|
diff --git a/ci4/app/Views/themes/vuexy/components/tables/planning_rot_table.php b/ci4/app/Views/themes/vuexy/components/tables/planning_rot_table.php
index f12d2c00..5d0c80ad 100644
--- a/ci4/app/Views/themes/vuexy/components/tables/planning_rot_table.php
+++ b/ci4/app/Views/themes/vuexy/components/tables/planning_rot_table.php
@@ -15,6 +15,7 @@
= lang('Produccion.datatable.corte') ?> |
|
= lang('Produccion.datatable.metros') ?> |
+
= lang('Basic.global.Action') ?> |
@@ -26,7 +27,7 @@
|
|
|
- |
+ |
|