tiempo real tarea empty when created

This commit is contained in:
amazuecos
2025-04-28 08:00:39 +02:00
parent bf21a336b1
commit 3abf45ca6e
2 changed files with 99 additions and 87 deletions

View File

@ -215,9 +215,9 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
/** /**
* Obtiene las lineas de presupuesto del actual presupuesto * Obtiene las lineas de presupuesto del actual presupuesto
* *
* @return PresupuestoLineaEntity * @return ?PresupuestoLineaEntity
*/ */
public function presupuestoLineaImpresion(): PresupuestoLineaEntity public function presupuestoLineaImpresion(): ?PresupuestoLineaEntity
{ {
$model = model(PresupuestoLineaModel::class); $model = model(PresupuestoLineaModel::class);
@ -230,7 +230,7 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
* *
* @return PresupuestoLineaEntity * @return PresupuestoLineaEntity
*/ */
public function presupuestoLineaCubierta(): PresupuestoLineaEntity public function presupuestoLineaCubierta(): ?PresupuestoLineaEntity
{ {
$model = model(PresupuestoLineaModel::class); $model = model(PresupuestoLineaModel::class);
@ -261,10 +261,15 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
} }
return $hasSobrecubierta; return $hasSobrecubierta;
} }
public function cliente() : ClienteEntity public function cliente(): ?ClienteEntity
{ {
$m = model(ClienteModel::class); $m = model(ClienteModel::class);
if ($this->attributes['cliente_id']) {
return $m->find($this->attributes["cliente_id"]); return $m->find($this->attributes["cliente_id"]);
} else {
return null;
}
} }
public function encuadernaciones(): array public function encuadernaciones(): array
{ {
@ -310,7 +315,5 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
$tipo_presupuesto = $m->find($this->attributes['tipo_impresion_id']); $tipo_presupuesto = $m->find($this->attributes['tipo_impresion_id']);
} }
return $tipo_presupuesto; return $tipo_presupuesto;
} }
} }

View File

@ -365,7 +365,7 @@ class ProductionService extends BaseService
$ot_tareas["maquina_id"] = $p_linea_maquina->id; $ot_tareas["maquina_id"] = $p_linea_maquina->id;
$ot_tareas["imposicion_id"] = null; $ot_tareas["imposicion_id"] = null;
$ot_tareas["tiempo_estimado"] = $p_linea->horas_maquina * 3600; $ot_tareas["tiempo_estimado"] = $p_linea->horas_maquina * 3600;
$ot_tareas["tiempo_real"] = $p_linea->horas_maquina * 3600; //? Tiempo real se inserta manual? $ot_tareas["tiempo_real"] = 0;
$insert_query_result = $this->otTarea->insert($ot_tareas); $insert_query_result = $this->otTarea->insert($ot_tareas);
$ot_tareas = []; $ot_tareas = [];
$this->storeTareaCorte($p_linea); $this->storeTareaCorte($p_linea);
@ -389,7 +389,7 @@ class ProductionService extends BaseService
'maquina_id' => $this->defaultMaquinaCorte->id, 'maquina_id' => $this->defaultMaquinaCorte->id,
'orden' => $this->defaultMaquinaCorte->orden_planning, 'orden' => $this->defaultMaquinaCorte->orden_planning,
'tiempo_estimado' => $pLinea->rotativa_tiempo_corte * 60, 'tiempo_estimado' => $pLinea->rotativa_tiempo_corte * 60,
'tiempo_real' => $pLinea->rotativa_tiempo_corte * 60, 'tiempo_real' => 0,
'is_corte' => true, 'is_corte' => true,
'tipo_corte' => "bobina", 'tipo_corte' => "bobina",
]); ]);
@ -1526,6 +1526,8 @@ class ProductionService extends BaseService
} }
public function getPapelImpresionBackgroundColor() public function getPapelImpresionBackgroundColor()
{ {
if ($this->presupuesto->presupuestoLineaImpresion()) {
$papel = $this->presupuesto->presupuestoLineaImpresion()->papel_generico(); $papel = $this->presupuesto->presupuestoLineaImpresion()->papel_generico();
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['default']; $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['default'];
$papel_code = $papel->code_ot; $papel_code = $papel->code_ot;
@ -1551,9 +1553,14 @@ class ProductionService extends BaseService
} }
return $color; return $color;
} else {
return $this->ordenTrabajoConfig->OT_PAPEL_COLOR['blanco'];
}
} }
public function getPapelImpresionCubiertaBackgroundColor() public function getPapelImpresionCubiertaBackgroundColor()
{ {
if ($this->presupuesto->presupuestoLineaCubierta()) {
$papel = $this->presupuesto->presupuestoLineaCubierta()->papel_generico(); $papel = $this->presupuesto->presupuestoLineaCubierta()->papel_generico();
$color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['default']; $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['default'];
$papel_code = $papel->code_ot; $papel_code = $papel->code_ot;
@ -1578,6 +1585,9 @@ class ProductionService extends BaseService
} }
} }
return $color; return $color;
} else {
return $this->ordenTrabajoConfig->OT_PAPEL_COLOR['blanco'];
}
} }
public function getPlastificadoColor() public function getPlastificadoColor()
{ {
@ -1849,6 +1859,5 @@ class ProductionService extends BaseService
{ {
$dates = $this->createDatesForPOD(); $dates = $this->createDatesForPOD();
return $this->pedidoModel->update($this->pedido->id, $dates); return $this->pedidoModel->update($this->pedido->id, $dates);
} }
} }