ot pliegos

This commit is contained in:
amazuecos
2025-04-27 10:58:23 +02:00
parent 45e41c77e4
commit c75d08b3c3
17 changed files with 355 additions and 121 deletions

View File

@ -98,6 +98,13 @@ class ProductionService extends BaseService
* @var boolean
*/
public bool $isGofrado = false; //* CHECK DONE
/**
* Indica si la orden de trabajo contiene cosido
* Se usa para mostrar la fecha correspondiente en la vista y pliegos
* @var boolean
*/
public bool $isCosido = false; //* CHECK DONE
/**
* Indica si la orden de trabajo contiene gofrado
* Se usa para mostrar la fecha correspondiente en la vista
@ -222,7 +229,6 @@ class ProductionService extends BaseService
{
return $this->ot;
}
/**
* Crea una instancia de la orden de trabajo
*
@ -814,6 +820,7 @@ class ProductionService extends BaseService
"tareas_impresion" => $this->tareas_impresion(),
"tiempo_procesamiento" => $this->getTiempoProcesamientoHHMM(),
"statusColor" => $this->getOtColorStatus(),
"tareaCosido" => $this->getTareaCosido(),
];
return $summary;
}
@ -842,8 +849,8 @@ class ProductionService extends BaseService
"tiempo_impresion" => $this->getTiempoTareasImpresionHHMM(),
"colors" => $this->getPdfColors(),
"isPOD" => $this->isPOD,
"uvi" => $this->getUVI()
"uvi" => $this->getUVI(),
"tareaCosido" => $this->getTareaCosido(),
];
}
public function getImposicionTareaImpresion(): ?Imposicion
@ -894,27 +901,27 @@ class ProductionService extends BaseService
public function getPresupuestoLineaImpresion() {}
public function tareas_acabado(): array
{
$q = $this->otTarea->where("presupuesto_acabado_id IS NOT NULL", NULL, FALSE)->findAll();
$q = $this->otTarea->where('orden_trabajo_id', $this->ot->id)->where("presupuesto_acabado_id IS NOT NULL", NULL, FALSE)->findAll();
return $q;
}
public function tareas_impresion(): array
{
$q = $this->otTarea->where("presupuesto_linea_id IS NOT NULL", NULL, FALSE)->findAll();
$q = $this->otTarea->where('orden_trabajo_id', $this->ot->id)->where("presupuesto_linea_id IS NOT NULL", NULL, FALSE)->findAll();
return $q;
}
public function tareas_encuadernacion(): array
{
$q = $this->otTarea->where("presupuesto_encuadernado_id IS NOT NULL", NULL, FALSE)->findAll();
$q = $this->otTarea->where('orden_trabajo_id', $this->ot->id)->where("presupuesto_encuadernado_id IS NOT NULL", NULL, FALSE)->findAll();
return $q;
}
public function tareas_preimpresion(): array
{
$q = $this->otTarea->where("presupuesto_preimpresion_id IS NOT NULL", NULL, FALSE)->findAll();
$q = $this->otTarea->where('orden_trabajo_id', $this->ot->id)->where("presupuesto_preimpresion_id IS NOT NULL", NULL, FALSE)->findAll();
return $q;
}
public function tareas_manipulado(): array
{
$q = $this->otTarea->where("presupuesto_manipulado_id IS NOT NULL", NULL, FALSE)->findAll();
$q = $this->otTarea->where('orden_trabajo_id', $this->ot->id)->where("presupuesto_manipulado_id IS NOT NULL", NULL, FALSE)->findAll();
return $q;
}
/**========================================================================
@ -929,6 +936,18 @@ class ProductionService extends BaseService
}
return $this->otTarea->update($tarea_id, $data);
}
public function updateOrdenTrabajoTareaPliegos($data_pliegos): bool
{
$flag = false;
$tareas = $this->ot->tareas();
foreach ($tareas as $key => $tarea) {
if ($tarea->isCosido()) {
$flag = $this->otTarea->update($tarea->id, $data_pliegos);
break;
}
}
return $flag;
}
public function storeOrdenTrabajoTareaProgressDate($data): bool
{
$data["action_at"] = Time::now()->format('Y-m-d H:i:s');
@ -1618,7 +1637,8 @@ class ProductionService extends BaseService
"isColor" => $this->isColor,
"isBN" => $this->isBN,
"isCorte" => $this->corte(),
"isGrapado" => $this->isGrapado
"isGrapado" => $this->isGrapado,
"isCosido" => $this->cosido(),
];
}
public function gofrado(): bool
@ -1638,6 +1658,20 @@ class ProductionService extends BaseService
$this->isGofrado = $flag;
return $this->isGofrado;
}
public function cosido(): bool
{
$flag = false;
$manipulados = $this->presupuesto->manipulados();
foreach ($manipulados as $key => $manipulado) {
$tarifa_manipulado = $manipulado->tarifa();
if ($tarifa_manipulado->isCosido()) {
$flag = true;
break;
}
}
$this->isCosido = $flag;
return $this->isCosido;
}
public function uvi(): bool
{
$flag = false;
@ -1737,4 +1771,16 @@ class ProductionService extends BaseService
$url = route_to("viewProduccionMaquinistaTareaView", $id);
return "<a type='button' href='$url' class='maquina-btn btn btn-primary btn-md'><span class='ti ti-arrow-big-right'></span></a>";
}
public function getTareaCosido(): ?OrdenTrabajoTareaEntity
{
$tareaCosido = null;
$tareas = $this->ot->tareas();
foreach ($tareas as $key => $tarea) {
if ($tarea->isCosido()) {
$tareaCosido = $tarea;
break;
}
}
return $tareaCosido;
}
}