add check horas planning plana

This commit is contained in:
amazuecos
2025-04-03 01:08:29 +02:00
parent bb848d391f
commit b79f490f17
6 changed files with 42 additions and 23 deletions

View File

@ -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)

View File

@ -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",

View File

@ -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;
}
/**

View File

@ -14,6 +14,7 @@
<th><?= lang('Produccion.datatable.gramaje') ?></th>
<th></th>
<th><?= lang('Produccion.datatable.pliegos') ?></th>
<th><?= lang('Produccion.datatable.tiempo') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
<tr>
@ -25,13 +26,14 @@
<th></th>
<th></th>
<th><select class="select2 form-select-sm planning-papel-select" name="papel_impresion"></select></th>
<th><input type="text" class="form-control planning-filter" name="gramaje"></th>
<th><input type="text" class="form-control planning-filter" name="papel_gramaje"></th>
<th>
<div class="form-check mt-4">
<input class="form-check-input" id="pliegos-check-all" type="checkbox" value="" />
</div>
</th>
<th><span id="pliegos-sel-total"></span></th>
<th><span id="horas-sel-total"></span></th>
<th></th>
</tr>
</thead>

View File

@ -15,6 +15,7 @@
<th><?= lang('Produccion.datatable.corte') ?></th>
<th></th>
<th><?= lang('Produccion.datatable.metros') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
<tr>
@ -26,7 +27,7 @@
<th></th>
<th></th>
<th><select class="select2 form-select-sm planning-papel-select" name="papel_impresion"></select></th>
<th><input type="text" class="form-control planning-filter" name="gramaje"></th>
<th><input type="text" class="form-control planning-filter" name="papel_gramaje"></th>
<th>
<select class="select2 form-select-sm w-100" name="corte">
<option value="0" default></option>