From 46176adc7052412e9a7db393296eb4c38633f00c Mon Sep 17 00:00:00 2001 From: amazuecos Date: Mon, 5 May 2025 07:53:36 +0200 Subject: [PATCH 1/4] fix show form cosido in ot task --- .../Controllers/Produccion/Ordentrabajo.php | 3 ++- .../Produccion/OrdenTrabajoTareaEntity.php | 2 +- .../Tarifas/TarifaEncuadernacionEntity.php | 5 +++- .../Tarifas/TarifaManipuladoEntity.php | 2 +- ci4/app/Services/ProductionService.php | 24 +++++++++---------- .../vuexy/form/produccion/ot/otDates.php | 11 +-------- 6 files changed, 21 insertions(+), 26 deletions(-) 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/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/Services/ProductionService.php b/ci4/app/Services/ProductionService.php index 1a5349d1..56d3c1d8 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'; } @@ -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/form/produccion/ot/otDates.php b/ci4/app/Views/themes/vuexy/form/produccion/ot/otDates.php index 5182f889..801461df 100755 --- a/ci4/app/Views/themes/vuexy/form/produccion/ot/otDates.php +++ b/ci4/app/Views/themes/vuexy/form/produccion/ot/otDates.php @@ -15,7 +15,7 @@
- +
@@ -99,15 +99,6 @@
- - -
- -
- - -
-
From 8cbe5a7051693ea4e6902f6d5ea23ac48adef27e Mon Sep 17 00:00:00 2001 From: amazuecos Date: Mon, 5 May 2025 08:04:46 +0200 Subject: [PATCH 2/4] fix papel ot color --- ci4/app/Services/ProductionService.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ci4/app/Services/ProductionService.php b/ci4/app/Services/ProductionService.php index 56d3c1d8..6091fab0 100755 --- a/ci4/app/Services/ProductionService.php +++ b/ci4/app/Services/ProductionService.php @@ -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']; } } From b4dfdfa101bfe0241e813ef47c11bc8a50c4453d Mon Sep 17 00:00:00 2001 From: amazuecos Date: Mon, 5 May 2025 08:07:17 +0200 Subject: [PATCH 3/4] add ot_id in ots datatables --- ci4/app/Views/themes/vuexy/components/tables/ot_table.php | 1 + httpdocs/assets/js/safekat/components/datatables/otDatatable.js | 1 + 2 files changed, 2 insertions(+) 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 @@ + diff --git a/httpdocs/assets/js/safekat/components/datatables/otDatatable.js b/httpdocs/assets/js/safekat/components/datatables/otDatatable.js index f6e29e1a..bd736040 100644 --- a/httpdocs/assets/js/safekat/components/datatables/otDatatable.js +++ b/httpdocs/assets/js/safekat/components/datatables/otDatatable.js @@ -15,6 +15,7 @@ class OrdenTrabajoDatatable { this.datatableColumns = [ + { data: 'id', searchable: false, sortable: false }, { data: 'pedido_id', searchable: false, sortable: false }, { data: 'fecha_encuadernado_at', searchable: false, sortable: false }, { data: 'cliente_nombre', searchable: false, sortable: false }, From 1c581db4cfbd7d92dc46bf952384577ce3ff06a0 Mon Sep 17 00:00:00 2001 From: amazuecos Date: Mon, 5 May 2025 08:27:01 +0200 Subject: [PATCH 4/4] add etiqueta envio maquina model and show in tarea card --- .../Controllers/Configuracion/Maquinas.php | 3 +++ ...0_AddEtiquetaEnvioCheckLgMaquinasTable.php | 25 +++++++++++++++++++ ci4/app/Entities/Configuracion/Maquina.php | 2 ++ ci4/app/Language/es/Maquinas.php | 1 + ci4/app/Models/Configuracion/MaquinaModel.php | 3 ++- .../maquinas/_maquinaFormItems.php | 14 ++++++++++- .../maquinista/viewMaquinistaMaquinaTarea.php | 10 +++++--- 7 files changed, 52 insertions(+), 6 deletions(-) create mode 100755 ci4/app/Database/Migrations/2025-05-05-080900_AddEtiquetaEnvioCheckLgMaquinasTable.php 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/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/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/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 @@ - +
+
+ etiqueta_envio == true ? 'checked' : ''; ?> + > + +
+