diff --git a/ci4/app/Controllers/Produccion/Ordentrabajo.php b/ci4/app/Controllers/Produccion/Ordentrabajo.php
index 804fa8ec..4f631279 100755
--- a/ci4/app/Controllers/Produccion/Ordentrabajo.php
+++ b/ci4/app/Controllers/Produccion/Ordentrabajo.php
@@ -707,7 +707,7 @@ class Ordentrabajo extends BaseController
$r = $this->produccionService->storeOrdenTrabajoTareaProgressDate($validatedData);
$otTareaEntity = $this->otTarea->find($validatedData['ot_tarea_id']);
$data = [
- "tiempo_trabajado" => float_seconds_to_hhmm_string($otTareaEntity->tiempo_real),
+ "tiempo_trabajado" => float_seconds_to_hhmmss_string($otTareaEntity->tiempo_real),
"tarea" => $otTareaEntity,
"estado" => $validatedData['estado'],
];
@@ -728,7 +728,7 @@ class Ordentrabajo extends BaseController
{
$otTareaEntity = $this->otTarea->find($orden_trabajo_tarea_id);
$data = [
- "tiempo_trabajado" => float_seconds_to_hhmm_string($otTareaEntity->tiempo_trabajado()),
+ "tiempo_trabajado" => float_seconds_to_hhmmss_string($otTareaEntity->tiempo_trabajado()),
"progress_dates" => $otTareaEntity->progress_dates(),
];
return $this->response->setJSON($data);
diff --git a/ci4/app/Entities/Presupuestos/PresupuestoLineaEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoLineaEntity.php
index 38744e7e..74ba61ae 100755
--- a/ci4/app/Entities/Presupuestos/PresupuestoLineaEntity.php
+++ b/ci4/app/Entities/Presupuestos/PresupuestoLineaEntity.php
@@ -248,6 +248,10 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
return in_array($this->attributes['tipo'], ["lp_bn", "lp_bnhq", "lp_rot_bn"]);
}
+ public function isImpresionInteriorPlana():bool
+ {
+ return in_array($this->attributes['tipo'], ["lp_bn", "lp_bnhq", "lp_colorhq","lp_color"]);
+ }
public function tinta(): string
{
$tinta = "";
diff --git a/ci4/app/Services/ProductionService.php b/ci4/app/Services/ProductionService.php
index aa43f70e..8b0ec7e6 100755
--- a/ci4/app/Services/ProductionService.php
+++ b/ci4/app/Services/ProductionService.php
@@ -424,7 +424,7 @@ class ProductionService extends BaseService
*/
protected function storeTareaCorteFinal(): ?OrdenTrabajoTareaEntity
{
-
+
$presupuestoLineaImpresion = $this->presupuesto->presupuestoLineaImpresion();
$data = [
'orden_trabajo_id' => $this->ot->id,
@@ -451,26 +451,33 @@ class ProductionService extends BaseService
protected function storeTareaCorte(PresupuestoLineaEntity $pLinea): ?OrdenTrabajoTareaEntity
{
$otCorte = null;
+ $presupuestoTipo = $this->presupuesto->tipo_presupuesto()->codigo;
+ $isRusticaFresado = str_contains($presupuestoTipo, "Fresado");
$data = [
'orden_trabajo_id' => $this->ot->id,
'presupuesto_linea_id' => $pLinea->id,
'nombre' => 'Corte',
- 'maquina_id' => $this->guillotinaMaquinaId ?? 20,//!REMOVE LATER
- 'orden' => $pLinea->maquina()->orden_planning + 1,
+ 'maquina_id' => $this->guillotinaMaquinaId,
+ 'orden' => $pLinea->maquina()->orden_planning + 1,
'tiempo_estimado' => $pLinea->rotativa_tiempo_corte * 60,
'tiempo_real' => 0,
'is_corte' => true,
- 'tipo_corte' => "guillotina",
+ 'tipo_corte' => "prep",
];
if ($pLinea->isCubierta()) {
$data['nombre'] = lang('Produccion.cover_cut');
+ $tareaId = $this->otTarea->insert($data);
+ $otCorte = $this->otTarea->find($tareaId);
}
- if($pLinea->isRotativa() ||$pLinea->isColor()||$pLinea->isBN())
- {
+ if ($pLinea->isImpresionInteriorPlana() || $pLinea->isRotativa()) {
$data['nombre'] = lang('Produccion.interior_cut');
+ //* Si es rustica fresado y rotativa no se añade preparación de interior en guillotina
+ if (!$isRusticaFresado && !$pLinea->isRotativa()) {
+ $tareaId = $this->otTarea->insert($data);
+ $otCorte = $this->otTarea->find($tareaId);
+ return $otCorte;
+ }
}
- $tareaId = $this->otTarea->insert($data);
- $otCorte = $this->otTarea->find($tareaId);
return $otCorte;
}
@@ -492,7 +499,7 @@ class ProductionService extends BaseService
'presupuesto_linea_id' => $pLinea->id,
'nombre' => $name,
'maquina_id' => $this->defaultMaquinaCorte->id,
- 'orden' => $pLinea->maquina()->orden_planning + 1,
+ 'orden' => $pLinea->maquina()->orden_planning + 1,
'tiempo_estimado' => $pLinea->rotativa_tiempo_corte * 60,
'tiempo_real' => 0,
'is_corte' => true,
@@ -1393,7 +1400,7 @@ class ProductionService extends BaseService
public function tareaUpdateMaquinaCorte($orden_trabajo_id): bool
{
$cvm = model(ConfigVariableModel::class);
- $otTarea = $this->otTarea->where('orden_trabajo_id', $orden_trabajo_id)->where('is_corte', true)->first();
+ $otTarea = $this->otTarea->where('orden_trabajo_id', $orden_trabajo_id)->where('is_corte', true)->whereIn('tipo_corte', ['bobina', 'guillotina'])->first();
$toggleCorte = "bobina";
if ($otTarea->tipo_corte == "bobina") {
$maquina_id = $cvm->where('name', "id_maquina_guillotina_corte_ot_tarea")->first()["value"];
diff --git a/ci4/app/Views/themes/vuexy/pdfs/ferro.php b/ci4/app/Views/themes/vuexy/pdfs/ferro.php
index 0b95135d..ba20f8c0 100755
--- a/ci4/app/Views/themes/vuexy/pdfs/ferro.php
+++ b/ci4/app/Views/themes/vuexy/pdfs/ferro.php
@@ -76,10 +76,8 @@ $settings = $session->get('settings');
-
-
- ;">= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?>
-
+
+ ;">= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?>
@@ -210,25 +208,25 @@ $settings = $session->get('settings');
-
-
-
-
-
-
-
-
- papel_formato_personalizado): ?>
- | = $presupuesto->papel_formato_ancho ?>x= $presupuesto->papel_formato_alto ?> |
-
- = $papel_formato->ancho ?>x= $papel_formato->alto ?> |
-
- 1 |
- = $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> |
- = number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> |
+
+
+
+
+
+
+
+
+ papel_formato_personalizado): ?>
+ | = $presupuesto->papel_formato_ancho ?>x= $presupuesto->papel_formato_alto ?> |
+
+ = $papel_formato->ancho ?>x= $papel_formato->alto ?> |
+
+ 1 |
+ = $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> |
+ = number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> |
-
-
+
+
) ?>) |
diff --git a/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php b/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php
index bb832fb5..7121b103 100755
--- a/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php
+++ b/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php
@@ -77,10 +77,8 @@ $settings = $session->get('settings');
-
-
- ;">= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?>
-
+
+ ;">= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?>
diff --git a/ci4/app/Views/themes/vuexy/pdfs/prototipo.php b/ci4/app/Views/themes/vuexy/pdfs/prototipo.php
index edcc540d..aabe3f31 100755
--- a/ci4/app/Views/themes/vuexy/pdfs/prototipo.php
+++ b/ci4/app/Views/themes/vuexy/pdfs/prototipo.php
@@ -76,10 +76,8 @@ $settings = $session->get('settings');
-
-
- ;">= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?>
-
+
+ ;">= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?>