diff --git a/ci4/app/Controllers/Configuracion/Maquinas.php b/ci4/app/Controllers/Configuracion/Maquinas.php index 384f0026..3ee7c046 100755 --- a/ci4/app/Controllers/Configuracion/Maquinas.php +++ b/ci4/app/Controllers/Configuracion/Maquinas.php @@ -207,6 +207,9 @@ class Maquinas extends \App\Controllers\BaseResourceController if ($this->request->getPost('is_inkjet') == null) { $sanitizedData['is_inkjet'] = false; } + if ($this->request->getPost('etiqueta_envio') == null) { + $sanitizedData['etiqueta_envio'] = false; + } // JJO $sanitizedData['user_updated_id'] = auth()->user()->id; diff --git a/ci4/app/Controllers/Produccion/Ordentrabajo.php b/ci4/app/Controllers/Produccion/Ordentrabajo.php index 0cf73fce..e2b1cee1 100755 --- a/ci4/app/Controllers/Produccion/Ordentrabajo.php +++ b/ci4/app/Controllers/Produccion/Ordentrabajo.php @@ -219,8 +219,9 @@ class Ordentrabajo extends BaseController $this->viewData["user_dates"] = $this->produccionService->userDates(); $this->viewData["pedido_user_dates"] = $this->produccionService->pedidoUserDates(); $this->viewData["colors"] = $this->produccionService->getPdfColors(); - $this->viewData["tiempo_estimado"] = $this->produccionService->getTiempoProcesamientoHHMM(); + $this->viewData["tiempo_estimado"] = $this->produccionService->getTiempoProcesamientoHHMMSS(); $this->viewData["flags"] = $this->produccionService->getFlags(); + $this->viewData["tareaCosido"] = $this->produccionService->getTareaCosido(); return view(static::$viewPath . $this->editRoute, $this->viewData); diff --git a/ci4/app/Database/Migrations/2025-05-05-080900_AddEtiquetaEnvioCheckLgMaquinasTable.php b/ci4/app/Database/Migrations/2025-05-05-080900_AddEtiquetaEnvioCheckLgMaquinasTable.php new file mode 100755 index 00000000..1f25bcc7 --- /dev/null +++ b/ci4/app/Database/Migrations/2025-05-05-080900_AddEtiquetaEnvioCheckLgMaquinasTable.php @@ -0,0 +1,25 @@ + [ + 'type' => 'BOOL', + 'default' => false + ], + ]; + public function up() + { + + $this->forge->addColumn('lg_maquinas',$this->COLUMNS); + } + + public function down() + { + $this->forge->dropColumn('lg_maquinas',array_keys($this->COLUMNS)); + } +} diff --git a/ci4/app/Entities/Configuracion/Maquina.php b/ci4/app/Entities/Configuracion/Maquina.php index 1ccdef6a..6b9f6cf8 100755 --- a/ci4/app/Entities/Configuracion/Maquina.php +++ b/ci4/app/Entities/Configuracion/Maquina.php @@ -42,6 +42,7 @@ class Maquina extends \CodeIgniter\Entity\Entity "updated_at" => null, "user_created_id" => 0, "user_updated_id" => 0, + "etiqueta_envio" => false ]; protected $casts = [ "is_padre" => "boolean", @@ -57,6 +58,7 @@ class Maquina extends \CodeIgniter\Entity\Entity "duracion_jornada" => "int", "orden_planning" => "int", "is_rotativa" => "boolean", + "etiqueta_envio" => "boolean", "precio_tinta_negro" => "float", "is_inkjet" => "boolean", "precio_tinta_color" => "float", diff --git a/ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php b/ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php index c90de2b9..c01a327f 100755 --- a/ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php +++ b/ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php @@ -212,7 +212,7 @@ class OrdenTrabajoTareaEntity extends Entity public function isCosido(): bool { $isTareaCosido = false; - $pm = $this->presupuesto_manipulado(); + $pm = $this->presupuesto_encuadernacion(); if ($pm) { $isTareaCosido = $pm->tarifa()->isCosido(); } diff --git a/ci4/app/Entities/Tarifas/TarifaEncuadernacionEntity.php b/ci4/app/Entities/Tarifas/TarifaEncuadernacionEntity.php index 608ebf37..f43d64de 100755 --- a/ci4/app/Entities/Tarifas/TarifaEncuadernacionEntity.php +++ b/ci4/app/Entities/Tarifas/TarifaEncuadernacionEntity.php @@ -40,7 +40,10 @@ class TarifaEncuadernacionEntity extends \CodeIgniter\Entity\Entity $words_initial = array_map(fn($w) => substr(strtoupper($w),0,1),$words); return implode("",$words_initial); } - + public function isCosido(): bool + { + return in_array($this->attributes['id'], [3, 17]); + } } diff --git a/ci4/app/Entities/Tarifas/TarifaManipuladoEntity.php b/ci4/app/Entities/Tarifas/TarifaManipuladoEntity.php index 5c48cd96..3ddf5ac9 100755 --- a/ci4/app/Entities/Tarifas/TarifaManipuladoEntity.php +++ b/ci4/app/Entities/Tarifas/TarifaManipuladoEntity.php @@ -36,6 +36,6 @@ class TarifaManipuladoEntity extends \CodeIgniter\Entity\Entity public function isCosido(): bool { - return in_array($this->attributes['id'], [3, 17]); + return in_array($this->attributes['id'], [2, 3, 17, 45]); } } diff --git a/ci4/app/Language/es/Maquinas.php b/ci4/app/Language/es/Maquinas.php index 6971e9fa..efb9ce08 100755 --- a/ci4/app/Language/es/Maquinas.php +++ b/ci4/app/Language/es/Maquinas.php @@ -20,6 +20,7 @@ return [ 'isPadre' => 'Usar para variante?', 'isRotativa' => 'Es Rotativa?', 'isTinta' => 'Inkjet', + 'isEtiquetaEnvio' => 'Etiqueta envío', 'manipulado' => 'manipulado', 'maquina' => 'Maquina', 'maquinaList' => 'Lista Máquinas', diff --git a/ci4/app/Models/Configuracion/MaquinaModel.php b/ci4/app/Models/Configuracion/MaquinaModel.php index cbe249f8..74e96cb7 100755 --- a/ci4/app/Models/Configuracion/MaquinaModel.php +++ b/ci4/app/Models/Configuracion/MaquinaModel.php @@ -52,7 +52,8 @@ class MaquinaModel extends \App\Models\BaseModel "deleted_at", "is_deleted", "user_created_id", - "user_updated_id" + "user_updated_id", + "etiqueta_envio", ]; protected $returnType = "App\Entities\Configuracion\Maquina"; diff --git a/ci4/app/Services/ProductionService.php b/ci4/app/Services/ProductionService.php index 1a5349d1..6091fab0 100755 --- a/ci4/app/Services/ProductionService.php +++ b/ci4/app/Services/ProductionService.php @@ -873,7 +873,7 @@ class ProductionService extends BaseService "tareas_encuadernacion" => $this->tareas_encuadernacion(), "tareas_preimpresion" => $this->tareas_preimpresion(), "tareas_impresion" => $this->tareas_impresion(), - "tiempo_procesamiento" => $this->getTiempoProcesamientoHHMM(), + "tiempo_procesamiento" => $this->getTiempoProcesamientoHHMMSS(), "tiempo_total" => $this->getTiempoTotalTareas(), "statusColor" => $this->getOtColorStatus(), "tareaCosido" => $this->getTareaCosido(), @@ -902,8 +902,8 @@ class ProductionService extends BaseService "peso_unidad" => $logistica_data["peso_unidad"], "peso_pedido" => $logistica_data["peso_pedido"], "imposicion" => $this->getImposicionTareaImpresion(), - "tiempo_procesamiento" => $this->getTiempoProcesamientoHHMM(), - "tiempo_impresion" => $this->getTiempoTareasImpresionHHMM(), + "tiempo_procesamiento" => $this->getTiempoProcesamientoHHMMSS(), + "tiempo_impresion" => $this->getTiempoTareasImpresionHHMMSS(), "colors" => $this->getPdfColors(), "isPOD" => $this->isPOD, "uvi" => $this->getUVI(), @@ -1435,17 +1435,17 @@ class ProductionService extends BaseService } return $pedidoUserDates; } - public function getTiempoProcesamientoHHMM(): ?string + public function getTiempoProcesamientoHHMMSS(): ?string { try { $time_tareas_seconds = array_map(fn($q) => $q->tiempo_estimado ?? 0, $this->ot->tareas()); $seconds = array_sum($time_tareas_seconds); - return float_seconds_to_hhmm_string($seconds); + return float_seconds_to_hhmmss_string($seconds); } catch (\Throwable $th) { - return '00:00'; + return '00:00:00'; } } - public function getTiempoTareasImpresionHHMM(): string + public function getTiempoTareasImpresionHHMMSS(): string { try { $tareas_impresion = $this->ot->tareas_impresion(); @@ -1455,7 +1455,7 @@ class ProductionService extends BaseService $tiempo_seconds += $tarea->tiempo_estimado; } } - return float_seconds_to_hhmm_string($tiempo_seconds); + return float_seconds_to_hhmmss_string($tiempo_seconds); } catch (\Throwable $th) { return '00:00'; } @@ -1642,22 +1642,22 @@ class ProductionService extends BaseService $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['default']; $papel_code = $papel->code_ot; if ($papel_code) { - if (strpos($papel_code, "BCLOF")) { + if (str_contains($papel_code, "BCLOF")) { $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['blanco']; } - if (strpos($papel_code, "AH") && $papel->code == "OFF2") { + if (str_contains($papel_code, "AH")) { $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['ahuesado']; } - if (strpos($papel_code, "MARF")) { + if (str_contains($papel_code, "MARF")) { $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['marfil']; } - if (strpos($papel_code, "VOLAH")) { + if (str_contains($papel_code, "VOLAH")) { $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['volumen_ahuesado']; } - if ($papel_code == "EM") { + if (str_contains($papel_code, "EM")) { $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['estucado_mate']; } - if ($papel_code == "CGE") { + if (str_contains($papel->nombre, "CARTULINA")) { $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['cartulina']; } } @@ -1675,22 +1675,22 @@ class ProductionService extends BaseService $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['default']; $papel_code = $papel->code_ot; if ($papel_code) { - if (strpos($papel_code, "BCLOF")) { + if (str_contains($papel_code, "BCLOF")) { $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['blanco']; } - if (strpos($papel_code, "AH") && $papel->code == "OFF2") { + if (str_contains($papel_code, "AH")) { $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['ahuesado']; } - if (strpos($papel_code, "MARF")) { + if (str_contains($papel_code, "MARF")) { $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['marfil']; } - if (strpos($papel_code, "VOLAH")) { + if (str_contains($papel_code, "VOLAH")) { $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['volumen_ahuesado']; } - if ($papel_code == "EM") { + if (str_contains($papel_code, "EM")) { $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['estucado_mate']; } - if ($papel_code == "CGE") { + if (str_contains($papel->nombre, "CARTULINA")) { $color = $this->ordenTrabajoConfig->OT_PAPEL_COLOR['cartulina']; } } @@ -1845,10 +1845,10 @@ class ProductionService extends BaseService public function cosido(): bool { $flag = false; - $manipulados = $this->presupuesto->manipulados(); - foreach ($manipulados as $key => $manipulado) { - $tarifa_manipulado = $manipulado->tarifa(); - if ($tarifa_manipulado->isCosido()) { + $encuadernaciones = $this->presupuesto->encuadernaciones(); + foreach ($encuadernaciones as $key => $encuadernacion) { + $tarifaEncuadernacionEntity = $encuadernacion->tarifa(); + if ($tarifaEncuadernacionEntity->isCosido()) { $flag = true; break; } diff --git a/ci4/app/Views/themes/vuexy/components/tables/ot_table.php b/ci4/app/Views/themes/vuexy/components/tables/ot_table.php index 21388a84..cc43a4f9 100755 --- a/ci4/app/Views/themes/vuexy/components/tables/ot_table.php +++ b/ci4/app/Views/themes/vuexy/components/tables/ot_table.php @@ -3,6 +3,7 @@
| = lang('Produccion.datatable.ot_id') ?> | = lang('Produccion.datatable.pedido_id') ?> | = lang('Produccion.datatable.fecha_encuadernacion') ?> | = lang('Produccion.datatable.cliente') ?> | diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/maquinas/_maquinaFormItems.php b/ci4/app/Views/themes/vuexy/form/configuracion/maquinas/_maquinaFormItems.php index 1b2408b9..2b64ba70 100755 --- a/ci4/app/Views/themes/vuexy/form/configuracion/maquinas/_maquinaFormItems.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/maquinas/_maquinaFormItems.php @@ -173,7 +173,19 @@ - +
|---|