From 66a36bcf3bab1cbee1fe9f572c5bad9b9cd1a97f Mon Sep 17 00:00:00 2001 From: amazuecos Date: Tue, 24 Dec 2024 18:55:07 +0100 Subject: [PATCH] add tareas orden de trabajo --- .gitignore | 2 +- .../Presupuestos/PresupuestoAcabadosEntity.php | 7 +++++++ .../PresupuestoEncuadernacionesEntity.php | 8 +++++++- .../Presupuestos/PresupuestoManipuladosEntity.php | 7 +++++++ .../Presupuestos/PresupuestoPreimpresionesEntity.php | 7 +++++++ .../Presupuestos/PresupuestoServiciosExtraEntity.php | 7 +++++++ .../Entities/Tarifas/TarifaEncuadernacionEntity.php | 2 ++ .../Entities/Tarifas/TarifaEncuadernacionLinea.php | 6 ++++-- ci4/app/Services/ProductionService.php | 12 ++++++++---- 9 files changed, 50 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 1d34c84e..4bee8902 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ ci4/.env .vscode/ - +launch.json *xdebug*.log* \ No newline at end of file diff --git a/ci4/app/Entities/Presupuestos/PresupuestoAcabadosEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoAcabadosEntity.php index c7583a17..2ee21c34 100755 --- a/ci4/app/Entities/Presupuestos/PresupuestoAcabadosEntity.php +++ b/ci4/app/Entities/Presupuestos/PresupuestoAcabadosEntity.php @@ -1,6 +1,8 @@ where("tarifa_acabado_id",$this->attributes["tarifa_acabado_id"])->findAll(); } + public function tarifa() : TarifaAcabadoEntity + { + $m = model(TarifaAcabadoModel::class); + return $m->find($this->attributes["tarifa_acabado_id"]); + } } diff --git a/ci4/app/Entities/Presupuestos/PresupuestoEncuadernacionesEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoEncuadernacionesEntity.php index 03f95924..81e257f8 100755 --- a/ci4/app/Entities/Presupuestos/PresupuestoEncuadernacionesEntity.php +++ b/ci4/app/Entities/Presupuestos/PresupuestoEncuadernacionesEntity.php @@ -1,8 +1,9 @@ where("tarifa_encuadernacion_id",$this->attributes["tarifa_encuadernado_id"])->findAll(); } + public function tarifa() : TarifaEncuadernacionEntity + { + $m = model(TarifaEncuadernacionModel::class); + return $m->find($this->attributes["tarifa_encuadernado_id"]); + } } diff --git a/ci4/app/Entities/Presupuestos/PresupuestoManipuladosEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoManipuladosEntity.php index e596dbd2..2fec8009 100644 --- a/ci4/app/Entities/Presupuestos/PresupuestoManipuladosEntity.php +++ b/ci4/app/Entities/Presupuestos/PresupuestoManipuladosEntity.php @@ -1,7 +1,9 @@ where("tarifa_manipulado_id",$this->attributes["tarifa_manipulado_id"])->findAll(); } + public function tarifa() : TarifaManipuladoEntity + { + $m = model(TarifaManipuladoModel::class); + return $m->find($this->attributes["tarifa_manipulado_id"]); + } } diff --git a/ci4/app/Entities/Presupuestos/PresupuestoPreimpresionesEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoPreimpresionesEntity.php index 79cfbcdb..9a0fef88 100755 --- a/ci4/app/Entities/Presupuestos/PresupuestoPreimpresionesEntity.php +++ b/ci4/app/Entities/Presupuestos/PresupuestoPreimpresionesEntity.php @@ -1,7 +1,9 @@ where("tarifa_preimpresion_id",$this->attributes["tarifa_preimpresion_id"])->findAll(); } + public function tarifa() : TarifapreimpresionEntity + { + $m = model(TarifapreimpresionModel::class); + return $m->find($this->attributes["tarifa_preimpresion_id"]); + } } diff --git a/ci4/app/Entities/Presupuestos/PresupuestoServiciosExtraEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoServiciosExtraEntity.php index 77f7db92..b68f6c2f 100755 --- a/ci4/app/Entities/Presupuestos/PresupuestoServiciosExtraEntity.php +++ b/ci4/app/Entities/Presupuestos/PresupuestoServiciosExtraEntity.php @@ -1,7 +1,9 @@ where("tarifa_extra_id",$this->attributes["tarifa_extra_id"])->findAll(); } + public function tarifa() : TarifaextraEntity + { + $m = model(TarifaextraModel::class); + return $m->find($this->attributes["tarifa_extra_id"]); + } } diff --git a/ci4/app/Entities/Tarifas/TarifaEncuadernacionEntity.php b/ci4/app/Entities/Tarifas/TarifaEncuadernacionEntity.php index 03d68989..1aa85454 100755 --- a/ci4/app/Entities/Tarifas/TarifaEncuadernacionEntity.php +++ b/ci4/app/Entities/Tarifas/TarifaEncuadernacionEntity.php @@ -31,4 +31,6 @@ class TarifaEncuadernacionEntity extends \CodeIgniter\Entity\Entity "user_updated_id" => "int", "is_deleted" => "int", ]; + + } diff --git a/ci4/app/Entities/Tarifas/TarifaEncuadernacionLinea.php b/ci4/app/Entities/Tarifas/TarifaEncuadernacionLinea.php index 6a72e00c..b1a8c0b7 100755 --- a/ci4/app/Entities/Tarifas/TarifaEncuadernacionLinea.php +++ b/ci4/app/Entities/Tarifas/TarifaEncuadernacionLinea.php @@ -1,9 +1,9 @@ null, @@ -38,4 +38,6 @@ class TarifaEncuadernacionLinea extends \CodeIgniter\Entity\Entity "user_updated_id" => "int", "is_deleted" => "int", ]; + + } diff --git a/ci4/app/Services/ProductionService.php b/ci4/app/Services/ProductionService.php index ab71148b..3f6c63a7 100644 --- a/ci4/app/Services/ProductionService.php +++ b/ci4/app/Services/ProductionService.php @@ -2,9 +2,7 @@ namespace App\Services; -use App\Database\Migrations\OrdenTrabajoUsers; use App\Entities\Clientes\ClienteEntity; -use App\Entities\Configuracion\Maquina; use App\Entities\Pedidos\PedidoEntity; use App\Entities\Presupuestos\PresupuestoEntity; use App\Entities\Presupuestos\PresupuestoLineaEntity; @@ -185,6 +183,7 @@ class ProductionService extends BaseService } else { $ot_tareas["orden_trabajo_id"] = $this->ot->id; $ot_tareas["presupuesto_acabado_id"] = $p_linea->id; + $ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? ""; $this->otTarea->insert($ot_tareas); } } @@ -210,6 +209,7 @@ class ProductionService extends BaseService } else { $ot_tareas["orden_trabajo_id"] = $this->ot->id; $ot_tareas["presupuesto_manipulado_id"] = $p_linea->id; + $ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? ""; $this->otTarea->insert($ot_tareas); } } @@ -235,6 +235,7 @@ class ProductionService extends BaseService } else { $ot_tareas["orden_trabajo_id"] = $this->ot->id; $ot_tareas["presupuesto_preimpresion_id"] = $p_linea->id; + $ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? ""; $this->otTarea->insert($ot_tareas); } } @@ -249,7 +250,7 @@ class ProductionService extends BaseService if (count($p_linea_maquinas) > 0) { foreach ($p_linea_maquinas as $key => $linea) { $ot_tareas["orden_trabajo_id"] = $this->ot->id; - $ot_tareas["presupuesto_encuadernacion_id"] = $p_linea->id; + $ot_tareas["presupuesto_encuadernado_id"] = $p_linea->id; $ot_tareas["nombre"] = $linea->nombre; $ot_tareas["orden"] = $linea->orden_planning; $ot_tareas["maquina_id"] = $linea->id; @@ -259,7 +260,8 @@ class ProductionService extends BaseService } } else { $ot_tareas["orden_trabajo_id"] = $this->ot->id; - $ot_tareas["presupuesto_encuadernacion_id"] = $p_linea->id; + $ot_tareas["presupuesto_encuadernado_id"] = $p_linea->id; + $ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? ""; $this->otTarea->insert($ot_tareas); } } @@ -285,6 +287,8 @@ class ProductionService extends BaseService } else { $ot_tareas["orden_trabajo_id"] = $this->ot->id; $ot_tareas["presupuesto_extra_id"] = $p_linea->id; + $ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? ""; + $this->otTarea->insert($ot_tareas); } }