diff --git a/ci4/app/Config/OrdenTrabajo.php b/ci4/app/Config/OrdenTrabajo.php index 8b029b02..4f8be2d4 100755 --- a/ci4/app/Config/OrdenTrabajo.php +++ b/ci4/app/Config/OrdenTrabajo.php @@ -12,8 +12,14 @@ class OrdenTrabajo extends BaseConfig "interior_bn_at" => "interior_bn_user_id", "interior_color_at" => "interior_color_user_id", "cubierta_at" => "cubierta_user_id", + "sobrecubierta_at" => "sobrecubierta_user_id", //TODO + "guarda_at" => "guarda_user_id", //TODO //ACABADO "plastificado_at" => "plastificado_user_id", + "plakene_at" => "plakene_user_id", //TODO + "retractilado_at" => "retractilado_user_id", + "estampado_at" => "estampado_user_id", //TODO + "uvi_at" => "uvi_user_id", //TODO "encuadernacion_at" => "encuadernacion_user_id", "corte_at" => "corte_user_id", "preparacion_interiores_at" => "preparacion_interior_user_id", @@ -21,7 +27,6 @@ class OrdenTrabajo extends BaseConfig "cosido_at" => "cosido_user_id", "grapado_at" => "grapado_user_id", "solapa_at" => "solapa_user_id", - "retractilado_at" => "retractilado_user_id", "retractilado5_at" => "retractilado5_user_id", "prototipo_at" => "prototipo_user_id", "marcapaginas_at" => "marcapaginas_user_id", @@ -100,9 +105,9 @@ class OrdenTrabajo extends BaseConfig ]; public array $OT_PLASTIFICADO_COLOR = [ - "BRIL" => ["bg" => "#00B0F0", "color" => "white"], + "BRILLO" => ["bg" => "#00B0F0", "color" => "white"], "MATE" => ["bg" => "#FF0000", "color" => "white"], - "SOFT_TOUCH" => ["bg" => "#00B050", "color" => "white"], + "SOFT" => ["bg" => "#00B050", "color" => "white"], "SANDY" => ["bg" => "#782170", "color" => "white"], "ANTIRAYADO" => ["bg" => "#E97132", "color" => "white"], "GOFRADO" => ["bg" => "#FFFF00", "color" => "black"], diff --git a/ci4/app/Config/Routes.php b/ci4/app/Config/Routes.php index 4ac5ac81..352a871e 100755 --- a/ci4/app/Config/Routes.php +++ b/ci4/app/Config/Routes.php @@ -754,6 +754,7 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func $routes->get('tareas/datatable/(:num)', 'Ordentrabajo::tareas_datatable/$1', ['as' => 'datatableTareasOrdenTrabajo']); $routes->get("tarea/progress/(:num)", "Ordentrabajo::get_orden_trabajo_progress_date/$1"); $routes->get('tarea/(:num)', 'Ordentrabajo::find_tarea/$1'); + $routes->get('tarea/dates/(:num)','Ordentrabajo::get_orden_trabajo_tareas_dates/$1'); /**====================== * UPDATES *========================**/ @@ -771,6 +772,7 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func $routes->get("color/(:num)", 'Ordentrabajo::get_orden_trabajo_color_status/$1'); $routes->post("update/tarea/progress", "Ordentrabajo::store_orden_trabajo_progress_date"); $routes->post("update/tarea/pliegos", "Ordentrabajo::update_orden_trabajo_pliegos"); + $routes->post("update/tarea/proveedor", "Ordentrabajo::update_presupuesto_tarea_proveedor"); $routes->delete("tarea/progress/(:num)", "Ordentrabajo::delete_orden_trabajo_progress_date/$1"); /**====================== @@ -783,6 +785,8 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func * PDF *========================**/ $routes->get('pdf/(:num)', 'Ordentrabajo::get_pdf/$1'); + $routes->get('pdf/ferro/(:num)', 'Ordentrabajo::get_ferro_pdf/$1'); + $routes->get('pdf/prototipo/(:num)', 'Ordentrabajo::get_prototipo_pdf/$1'); $routes->get('portada/(:num)', 'Ordentrabajo::get_portada_img/$1'); $routes->group('planning', ['namespace' => 'App\Controllers\Produccion'], function ($routes) { $routes->get('select/maquina/rotativa', 'Ordentrabajo::select_maquina_planning_rot'); diff --git a/ci4/app/Config/Validation.php b/ci4/app/Config/Validation.php index 09717371..f8c5881c 100755 --- a/ci4/app/Config/Validation.php +++ b/ci4/app/Config/Validation.php @@ -184,4 +184,15 @@ class Validation extends BaseConfig "label" => "maquina", ], ]; + public array $proveedor_tarea = + [ + "proveedor_id" => [ + "rules" => "required|integer", + "label" => "Proveedor", + ], + "orden_trabajo_tarea_id" => [ + "rules" => "required|integer", + "label" => "Tarea", + ], + ]; } diff --git a/ci4/app/Controllers/Produccion/Ordentrabajo.php b/ci4/app/Controllers/Produccion/Ordentrabajo.php index 61741e33..413bb991 100755 --- a/ci4/app/Controllers/Produccion/Ordentrabajo.php +++ b/ci4/app/Controllers/Produccion/Ordentrabajo.php @@ -3,6 +3,7 @@ namespace App\Controllers\Produccion; use App\Controllers\BaseController; +use App\Models\Compras\ProveedorModel; use App\Models\Configuracion\MaquinaModel; use App\Models\OrdenTrabajo\OrdenTrabajoModel; use App\Models\OrdenTrabajo\OrdenTrabajoTarea; @@ -28,6 +29,7 @@ class Ordentrabajo extends BaseController protected OrdenTrabajoModel $otModel; protected OrdenTrabajoUser $otUserModel; protected OrdenTrabajoTarea $otTarea; + protected ProveedorModel $proveedorModel; protected MaquinaModel $maquinaModel; protected UserModel $userModel; protected Validation $validation; @@ -45,6 +47,7 @@ class Ordentrabajo extends BaseController $this->produccionService = new ProductionService(); $this->otTarea = model(OrdenTrabajoTarea::class); $this->maquinaModel = model(MaquinaModel::class); + $this->proveedorModel = model(ProveedorModel::class); $this->validation = service("validation"); helper("time"); parent::initController($request, $response, $logger); @@ -138,6 +141,18 @@ class Ordentrabajo extends BaseController return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400); } } + public function update_presupuesto_tarea_proveedor(){ + $bodyData = $this->request->getPost(); + $validated = $this->validation->run($bodyData, "proveedor_tarea"); + if ($validated) { + $validatedData = $this->validation->getValidated(); + $r = $this->produccionService->updateProveedorLinea($validatedData['orden_trabajo_tarea_id'], $validatedData['proveedor_id']); + return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r]); + } else { + return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400); + } + + } public function reset_orden_trabajo_date() { $bodyData = $this->request->getPost(); @@ -305,6 +320,7 @@ class Ordentrabajo extends BaseController ->edit("orden", fn($q) => ["id" => $q->id, "orden" => $q->orden]) ->edit("tiempo_estimado", fn($q) => float_seconds_to_hhmm_string($q->tiempo_estimado)) ->edit("tiempo_real", fn($q) => float_seconds_to_hhmm_string($q->tiempo_real)) + ->add("proveedor", fn($q) => $this->produccionService->getProveedorTarea($q->id)) ->edit("maquina_tarea", fn($q) => ["id" => $q->id, "maquina_id" => $q->maquina_tarea, "maquina_name" => $q->maquina_nombre]) ->add("imposicion", fn($q) => ["id" => $q->id, "imposicion_id" => $q->imposicion_id, "name" => $q->imposicion_name, "is_presupuesto_linea" => $q->presupuesto_linea_id ? true : false]) ->toJson(true); @@ -313,6 +329,14 @@ class Ordentrabajo extends BaseController { return $this->produccionService->init($orden_trabajo_id)->getPdf(); } + public function get_ferro_pdf($orden_trabajo_id) + { + return $this->produccionService->init($orden_trabajo_id)->getFerroPdf(); + } + public function get_prototipo_pdf($orden_trabajo_id) + { + return $this->produccionService->init($orden_trabajo_id)->getPrototipoPdf(); + } public function upload_orden_trabajo_portada() { try { @@ -572,7 +596,6 @@ class Ordentrabajo extends BaseController } public function delete_orden_trabajo_progress_date(int $orden_trabajo_tarea_id) { - $status = $this->produccionService->deleteOrdenTrabajoTareaProgressDates($orden_trabajo_tarea_id); return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status]); } @@ -598,4 +621,9 @@ class Ordentrabajo extends BaseController } } + public function get_orden_trabajo_tareas_dates($orden_trabajo_id) + { + $data = $this->produccionService->init($orden_trabajo_id)->getOrdenTrabajoTareaDates(); + return $this->response->setJSON(["data" => $data ]); + } } diff --git a/ci4/app/Database/Migrations/2025-04-29_232200_AlterTarifasAcabadoAddBoleanColumns.php b/ci4/app/Database/Migrations/2025-04-29_232200_AlterTarifasAcabadoAddBoleanColumns.php new file mode 100755 index 00000000..fd9d45ea --- /dev/null +++ b/ci4/app/Database/Migrations/2025-04-29_232200_AlterTarifasAcabadoAddBoleanColumns.php @@ -0,0 +1,68 @@ + [ + 'type' => 'BOOLEAN', + 'default' => false, + ], + 'plakene' => [ + 'type' => 'BOOLEAN', + 'default' => false, + ], + 'rectractilado' => [ + 'type' => 'BOOLEAN', + 'default' => false, + ], + 'estampado' => [ + 'type' => 'BOOLEAN', + 'default' => false, + ], + 'uvi' => [ + 'type' => 'BOOLEAN', + 'default' => false, + ], + 'plastificado_tipo' => [ + 'type' => 'ENUM', + 'constraint' => ['BRILLO','MATE','SANDY','GOFRADO','SOFT','ANTIRAYADO'], + 'null' => true, + ], + 'plakene_tipo' => [ + 'type' => 'ENUM', + 'constraint' => ['TRASLUCIDO','MATE','NEGRO'], + 'null' => true, + ], + 'rectractilado_tipo' => [ + 'type' => 'ENUM', + 'constraint' => ['1','3','5'], + 'null' => true, + ], + 'estampado_tipo' => [ + 'type' => 'ENUM', + 'constraint' => ['ORO','PLATA','COBRE','BRONCE'], + 'null' => true, + ], + 'uvi_tipo' => [ + 'type' => 'ENUM', + 'constraint' => ['2D','3D','BRAILLE'], + 'null' => true, + ] + ]; + public function up() + { + + $this->forge->addColumn('lg_tarifa_acabado',$this->COLUMNS); + + } + + public function down() + { + $this->forge->dropColumn('lg_tarifa_acabado',array_keys($this->COLUMNS)); + + } +} diff --git a/ci4/app/Database/Migrations/2025-04-30_083700_AlterOrdenesTrabajoAddCommentColumns.php b/ci4/app/Database/Migrations/2025-04-30_083700_AlterOrdenesTrabajoAddCommentColumns.php new file mode 100755 index 00000000..3a991162 --- /dev/null +++ b/ci4/app/Database/Migrations/2025-04-30_083700_AlterOrdenesTrabajoAddCommentColumns.php @@ -0,0 +1,43 @@ + [ + 'type' => 'LONGTEXT', + 'null' => true + ], + 'comment_cubierta' => [ + 'type' => 'LONGTEXT', + 'null' => true + ], + 'comment_encuadernacion' => [ + 'type' => 'LONGTEXT', + 'null' => true + ], + 'comment_logistica' => [ + 'type' => 'LONGTEXT', + 'null' => true + ], + "info_solapa_guillotina" => [ + 'type' => 'LONGTEXT', + 'null' => true + ] + ]; + public function up() + { + + $this->forge->addColumn('ordenes_trabajo',$this->COLUMNS); + + } + + public function down() + { + $this->forge->dropColumn('ordenes_trabajo',array_keys($this->COLUMNS)); + + } +} diff --git a/ci4/app/Database/Migrations/2025-05-01-044600_AddOrdenTrabajoDatesManipuladoImpresion.php b/ci4/app/Database/Migrations/2025-05-01-044600_AddOrdenTrabajoDatesManipuladoImpresion.php new file mode 100644 index 00000000..6f1cb065 --- /dev/null +++ b/ci4/app/Database/Migrations/2025-05-01-044600_AddOrdenTrabajoDatesManipuladoImpresion.php @@ -0,0 +1,82 @@ + [ + "type" => "DATE", + "null" => true, + ], + "guarda_at" => [ + "type" => "DATE", + "null" => true, + ], + "plakene_at" => [ + "type" => "DATE", + "null" => true, + ], + "estampado_at" => [ + "type" => "DATE", + "null" => true, + ], + "uvi_at" => [ + "type" => "DATE", + "null" => true, + ], + + ]; + protected array $USERS = [ + "sobrecubierta_user_id" => [ + "type" => "INT", + "unsigned" => true, + "constraint" => 10, + "null" => true, + ], + "guarda_user_id" => [ + "type" => "INT", + "unsigned" => true, + "constraint" => 10, + "null" => true, + ], + "plakene_user_id" => [ + "type" => "INT", + "unsigned" => true, + "constraint" => 10, + "null" => true, + ], + "estampado_user_id" => [ + "type" => "INT", + "unsigned" => true, + "constraint" => 10, + "null" => true, + ], + "uvi_user_id" => [ + "type" => "INT", + "unsigned" => true, + "constraint" => 10, + "null" => true, + ], + ]; + + public function up() + { + $this->forge->addColumn("orden_trabajo_dates", $this->DATES); + $this->forge->addColumn("orden_trabajo_users", $this->USERS); + foreach ($this->USERS as $key => $value) { + $this->forge->addForeignKey([$key],"users",["id"]); + } + } + + public function down() + { + $this->forge->dropColumn("orden_trabajo_dates", array_keys($this->DATES)); + $this->forge->dropColumn("orden_trabajo_users", array_keys($this->USERS)); + + + } +} diff --git a/ci4/app/Entities/Presupuestos/PresupuestoAcabadosEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoAcabadosEntity.php index c0ab643e..c836a170 100755 --- a/ci4/app/Entities/Presupuestos/PresupuestoAcabadosEntity.php +++ b/ci4/app/Entities/Presupuestos/PresupuestoAcabadosEntity.php @@ -1,7 +1,9 @@ find($this->attributes["tarifa_acabado_id"]); } - + public function proveedor(): ?ProveedorEntity + { + $proveedor = null; + $m = model(ProveedorModel::class); + if ($this->attributes["proveedor_id"]) { + $proveedor = $m->find($this->attributes["proveedor_id"]); + } + return $proveedor; + } } diff --git a/ci4/app/Entities/Presupuestos/PresupuestoEncuadernacionesEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoEncuadernacionesEntity.php index a586f2c1..7f067936 100755 --- a/ci4/app/Entities/Presupuestos/PresupuestoEncuadernacionesEntity.php +++ b/ci4/app/Entities/Presupuestos/PresupuestoEncuadernacionesEntity.php @@ -1,7 +1,10 @@ "float", "margen" => "float", ]; - public function maquinas() : array + public function maquinas(): array { $m = model(TarifaEncuadernacionMaquinaModel::class); - $tarifa_maquinas = $m->where("tarifa_encuadernacion_id",$this->attributes["tarifa_encuadernado_id"])->findAll(); + $tarifa_maquinas = $m->where("tarifa_encuadernacion_id", $this->attributes["tarifa_encuadernado_id"])->findAll(); $maquinaModel = model(MaquinaModel::class); $maquinas = []; foreach ($tarifa_maquinas as $key => $tarifa_maquina) { @@ -43,9 +46,18 @@ class PresupuestoEncuadernacionesEntity extends \CodeIgniter\Entity\Entity } return $maquinas; } - public function tarifa() : TarifaEncuadernacionEntity + public function tarifa(): TarifaEncuadernacionEntity { $m = model(TarifaEncuadernacionModel::class); return $m->find($this->attributes["tarifa_encuadernado_id"]); } + public function proveedor(): ?ProveedorEntity + { + $proveedor = null; + $m = model(ProveedorModel::class); + if ($this->attributes["proveedor_id"]) { + $proveedor = $m->find($this->attributes["proveedor_id"]); + } + return $proveedor; + } } diff --git a/ci4/app/Entities/Presupuestos/PresupuestoEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoEntity.php index a013aab2..c7d0edc3 100755 --- a/ci4/app/Entities/Presupuestos/PresupuestoEntity.php +++ b/ci4/app/Entities/Presupuestos/PresupuestoEntity.php @@ -210,7 +210,7 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity $q = $model->where('presupuesto_id', $this->attributes["id"])->findAll(); - return $q; + return $q ?? []; } /** * Obtiene las lineas de presupuesto del actual presupuesto @@ -251,6 +251,14 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity return $q; } + public function presupuestoLineaGuarda(): ?PresupuestoLineaEntity + { + $model = model(PresupuestoLineaModel::class); + + $q = $model->where('presupuesto_id', $this->attributes["id"])->whereIn("tipo", ["lp_guardas"])->first(); + + return $q; + } public function hasSobrecubierta(): bool { $hasSobrecubierta = false; diff --git a/ci4/app/Entities/Presupuestos/PresupuestoLineaEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoLineaEntity.php index 83ad9323..38744e7e 100755 --- a/ci4/app/Entities/Presupuestos/PresupuestoLineaEntity.php +++ b/ci4/app/Entities/Presupuestos/PresupuestoLineaEntity.php @@ -222,6 +222,7 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity return $nombre; } + public function isGuarda(): bool { return in_array($this->attributes["tipo"], ["lp_guardas"]); diff --git a/ci4/app/Entities/Produccion/OrdenTrabajoDateEntity.php b/ci4/app/Entities/Produccion/OrdenTrabajoDateEntity.php index 19ad97ab..bd73e401 100755 --- a/ci4/app/Entities/Produccion/OrdenTrabajoDateEntity.php +++ b/ci4/app/Entities/Produccion/OrdenTrabajoDateEntity.php @@ -15,8 +15,15 @@ class OrdenTrabajoDateEntity extends Entity "interior_bn_at" => null, "interior_color_at" => null, "cubierta_at" => null, + "sobrecubierta_at" => null, //TODO + "guarda_at" => null, //TODO //ACABADO "plastificado_at" => null, + "plakene_at" => null, //TODO + "retractilado_at"=> null, + "estampado_at" => null, //TODO + "uvi_at" => null, //TODO + //MANIPULADO "encuadernacion_at" => null, "corte_at" => null, "preparacion_interiores_at" => null, @@ -24,9 +31,8 @@ class OrdenTrabajoDateEntity extends Entity "cosido_at" => null, "solapa_at" => null, "grapado_at" => null, - "retractilado_at"=> null, - "retractilado5_at"=> null, - "prototipo_at"=> null, + "retractilado5_at"=> null, // !DELETE + "prototipo_at"=> null, // !DELETE "marcapaginas_at"=> null, "espiral_at"=> null, //FERRO diff --git a/ci4/app/Entities/Produccion/OrdenTrabajoEntity.php b/ci4/app/Entities/Produccion/OrdenTrabajoEntity.php index b5d9216c..b80de21d 100755 --- a/ci4/app/Entities/Produccion/OrdenTrabajoEntity.php +++ b/ci4/app/Entities/Produccion/OrdenTrabajoEntity.php @@ -30,6 +30,11 @@ class OrdenTrabajoEntity extends Entity "progreso" => 0.00, "estado" => "I", "comentarios" => null, + "comment_interior" => null, + "comment_cubierta" => null, + "comment_encuadernacion" => null, + "comment_logistica" => null, + "info_solapa_guillotina" => null, "revisar_formato" => null, "revisar_lomo" => null, "revisar_solapa" => null, @@ -52,7 +57,12 @@ class OrdenTrabajoEntity extends Entity "tipo_entrada" => "string", "progreso" => "float", "estado" => "string", - "comentarios" => "string", + "comentarios" => "?string", + "comment_interior" => "?string", + "comment_cubierta" => "?string", + "comment_encuadernacion" => "?string", + "comment_logistica" => "?string", + "info_solapa_guillotina" => "?string", "revisar_formato" => "bool", "revisar_lomo" => "bool", "revisar_solapa" => "bool", @@ -80,7 +90,22 @@ class OrdenTrabajoEntity extends Entity $m = model(OrdenTrabajoTarea::class); return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_linea_id IS NOT NULL", NULL, FALSE)->findAll() ?? []; } - /** + public function tareas_acabado(): array + { + $m = model(OrdenTrabajoTarea::class); + return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_acabado_id IS NOT NULL", NULL, FALSE)->findAll() ?? []; + } + public function tareas_encuadernado(): array + { + $m = model(OrdenTrabajoTarea::class); + return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_encuadernado_id IS NOT NULL", NULL, FALSE)->findAll() ?? []; + } + public function tareas_manipulado(): array + { + $m = model(OrdenTrabajoTarea::class); + return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_manipulado_id IS NOT NULL", NULL, FALSE)->findAll() ?? []; + } + /** * Devuelve el presupuesto de la orden de trabajo * * @return PresupuestoEntity @@ -183,4 +208,5 @@ class OrdenTrabajoEntity extends Entity ]; return $estados[$this->attributes["estado"]]; } + } diff --git a/ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php b/ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php index 6eb09ce3..1d32be82 100755 --- a/ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php +++ b/ci4/app/Entities/Produccion/OrdenTrabajoTareaEntity.php @@ -5,6 +5,7 @@ namespace App\Entities\Produccion; use App\Entities\Configuracion\Imposicion; use App\Entities\Configuracion\Maquina; use App\Entities\Presupuestos\PresupuestoAcabadosEntity; +use App\Entities\Presupuestos\PresupuestoEncuadernacionesEntity; use App\Entities\Presupuestos\PresupuestoLineaEntity; use App\Entities\Presupuestos\PresupuestoManipuladosEntity; use App\Models\Configuracion\ImposicionModel; @@ -12,6 +13,7 @@ use App\Models\Configuracion\MaquinaModel; use App\Models\OrdenTrabajo\OrdenTrabajoModel; use App\Models\OrdenTrabajo\OrdenTrabajoTareaProgressDate; use App\Models\Presupuestos\PresupuestoAcabadosModel; +use App\Models\Presupuestos\PresupuestoEncuadernacionesModel; use App\Models\Presupuestos\PresupuestoLineaModel; use App\Models\Presupuestos\PresupuestoManipuladosModel; use CodeIgniter\Entity\Entity; @@ -23,6 +25,11 @@ class OrdenTrabajoTareaEntity extends Entity "id" => null, "orden_trabajo_id" => null, "presupuesto_linea_id" => null, + "presupuesto_acabado_id" => null, + "presupuesto_preimpresion_id" => null, + "presupuesto_encuadernado_id" => null, + "presupuesto_extra_id" => null, + "presupuesto_manipulado_id" => null, "nombre" => null, "orden" => null, "maquina_id" => null, @@ -96,10 +103,15 @@ class OrdenTrabajoTareaEntity extends Entity * * @return PresupuestoLineaEntity */ - public function presupuesto_linea(): PresupuestoLineaEntity + public function presupuesto_linea(): ?PresupuestoLineaEntity { + $presupuesto_linea = null; $m = model(PresupuestoLineaModel::class); - return $m->find($this->attributes["presupuesto_linea_id"]); + if ($this->attributes['presupuesto_linea_id']) { + + $presupuesto_linea = $m->find($this->attributes["presupuesto_linea_id"]); + } + return $presupuesto_linea; } /** * Devuelve la maquina original del presupuesto linea @@ -108,17 +120,35 @@ class OrdenTrabajoTareaEntity extends Entity */ public function maquina_presupuesto_linea(): Maquina { - return $this->presupuesto_linea()->maquina(); + return $this->presupuesto_linea()?->maquina(); } /** * Devuelve el presupuesto acabado origen de esta tarea * * @return PresupuestoAcabadosEntity */ - public function presupuesto_acabado(): PresupuestoAcabadosEntity + public function presupuesto_acabado(): ?PresupuestoAcabadosEntity { + $presupuesto_acabado = null; $m = model(PresupuestoAcabadosModel::class); - return $m->find($this->attributes["presupuesto_linea_id"]); + if ($this->attributes["presupuesto_acabado_id"]) { + $presupuesto_acabado = $m->find($this->attributes["presupuesto_acabado_id"]); + } + return $presupuesto_acabado; + } + /** + * Devuelve el presupuesto enducadernacion origen de esta tarea + * + * @return PresupuestoEncuadernacionesEntity + */ + public function presupuesto_encuadernacion(): ?PresupuestoEncuadernacionesEntity + { + $presupuesto_encuadernacion = null; + $m = model(PresupuestoEncuadernacionesModel::class); + if ($this->attributes["presupuesto_encuadernado_id"]) { + $presupuesto_encuadernacion = $m->find($this->attributes["presupuesto_encuadernado_id"]); + } + return $presupuesto_encuadernacion; } /** * Devuelve el presupuesto acabado origen de esta tarea @@ -152,8 +182,8 @@ class OrdenTrabajoTareaEntity extends Entity { $dates = $this->progress_dates(); $intervals = []; - $init = []; - $end = []; + $init = null; + $end = null; foreach ($dates as $key => $date) { if ($date->estado == "I") { if ($date->action_at) { @@ -161,7 +191,7 @@ class OrdenTrabajoTareaEntity extends Entity } } if ($date->estado == "S" || $date->estado == "F") { - if ($date->action_at) { + if ($date->action_at && $init) { $end = Time::createFromFormat('Y-m-d H:i:s', $date->action_at); $intervals[] = $init->difference($end)->getSeconds(); } @@ -182,4 +212,24 @@ class OrdenTrabajoTareaEntity extends Entity } return $isTareaCosido; } + public function isImpresion() : bool + { + return $this->attributes['presupuesto_linea_id'] != null; + } + public function isAcabado() : bool + { + return $this->attributes['presupuesto_acabado_id'] != null; + } + public function isManipulado() : bool + { + return $this->attributes['presupuesto_manipulado_id'] != null; + } + public function isEncuadernado() : bool + { + return $this->attributes['presupuesto_encuadernado_id'] != null; + } + public function isCorte() : bool + { + return $this->attributes['is_corte']; + } } diff --git a/ci4/app/Entities/Produccion/OrdenTrabajoUserEntity.php b/ci4/app/Entities/Produccion/OrdenTrabajoUserEntity.php index 0a95037a..076c6d16 100755 --- a/ci4/app/Entities/Produccion/OrdenTrabajoUserEntity.php +++ b/ci4/app/Entities/Produccion/OrdenTrabajoUserEntity.php @@ -19,8 +19,13 @@ class OrdenTrabajoUserEntity extends Entity "interior_bn_user_id" => null, "interior_color_user_id" => null, "cubierta_user_id" => null, + "sobrecubierta_user_id" => null, + "guarda_user_id" => null, //ACABADO "plastificado_user_id" => null, + "plakene_user_id" => null, + "estampado_user_id" => null, + "uvi_user_id" => null, "encuadernacion_user_id" => null, "corte_user_id" => null, "preparacion_interior_user_id" => null, diff --git a/ci4/app/Entities/Tarifas/Acabados/TarifaAcabadoEntity.php b/ci4/app/Entities/Tarifas/Acabados/TarifaAcabadoEntity.php index cb96db44..30d846b5 100755 --- a/ci4/app/Entities/Tarifas/Acabados/TarifaAcabadoEntity.php +++ b/ci4/app/Entities/Tarifas/Acabados/TarifaAcabadoEntity.php @@ -24,6 +24,16 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity "deleted_at" => null, "created_at" => null, "updated_at" => null, + 'plastificado' => false, + 'plakene' => false, + 'rectractilado' => false, + 'estampado' => false, + 'uvi' => false, + 'plastificado_tipo' => null, + 'plakene_tipo' => null, + 'rectractilado_tipo' => null, + 'estampado_tipo' => null, + 'uvi_tipo' => null, ]; protected $casts = [ "precio_min" => "float", @@ -33,6 +43,16 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity "user_created_id" => "int", "user_updated_id" => "int", "is_deleted" => "int", + 'plastificado' => 'boolean', + 'plakene' => 'boolean', + 'rectractilado' => 'boolean', + 'estampado' => 'boolean', + 'uvi' => 'boolean', + 'plastificado_tipo' => '?string', + 'plakene_tipo' => '?string', + 'rectractilado_tipo' => '?string', + 'estampado_tipo' => '?string', + 'uvi_tipo' => '?string', ]; /** * Devuelve las maquinas asociadas a esta tarifa de acabado @@ -48,6 +68,7 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity public function isUVI(): bool { - return in_array($this->attributes["code"],["R3D","R2D"]); + return $this->attributes['uvi']; } + } diff --git a/ci4/app/Language/es/Produccion.php b/ci4/app/Language/es/Produccion.php index a511f03e..ee18d7b6 100755 --- a/ci4/app/Language/es/Produccion.php +++ b/ci4/app/Language/es/Produccion.php @@ -43,12 +43,13 @@ return [ "maquina_actual" => "Máquina actual", "tiempo_estimado" => "Tiempo estimado", "tiempo" => "Tiempo", + "proveedor" => "Proveedor", "imposicion" => "Imposición" ], "finalizadas" => "Finalizadas", "pendiente_ferro" => "Ferro pendiente", "pendientes" => "Pendientes", - "ferro_ok" => "Ferro ok", + "ferro_ok" => "Ferro/Prototipo ok", "envio" => "Envío", "ferro" => "Ferro", "ot" => "Orden trabajo", @@ -70,6 +71,7 @@ return [ "portada" => "portada", "plakene_traslucido" => "Plakene traslúcido", "plastificado_mate" => "Plastificado mate", + "plastificado" => "Plastificado", "espiral" => "Espiral", "embalaje" => "Embalaje", "tiempo_consumido" => "Tiempo consumido", @@ -80,6 +82,7 @@ return [ "preview_pdf" => "Previsualizar PDF", "imprimir_codigo_safekat" => "Imprimir código SAFEKAT", "imprimir_ferro" => "Imprimir ferro", + "imprimir_prototipo" => "Prototipo", "planning_rotativa" => "Planificación rotativa", "planning_plana" => "Planificación plana", "solapa" => "Solapa", @@ -97,12 +100,16 @@ return [ "grapado" => "Grapado", "solapa" => "Solapas", "retractilado" => "Retractilado", + "manipulado" => "Entrada manipulado", "retractilado5" => "Retractilado 5", "prototipo" => "Prototipo", "marcapaginas" => "Marcapáginas", //IMPRESION "impresion_bn" => "Impresión BN", "cubierta" => "Cubierta/Portada", + "guarda" => "Guarda", + "encuadernacion" => "Encuadernación", + //PREIMPRESION "pre_formato" => "Revisión formato", "pre_lomo" => "Revisión lomo", @@ -144,6 +151,11 @@ return [ 'print_label' => "Imprimir etiqueta", 'click_init' => "Clicks al inicio", 'click_end' => "Clicks al final", - - + "comentarios" => "Comentarios", + "comentariosOt" => "Comentarios orden", + "comentariosImpresionInterior" => "Comentarios interior", + "comentariosCubierta" => "Comentarios cubierta", + "comentariosEncuadernacion" => "Comentarios encuadernación", + "comentariosLogistica" => "Comentarios logística", + "info_solapa_guillotina" => "Datos solapa y preparación guillotina", ]; \ No newline at end of file diff --git a/ci4/app/Models/Compras/ProveedorModel.php b/ci4/app/Models/Compras/ProveedorModel.php index d48e8d8e..da0a6116 100755 --- a/ci4/app/Models/Compras/ProveedorModel.php +++ b/ci4/app/Models/Compras/ProveedorModel.php @@ -214,4 +214,12 @@ class ProveedorModel extends \App\Models\BaseModel return $builder->get()->getResultObject(); } + public function querySelect(?string $q) + { + $query = $this->builder()->select(['id','nombre as name']); + if($q){ + $query->like('nombre',$q); + } + return $query; + } } diff --git a/ci4/app/Models/Configuracion/MaquinaModel.php b/ci4/app/Models/Configuracion/MaquinaModel.php index ff8f3dcd..d462cc08 100755 --- a/ci4/app/Models/Configuracion/MaquinaModel.php +++ b/ci4/app/Models/Configuracion/MaquinaModel.php @@ -427,6 +427,9 @@ class MaquinaModel extends \App\Models\BaseModel ->where('tarea_progress.deleted_at', null) ->groupBy('lg_maquinas.id') ->orderBy('countTareas','DESC'); + if($maquina_tipo == "impresion"){ + $query->where('orden_trabajo_tareas.is_corte',0); + } return $query; } diff --git a/ci4/app/Models/OrdenTrabajo/OrdenTrabajoDate.php b/ci4/app/Models/OrdenTrabajo/OrdenTrabajoDate.php index 51234724..d44055ab 100755 --- a/ci4/app/Models/OrdenTrabajo/OrdenTrabajoDate.php +++ b/ci4/app/Models/OrdenTrabajo/OrdenTrabajoDate.php @@ -22,8 +22,14 @@ class OrdenTrabajoDate extends Model "interior_bn_at", "interior_color_at", "cubierta_at", + "sobrecubierta_at", //TODO + "guarda_at", //TODO //ACABADO "plastificado_at", + "plakene_at", //TODO + "retractilado_at", + "estampado_at", //TODO + "uvi_at", //TODO "encuadernacion_at", "corte_at", "preparacion_interiores_at", @@ -31,7 +37,6 @@ class OrdenTrabajoDate extends Model "cosido_at", "solapa_at", "grapado_at", - "retractilado_at", "retractilado5_at", "prototipo_at", "marcapaginas_at", diff --git a/ci4/app/Models/OrdenTrabajo/OrdenTrabajoModel.php b/ci4/app/Models/OrdenTrabajo/OrdenTrabajoModel.php index d7a1f37a..3dc9a95f 100755 --- a/ci4/app/Models/OrdenTrabajo/OrdenTrabajoModel.php +++ b/ci4/app/Models/OrdenTrabajo/OrdenTrabajoModel.php @@ -25,6 +25,11 @@ class OrdenTrabajoModel extends Model "progreso", "estado", "comentarios", + "comment_interior", + "comment_cubierta", + "comment_encuadernacion", + "comment_logistica", + "info_solapa_guillotina", "revisar_formato", "revisar_lomo", "revisar_solapa", diff --git a/ci4/app/Models/OrdenTrabajo/OrdenTrabajoUser.php b/ci4/app/Models/OrdenTrabajo/OrdenTrabajoUser.php index 443bbcd0..60114c57 100755 --- a/ci4/app/Models/OrdenTrabajo/OrdenTrabajoUser.php +++ b/ci4/app/Models/OrdenTrabajo/OrdenTrabajoUser.php @@ -23,11 +23,18 @@ class OrdenTrabajoUser extends Model "interior_bn_user_id", "interior_color_user_id", "cubierta_user_id", + "sobrecubierta_user_id", + "guarda_user_id", //ACABADO "plastificado_user_id", + "plakene_user_id", + "retractilado_user_id", + "estampado_user_id", + "uvi_user_id", + //ENCUADERNADO "encuadernacion_user_id", - "corte_user_id", "preparacion_interior_user_id", + "corte_user_id", "entrada_manipulado_user_id", "cosido_user_id", "solapa_user_id", diff --git a/ci4/app/Models/Tarifas/Acabados/TarifaAcabadoModel.php b/ci4/app/Models/Tarifas/Acabados/TarifaAcabadoModel.php index e345a774..384b06d5 100755 --- a/ci4/app/Models/Tarifas/Acabados/TarifaAcabadoModel.php +++ b/ci4/app/Models/Tarifas/Acabados/TarifaAcabadoModel.php @@ -1,4 +1,5 @@ groupStart() - ->like("t1.nombre", $search) - ->groupEnd(); + ->groupStart() + ->like("t1.nombre", $search) + ->groupEnd(); } public function getServiciosAcabadoSelector() diff --git a/ci4/app/Services/ProductionService.php b/ci4/app/Services/ProductionService.php index e4de8acd..de5c7dfa 100755 --- a/ci4/app/Services/ProductionService.php +++ b/ci4/app/Services/ProductionService.php @@ -23,6 +23,8 @@ use App\Models\Configuracion\MaquinaModel; use App\Models\OrdenTrabajo\OrdenTrabajoFileModel; use App\Models\OrdenTrabajo\OrdenTrabajoTareaProgressDate; use App\Models\Pedidos\PedidoModel; +use App\Models\Presupuestos\PresupuestoAcabadosModel; +use App\Models\Presupuestos\PresupuestoEncuadernacionesModel; use App\Models\Usuarios\UserModel; use CodeIgniter\Database\BaseBuilder; use CodeIgniter\Database\BaseResult; @@ -65,6 +67,8 @@ class ProductionService extends BaseService protected MaquinaEntity $defaultMaquinaCorte; protected MaquinaModel $maquinaModel; protected OrdenTrabajo $ordenTrabajoConfig; + protected PresupuestoAcabadosModel $presupuestoAcabadoModel; + protected PresupuestoEncuadernacionesModel $presupuestoEncuadernacionModel; /** @@ -100,7 +104,24 @@ class ProductionService extends BaseService * @var boolean */ public bool $isGofrado = false; //* CHECK DONE - + /** + * Indica si la orden de trabajo contiene plastificado + * Se usa para mostrar la fecha correspondiente en la vista + * @var boolean + */ + public bool $isPlastificado = false; //* CHECK DONE + /** + * Indica si la orden de trabajo contiene gofrado + * Se usa para mostrar la fecha correspondiente en la vista + * @var boolean + */ + public bool $isPlakene = false; //* CHECK DONE + /** + * Indica si la orden de trabajo contiene gofrado + * Se usa para mostrar la fecha correspondiente en la vista + * @var boolean + */ + public bool $isEstampado = false; //* CHECK DONE /** * Indica si la orden de trabajo contiene cosido * Se usa para mostrar la fecha correspondiente en la vista y pliegos @@ -110,10 +131,10 @@ class ProductionService extends BaseService /** * Indica si la orden de trabajo contiene gofrado * Se usa para mostrar la fecha correspondiente en la vista - * TODO Hay que implementar un boolean en `lg_tarifa_acabado` para identificar + * TODO Hay que implementar un boolean en `lg_tarifa_manipulado` para identificar * @var boolean */ - public bool $isGrapado = true; //TODO + public bool $isGrapado = false; //TODO /** * Indica si la orden de trabajo contiene espiral * Se usa para mostrar la fecha correspondiente en la vista @@ -121,21 +142,14 @@ class ProductionService extends BaseService * DEFAULT true hasta implementacion * @var boolean */ - public bool $isEspiral = true; //TODO + public bool $isEspiral = false; //TODO /** * Indica si la orden de trabajo contiene UVI * Se usa para mostrar la fecha correspondiente en la vista * @var boolean */ public bool $isUVI = false; //* CHECK DONE - /** - * Indica si la orden de trabajo contiene plastificado - * Se usa para mostrar la fecha correspondiente en la vista - * TODO Hay que implementar un boolean en `lg_tarifa_acabado` para identificar - * DEFAULT true hasta implementacion - * @var boolean - */ - public bool $isPlastificado = true; //TODO + /** * Indica si la orden de trabajo contiene cubierta * Se usa para mostrar la fecha correspondiente en la vista @@ -186,6 +200,8 @@ class ProductionService extends BaseService $this->otTareaProgressDate = model(OrdenTrabajoTareaProgressDate::class); $this->festivoModel = model(FestivoModel::class); $this->ordenTrabajoConfig = config('OrdenTrabajo'); + $this->presupuestoAcabadoModel = model(PresupuestoAcabadosModel::class); + $this->presupuestoEncuadernacionModel = model(PresupuestoEncuadernacionesModel::class); $this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["sin_imprimir"]; $this->configVariableModel = model(ConfigVariableModel::class); $this->podValue = $this->configVariableModel->getVariable('POD')->value; @@ -365,7 +381,7 @@ class ProductionService extends BaseService $ot_tareas["maquina_id"] = $p_linea_maquina->id; $ot_tareas["imposicion_id"] = null; $ot_tareas["tiempo_estimado"] = $p_linea->horas_maquina * 3600; - $ot_tareas["tiempo_real"] = 0; + $ot_tareas["tiempo_real"] = 0; $insert_query_result = $this->otTarea->insert($ot_tareas); $ot_tareas = []; $this->storeTareaCorte($p_linea); @@ -575,6 +591,14 @@ class ProductionService extends BaseService { return view("themes/vuexy/pdfs/orden_trabajo", $this->getDataPdf()); } + public function getFerroPdf() + { + return view("themes/vuexy/pdfs/ferro", $this->getDataPdf()); + } + public function getPrototipoPdf() + { + return view("themes/vuexy/pdfs/prototipo", $this->getDataPdf()); + } /** * Query para mostrar en datatable * @@ -595,6 +619,10 @@ class ProductionService extends BaseService "orden_trabajo_tareas.tiempo_real", "orden_trabajo_tareas.comment", "orden_trabajo_tareas.presupuesto_linea_id", + "orden_trabajo_tareas.presupuesto_acabado_id", + "orden_trabajo_tareas.presupuesto_manipulado_id", + "orden_trabajo_tareas.presupuesto_preimpresion_id", + "orden_trabajo_tareas.presupuesto_encuadernado_id", "presupuesto_linea.tipo", ]) @@ -837,6 +865,7 @@ class ProductionService extends BaseService "preimpresiones" => $this->presupuesto->preimpresiones(), "manipulados" => $this->presupuesto->manipulados(), "encuadernaciones" => $this->presupuesto->encuadernaciones(), + "encuadernacionCode" => $this->getEncuadernacionCode(), "linea_impresion" => $this->presupuesto->presupuestoLineaImpresion(), "linea_cubierta" => $this->presupuesto->presupuestoLineaCubierta(), "peso_unidad" => $logistica_data["peso_unidad"], @@ -847,7 +876,9 @@ class ProductionService extends BaseService "colors" => $this->getPdfColors(), "isPOD" => $this->isPOD, "uvi" => $this->getUVI(), + "flags" => $this->getFlags(), "tareaCosido" => $this->getTareaCosido(), + "plakene_tipo" => $this->plakene_tipo() ]; } public function getImposicionTareaImpresion(): ?Imposicion @@ -958,6 +989,18 @@ class ProductionService extends BaseService throw new Exception(lang('Produccion.task_already_finished')); } } + if(isset($data['estado'])){ + if($data['estado'] == 'F'){ + $tareaEntity = $this->otTarea->find($data['ot_tarea_id']); + $this->init($tareaEntity->orden_trabajo_id); + $dateName = $this->getOrdenTrabajoTareaDate($tareaEntity); + $dataDate = [ + 'name' => $dateName, + ]; + $dataDate[$dateName] = Time::now()->format('Y-m-d'); + $this->updateOrdenTrabajoDate($dataDate); + } + } return $this->otTareaProgressDate->insert($data); } public function getTareaLastState($tarea_id) @@ -972,6 +1015,12 @@ class ProductionService extends BaseService $data["action_at"] = Time::now()->format('Y-m-d H:i:s'); $data["action_user_id"] = auth()->user()->id; $status = $this->otTareaProgressDate->where('ot_tarea_id', $orden_trabajo_tarea_id)->delete(); + if($status){ + $tareaEntity = $this->otTarea->find($orden_trabajo_tarea_id); + $this->init($tareaEntity->orden_trabajo_id); + $dateName = $this->getOrdenTrabajoTareaDate($tareaEntity); + $this->emptyOrdenTrabajoDate($this->ot->id,$dateName); + } if ($status) { $response = $this->storeOrdenTrabajoTareaProgressDate($data); } @@ -1374,7 +1423,7 @@ class ProductionService extends BaseService $uvi = null; $acabados = $this->presupuesto->acabados(); foreach ($acabados as $key => $acabado) { - if ($acabado->tarifa()->isUVI()) { + if ($acabado->tarifa()->uvi) { $uvi = $acabado->tarifa(); } } @@ -1490,8 +1539,11 @@ class ProductionService extends BaseService { $code = ""; $encuadernaciones = $this->presupuesto->encuadernaciones(); - if (isset($encuadernaciones[0])) { - $code = $encuadernaciones[0]->tarifa()->code; + foreach ($encuadernaciones as $key => $value) { + $code = $value->tarifa()->code; + if ($code) { + break; + } } return $code; } @@ -1596,21 +1648,10 @@ class ProductionService extends BaseService foreach ($acabados as $key => $acabado) { $tarifa_acabado = $acabado->tarifa(); if ($tarifa_acabado->code) { - $plastificado_code = $tarifa_acabado->code; - if ($plastificado_code == "BRIL") { - $color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR['BRIL']; - } - if ($plastificado_code == "MATE") { - $color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR['MATE']; - } - if ($plastificado_code == "ANTI") { - $color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR['ANTIRAYADO']; - } - if ($plastificado_code == "SAND") { - $color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR['SANDY']; - } - if ($plastificado_code == "GOF") { - $color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR['GOFRADO']; + if ($tarifa_acabado->plastificado) { + if (isset($this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR[$tarifa_acabado->plastificado_tipo])) { + $color = $this->ordenTrabajoConfig->OT_PLASTIFICADO_COLOR[$tarifa_acabado->plastificado_tipo]; + } } } } @@ -1641,10 +1682,15 @@ class ProductionService extends BaseService $this->color(); return [ "isGofrado" => $this->gofrado(), - "isEspiral" => $this->isEspiral, + "isEspiral" => $this->isEspiral, //TODO + "isPlastificado" => $this->plastificado(), + "isPlakene" => $this->plakene(), + "isEstampado" => $this->estampado(), + "isRetractilado" => $this->retractilado(), "isUVI" => $this->uvi(), - "isPlastificado" => $this->isPlastificado, "isCubierta" => $this->cubierta(), + "isSobrecubierta" => $this->sobreCubierta(), + "isGuarda" => $this->guarda(), "isColor" => $this->isColor, "isBN" => $this->isBN, "isCorte" => $this->corte(), @@ -1669,6 +1715,75 @@ class ProductionService extends BaseService $this->isGofrado = $flag; return $this->isGofrado; } + public function plakene(): bool + { + $flag = false; + $acabados = $this->presupuesto->acabados(); + foreach ($acabados as $key => $acabado) { + $tarifa_acabado = $acabado->tarifa(); + if ($tarifa_acabado->plakene) { + $flag = true; + break; + } + } + $this->isPlakene = $flag; + return $this->isPlakene; + } + public function retractilado(): bool + { + $flag = false; + $acabados = $this->presupuesto->acabados(); + foreach ($acabados as $key => $acabado) { + $tarifa_acabado = $acabado->tarifa(); + if ($tarifa_acabado->retractilado) { + $flag = true; + break; + } + } + $this->isPlakene = $flag; + return $this->isPlakene; + } + public function plakene_tipo(): ?string + { + $tipo = ""; + $acabados = $this->presupuesto->acabados(); + foreach ($acabados as $key => $acabado) { + $tarifa_acabado = $acabado->tarifa(); + if ($tarifa_acabado->plakene) { + $tipo = $tarifa_acabado->plakene_tipo; + break; + } + } + return $tipo; + } + public function plastificado(): bool + { + $flag = false; + $acabados = $this->presupuesto->acabados(); + foreach ($acabados as $key => $acabado) { + $tarifa_acabado = $acabado->tarifa(); + if ($tarifa_acabado->plastificado) { + $flag = true; + break; + } + } + $this->isPlastificado = $flag; + return $this->isPlastificado; + } + public function estampado(): bool + { + $flag = false; + $acabados = $this->presupuesto->acabados(); + foreach ($acabados as $key => $acabado) { + $tarifa_acabado = $acabado->tarifa(); + if ($tarifa_acabado->estampado) { + $flag = true; + break; + } + } + $this->isEstampado = $flag; + return $this->isEstampado; + } public function cosido(): bool { $flag = false; @@ -1701,6 +1816,24 @@ class ProductionService extends BaseService } return $this->isCubierta; } + public function sobreCubierta(): bool + { + $flag = false; + $lineaCubierta = $this->presupuesto->presupuestoLineaSobreCubierta(); + if ($lineaCubierta) { + $flag = true; + } + return $flag; + } + public function guarda(): bool + { + $flag = false; + $lineaCubierta = $this->presupuesto->presupuestoLineaGuarda(); + if ($lineaCubierta) { + $flag = true; + } + return $flag; + } public function color(): bool { $linea_impresion = $this->presupuesto->presupuestoLineaImpresion(); @@ -1739,10 +1872,7 @@ class ProductionService extends BaseService "orden_trabajo_tareas.id as ot_tarea_id", "pedidos.fecha_impresion", "orden_trabajo_tareas.nombre as tareaName", - "presupuestos.titulo as presupuesto_titulo", "orden_trabajo_tareas.maquina_id", - "lg_papel_impresion.nombre as papel_impresion", - "presupuesto_linea.gramaje as papel_gramaje", "tarea_progress.estado as tareaEstado" ]) ->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left") @@ -1759,21 +1889,14 @@ class ProductionService extends BaseService 'tarea_progress.ot_tarea_id = orden_trabajo_tareas.id', 'left' ) - ->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left") - ->join("presupuestos", "presupuestos.id = presupuesto_linea.presupuesto_id", "right") ->join("pedidos", "pedidos.id = ordenes_trabajo.pedido_id", "right") - ->join("lg_papel_formato", "lg_papel_formato.id = presupuestos.papel_formato_id", "left") ->join("lg_maquinas", "lg_maquinas.id = orden_trabajo_tareas.maquina_id", "left") - ->join("lg_papel_impresion", "lg_papel_impresion.id = presupuesto_linea.papel_impresion_id", "left") - ->groupStart() - ->orWhere('orden_trabajo_tareas.maquina_id', $maquina_id) //!TODO - ->orWhere('presupuesto_linea.maquina_id', $maquina_id) - ->groupEnd() + ->where('orden_trabajo_tareas.maquina_id', $maquina_id) // ->where('pedidos.fecha_impresion IS NOT NULL', null, false) ->where("orden_trabajo_tareas.deleted_at", null) ->where("tarea_progress.estado", 'P') ->orderBy("pedidos.fecha_impresion", "ASC") - ->groupBy('orden_trabajo_tareas.nombre'); + ->groupBy('orden_trabajo_tareas.id'); return $q; } @@ -1860,4 +1983,176 @@ class ProductionService extends BaseService $dates = $this->createDatesForPOD(); return $this->pedidoModel->update($this->pedido->id, $dates); } + public function getProveedorTarea($tarea_id) + { + $proveedor = null; + $tareaEntity = $this->otTarea->find($tarea_id); + if ($tareaEntity) { + $proveedorEncuadernado = $tareaEntity->presupuesto_encuadernacion(); + $proveedorAcabado = $tareaEntity->presupuesto_acabado(); + if ($proveedorEncuadernado) { + $proveedor = $proveedorEncuadernado->proveedor(); + } elseif ($proveedorAcabado) { + $proveedor = $proveedorAcabado->proveedor(); + } else { + $proveedor = null; + } + } + return ["tarea" => $tareaEntity, "proveedor" => $proveedor]; + } + public function updateProveedorLinea($tarea_id, $proveedor_id) + { + $status = false; + $tareaEntity = $this->otTarea->find($tarea_id); + $presupuestoEncuadernado = $tareaEntity->presupuesto_encuadernacion(); + $presupuestoAcabado = $tareaEntity->presupuesto_acabado(); + if ($presupuestoEncuadernado) { + $status = $this->presupuestoEncuadernacionModel->update($presupuestoEncuadernado->id, ['proveedor_id' => $proveedor_id]); + } elseif ($presupuestoAcabado) { + $status = $this->presupuestoAcabadoModel->update($presupuestoAcabado->id, ['proveedor_id' => $proveedor_id]); + } else { + $status = null; + } + return $status; + } + public function otTareaImpresionWithDates() + { + $tareasImpresion = $this->ot->tareas_impresion(); + $data = []; + foreach ($tareasImpresion as $key => $tareaImpresion) { + if ($tareaImpresion->is_corte) { + $data[$tareaImpresion->id] = 'corte_at'; + continue; + } + $presupuestoLineaEntity = $tareaImpresion->presupuesto_linea(); + if ($presupuestoLineaEntity) { + if ($presupuestoLineaEntity->isGuarda()) { + $data[$tareaImpresion->id] = 'guarda_at'; + } elseif ($presupuestoLineaEntity->isCubierta()) { + $data[$tareaImpresion->id] = 'cubierta_at'; + } elseif ($presupuestoLineaEntity->isColor()) { + $data[$tareaImpresion->id] = 'interior_color_at'; + } elseif ($presupuestoLineaEntity->isBN()) { + $data[$tareaImpresion->id] = 'interior_bn_at'; + } elseif ($presupuestoLineaEntity->isSobreCubierta()) { + $data[$tareaImpresion->id] = 'sobrecubierta_at'; + } + } + } + return $data; + } + public function tareaImpresionDate($tarea): string + { + + $dateName = ""; + $presupuestoLineaEntity = $tarea->presupuesto_linea(); + if ($presupuestoLineaEntity) { + if ($presupuestoLineaEntity->isGuarda()) { + $dateName = 'guarda_at'; + } elseif ($presupuestoLineaEntity->isCubierta()) { + $dateName = 'cubierta_at'; + } elseif ($presupuestoLineaEntity->isColor()) { + $dateName = 'interior_color_at'; + } elseif ($presupuestoLineaEntity->isBN()) { + $dateName = 'interior_bn_at'; + } elseif ($presupuestoLineaEntity->isSobreCubierta()) { + $dateName = 'sobrecubierta_at'; + } + if ($tarea->is_corte) { + $dateName = 'corte_at'; + } + } + return $dateName; + } + public function otTareaAcabadoWithDates() + { + $tareasAcabado = $this->ot->tareas_acabado(); + $data = []; + foreach ($tareasAcabado as $key => $tareasAcabado) { + $tarifaAcabado = $tareasAcabado->presupuesto_acabado()?->tarifa(); + if ($tarifaAcabado) { + if ($tarifaAcabado->plastificado) { + $data[$tareasAcabado->id] = 'plastificado_at'; + } + if ($tarifaAcabado->rectractilado) { + $data[$tareasAcabado->id] = 'rectractilado_at'; + } + if ($tarifaAcabado->estampado) { + $data[$tareasAcabado->id] = 'estampado_at'; + } + if ($tarifaAcabado->uvi) { + $data[$tareasAcabado->id] = 'uvi_at'; + } + } + } + return $data; + } + public function tareaAcabadoDate($tarea): string + { + + $dateName = ""; + $tarifaAcabado = $tarea->presupuesto_acabado()?->tarifa();; + if ($tarifaAcabado) { + if ($tarifaAcabado->plastificado) { + $dateName = 'plastificado_at'; + } + if ($tarifaAcabado->rectractilado) { + $dateName = 'rectractilado_at'; + } + if ($tarifaAcabado->plakene) { + $dateName = 'plakene_at'; + } + if ($tarifaAcabado->estampado) { + $dateName = 'estampado_at'; + } + if ($tarifaAcabado->uvi) { + $dateName = 'uvi_at'; + } + } + return $dateName; + } + public function otTareaEncuadernadoWithDates() + { + $tareas = $this->ot->tareas_encuadernado(); + $data = []; + foreach ($tareas as $key => $tarea) { + $data[$tarea->id] = "encuadernacion_at"; + } + return $data; + } + + public function otTareaManipuladooWithDates() + { + $tareas = $this->ot->tareas_manipulado(); + $data = []; + foreach ($tareas as $key => $tarea) { + $data[$tarea->id] = "entrada_manipulado_at"; + } + return $data; + } + public function getOrdenTrabajoTareaDates(): array + { + $dates = []; + foreach ($this->ot->tareas() as $key => $tarea) { + $dates[] = $this->getOrdenTrabajoTareaDate($tarea); + } + return array_unique($dates); + } + public function getOrdenTrabajoTareaDate(OrdenTrabajoTareaEntity $tarea): ?string + { + $dateName = null; + if ($tarea->isImpresion()) { + $dateName = $this->tareaImpresionDate($tarea); + } + if ($tarea->isAcabado()) { + $dateName = $this->tareaAcabadoDate($tarea); + } + if ($tarea->isManipulado()) { + $dateName = "entrada_manipulado_at"; + } + if ($tarea->isEncuadernado()) { + $dateName = "encuadernacion_at"; + } + return $dateName; + } } diff --git a/ci4/app/Views/themes/vuexy/components/tables/maquinista_tarea_table.php b/ci4/app/Views/themes/vuexy/components/tables/maquinista_tarea_table.php index cbf06dde..2ff699af 100755 --- a/ci4/app/Views/themes/vuexy/components/tables/maquinista_tarea_table.php +++ b/ci4/app/Views/themes/vuexy/components/tables/maquinista_tarea_table.php @@ -6,9 +6,6 @@ - - - diff --git a/ci4/app/Views/themes/vuexy/components/tables/ot_task_table.php b/ci4/app/Views/themes/vuexy/components/tables/ot_task_table.php index 60dc55d3..77a28ddf 100755 --- a/ci4/app/Views/themes/vuexy/components/tables/ot_task_table.php +++ b/ci4/app/Views/themes/vuexy/components/tables/ot_task_table.php @@ -1,6 +1,6 @@
- +
@@ -8,6 +8,7 @@ + diff --git a/ci4/app/Views/themes/vuexy/form/produccion/ot/otComments.php b/ci4/app/Views/themes/vuexy/form/produccion/ot/otComments.php index 222d64f9..5223e062 100755 --- a/ci4/app/Views/themes/vuexy/form/produccion/ot/otComments.php +++ b/ci4/app/Views/themes/vuexy/form/produccion/ot/otComments.php @@ -1,6 +1,195 @@ +
+
+

+ +

-
- - - -
\ No newline at end of file +
+
+ +
+
+
+
\ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/form/produccion/ot/otHeader.php b/ci4/app/Views/themes/vuexy/form/produccion/ot/otHeader.php index 2777d260..469decd9 100755 --- a/ci4/app/Views/themes/vuexy/form/produccion/ot/otHeader.php +++ b/ci4/app/Views/themes/vuexy/form/produccion/ot/otHeader.php @@ -42,9 +42,17 @@ Pedido - "> - - PDF + ferro == 1): ?> + dates()->ferro_ok_at != null): ?> + "> + + PDF + + + "> + + PDF + diff --git a/ci4/app/Views/themes/vuexy/form/produccion/ot/otProgress.php b/ci4/app/Views/themes/vuexy/form/produccion/ot/otProgress.php index 002a23e1..87812602 100755 --- a/ci4/app/Views/themes/vuexy/form/produccion/ot/otProgress.php +++ b/ci4/app/Views/themes/vuexy/form/produccion/ot/otProgress.php @@ -21,7 +21,7 @@
-
"> +
">
@@ -136,30 +136,90 @@
"> - +
- > + >
" ?>
+ +
"> + +
+ > + +
+
" ?>
+
+ +
"> + +
+ > + +
+
" ?>
+ +
+ +
+
+ +
+

+
"> - +
- > + >
" ?>
-
-
-
-

+
"> + +
+ > + +
+
" ?>
+ +
+ +
"> + +
+ > + +
+
" ?>
+ +
+ +
"> + +
+ > + +
+
" ?>
+ +
+ +
"> + +
+ > + +
+
" ?>
+
"> @@ -187,35 +247,6 @@
" ?>
- -
"> - -
- > - -
-
" ?>
-
- - -
"> - -
- > - -
-
" ?>
-
- - -
"> - -
- > - -
-
" ?>
-
"> @@ -237,13 +268,23 @@
-
"> - +
"> +
- > + >
-
" ?>
+
" ?>
+ +
+ +
"> + +
+ > + +
+
" ?>
diff --git a/ci4/app/Views/themes/vuexy/form/produccion/viewOrdenTrabajoEdit.php b/ci4/app/Views/themes/vuexy/form/produccion/viewOrdenTrabajoEdit.php index 474445ce..c57b532f 100755 --- a/ci4/app/Views/themes/vuexy/form/produccion/viewOrdenTrabajoEdit.php +++ b/ci4/app/Views/themes/vuexy/form/produccion/viewOrdenTrabajoEdit.php @@ -45,9 +45,17 @@ href=""> + ferro): ?> + "> + + + prototipo): ?> - + "> + + user()->inGroup('maquina')) { +if (auth()->user()->inGroup('maquina','admin')) { ?>
- + @@ -10,10 +10,13 @@ 0): ?> - $value): ?> - - + + solapas > 0): ?> + + + + @@ -21,7 +24,6 @@ - diff --git a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/CC2S.php b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/CC2S.php deleted file mode 100644 index 285f4e6d..00000000 --- a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/CC2S.php +++ /dev/null @@ -1,30 +0,0 @@ -
Encuadernacionsolapas > 0 ? "Solapas" : ""?> Marcapáginas
tarifa()->nombre ?>tarifa()->nombre ?>solapas_ancho mm.)" ?> retractilado ? "SI" : "NO" ?> marcapaginas ? "SI" : "NO" ?>
Sin encuadernación
- - - - - - - - - - - 0): ?> - $value): ?> - - - - - - - - - - - - - - - - -
EncuadernacionSolapasRetractiladoMarcapáginas
tarifa()->nombre ?>solapas ? "SI ($presupuesto->solapas_ancho mm.)" : "NO" ?>retractilado ? "SI" : "NO" ?>marcapaginas ? "SI" : "NO" ?>
Sin encuadernación
\ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/ESP.php b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/ESP.php index d12593bb..06344e09 100644 --- a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/ESP.php +++ b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/ESP.php @@ -9,17 +9,15 @@ Retractilado 0): ?> - $value): ?> - tarifa()->nombre ?> - - - - + tarifa()->nombre ?> + Plástico + + + proveedor() ? $encuadernacion->proveedor()->nombre : "" ?> retractilado ? "SI" : "NO" ?> - Sin encuadernación diff --git a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/RCHV.php b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/RCHV.php index 4b984852..769f698e 100644 --- a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/RCHV.php +++ b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/RCHV.php @@ -3,25 +3,27 @@ Encuadernacion Pliegos Pliegos - + solapas > 0 ? "Solapas" : ""?> Sobrecubierta Guardas Retractilado Marcapáginas 0): ?> - $value): ?> - tarifa()->nombre ?> - pliego_1." de ".$tareaCosido->pliego_1_total?> - pliego_2." de ".$tareaCosido->pliego_2_total?> - + tarifa()->nombre ?> + pliego_1 . " de " . $tareaCosido->pliego_1_total ?> + pliego_2 . " de " . $tareaCosido->pliego_2_total ?> + solapas > 0): ?> + solapas_ancho mm.)" ?> + + NO + hasSobrecubierta() ? "SI" : "NO" ?> guardas ? "SI" : "NO" ?> retractilado ? "SI" : "NO" ?> marcapaginas ? "SI" : "NO" ?> - Sin encuadernación diff --git a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/RCHVS.php b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/RCHVS.php deleted file mode 100644 index e8fa2d41..00000000 --- a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/RCHVS.php +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - 0): ?> - $value): ?> - - - - - - - - - - - - - - - - -
EncuadernacionPliegosPliegosSolapasSobrecubiertaGuardasRetractiladoMarcapáginas
tarifa()->nombre ?>pliego_1." de ".$tareaCosido->pliego_1_total?>pliego_2." de ".$tareaCosido->pliego_2_total?>solapas ? "SI ($presupuesto->solapas_ancho mm.)" : "NO" ?>hasSobrecubierta() ? "SI" : "NO" ?>guardas ? "SI" : "NO" ?>retractilado ? "SI" : "NO" ?>marcapaginas ? "SI" : "NO" ?>
Sin encuadernación
\ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/RF.php b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/RF.php index de0a6374..11ca2aa7 100644 --- a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/RF.php +++ b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/RF.php @@ -1,7 +1,7 @@ - + @@ -10,10 +10,13 @@ 0): ?> - $value): ?> - - + + solapas > 0): ?> + + + + @@ -21,7 +24,6 @@ - diff --git a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/RFS.php b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/RFS.php deleted file mode 100644 index 5fcf0d22..00000000 --- a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/RFS.php +++ /dev/null @@ -1,30 +0,0 @@ -
Encuadernacionsolapas > 0 ? "Solapas" : ""?> SobrecubiertaMarcapáginas
tarifa()->nombre ?>tarifa()->nombre ?>solapas_ancho mm.)" ?> hasSobrecubierta() ? "SI" : "NO" ?>retractilado ? "SI" : "NO" ?> marcapaginas ? "SI" : "NO" ?>
Sin encuadernación
- - - - - - - - - - - 0): ?> - $value): ?> - - - - - - - - - - - - - - - - -
EncuadernacionSolapasSobrecubiertaGuardasRetractiladoMarcapáginas
tarifa()->nombre ?>solapas ? "SI ($presupuesto->solapas_ancho mm.)" : "NO" ?>hasSobrecubierta() ? "SI" : "NO" ?>guardas ? "SI" : "NO" ?>retractilado ? "SI" : "NO" ?>marcapaginas ? "SI" : "NO" ?>
Sin encuadernación
\ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/TDC.php b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/TDC.php deleted file mode 100644 index 23bbb605..00000000 --- a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/TDC.php +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - 0): ?> - $value): ?> - - - - - - - - - - - - - - - - - - - - - - - -
EncuadernacionPliegosPliegosGuardasGuardas ImpresionCabezadaLomo
tarifa()->nombre ?>pliego_1." de ".$tareaCosido->pliego_1_total?>pliego_2." de ".$tareaCosido->pliego_2_total?>Color/NORecto/Redondo
SobrecubiertaisSobreCubierta() ? "SI" : "NO" ?>Retractiladoretractilado ? "SI" : "NO" ?>Marcapáginasmarcapaginas ? "SI" : "NO" ?>
Sin encuadernación
\ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/TDCF.php b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/TDCF.php new file mode 100644 index 00000000..8e67f288 --- /dev/null +++ b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/TDCF.php @@ -0,0 +1,48 @@ + + + + + + + + + + + 0): ?> + + + + + + + + + + + + presupuestoLineaGuarda()): ?> + + + + + + + + + + + + + + + + + + + + + + + + +
EncuadernacionPliegosPliegosGuardasGuardas ImpresionCabezadaLomo
tarifa()->nombre ?>pliego_1 . " de " . $tareaCosido->pliego_1_total ?>pliego_2 . " de " . $tareaCosido->pliego_2_total ?>presupuestoLineaGuarda()->papel_generico()?->code ?>presupuestoLineaGuarda()->paginas_impresion > 0 ? "SI" : "NO" ?>?presupuestoLineaGuarda()->paginas_impresion > 0 ? "SI" : "NO" ?>>cabezada ? "COLOR" : "NO" ?>lomo_redondo ? "REDONDO" : "RECTO" ?>
SobrecubiertaisSobreCubierta() ? "SI" : "NO" ?>Retractiladoretractilado ? "SI" : "NO" ?>Marcapáginasmarcapaginas ? "SI" : "NO" ?>
Sin encuadernación
\ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/TDF.php b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/TDF.php index 32241733..d558947d 100644 --- a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/TDF.php +++ b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/TDF.php @@ -1,6 +1,6 @@ - + @@ -10,18 +10,27 @@ 0): ?> - $value): ?> - - - - - - - - + + + presupuestoLineaGuarda()): ?> + + + + + + + + + + + + + + + + - diff --git a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/WIO.php b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/WIO.php index c46e8ae9..f72f29b8 100644 --- a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/WIO.php +++ b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/WIO.php @@ -1,26 +1,21 @@
EncuadernacionEncuadernacion Guardas Guardas Imp. CabezadaMarcapáginas
tarifa()->nombre ?>tarifa()->nombre ?>presupuestoLineaGuarda()->papel_generico()?->nombre ?>presupuestoLineaGuarda()->paginas_impresion > 0 ? "SI" : "NO" ?>>?presupuestoLineaGuarda()->paginas_impresion > 0 ? "SI" : "NO" ?>>cabezada ? "COLOR" : "NO" ?>lomo_redondo ? "REDONDO" : "RECTO" ?>isSobreCubierta() ? "SI" : "NO" ?>retractilado ? "SI" : "NO" ?>marcapaginas ? "SI" : "NO" ?>
Sin encuadernación
- - + 0): ?> - $value): ?> - - - - - + + + + + - diff --git a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/default.php b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/default.php index de0a6374..07b92483 100644 --- a/ci4/app/Views/themes/vuexy/pdfs/encuadernados/default.php +++ b/ci4/app/Views/themes/vuexy/pdfs/encuadernados/default.php @@ -10,9 +10,8 @@ 0): ?> - $value): ?> - + @@ -21,7 +20,6 @@ - diff --git a/ci4/app/Views/themes/vuexy/pdfs/ferro.php b/ci4/app/Views/themes/vuexy/pdfs/ferro.php new file mode 100755 index 00000000..2b22a376 --- /dev/null +++ b/ci4/app/Views/themes/vuexy/pdfs/ferro.php @@ -0,0 +1,305 @@ +get('settings'); +?> + + + + + + + + + + + + + + + + + + +<?= $presupuesto->titulo ?>[OT:<?= $ot->id ?>] + + + + + +
id . "_" . $presupuesto->titulo ?>"> +
+
+
titulo ?>
+ format("d/m/Y H:i:s") ?> +
+
+ +
+
+
+ full_path): ?> + full_path)) : '/assets/img/portada_not_found.png' ?>" /> + + + + + +
+
;color:;"> +
+
+
;color:;"> + fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?> + Comercial: first_name . " " . $cliente->comercial()->last_name ?> +
+
+
+
+ ;color:;"> + + POD + presupuestoLineaImpresion()->isRotativa()): ?> + ROTATIVA + + GENERAL + + + + +
+
+
+ +
+
+ +
+
- WIO -
EncuadernacionColorTipo Plakenes Plakene Externo Retractilado
tarifa()->nombre ?>tarifa()->nombre ?>Metálicoproveedor() ? $encuadernacion->proveedor()->nombre : "" ?> retractilado ? "SI" : "NO" ?>
Sin encuadernaciónMarcapáginas
tarifa()->nombre ?>tarifa()->nombre ?> retractilado ? "SI" : "NO" ?> marcapaginas ? "SI" : "NO" ?>
Sin encuadernación
+ + + + + + + + + + + + + + + + + + + + +
IN
PORT.
ACABAD.
ENCUAD.
MANIPUL.
+
+ + +
+
+
;color:;"> + +
+
+
+
;color:;"> + papel_impresion()->papel_code_ot ?> +
+
"> + +
+
;color:;"> + papel_impresion()->papel_code_ot ?> +
+
;color:;"> + tarifa()->code : "" ?> +
+ $acabado): ?> + tarifa()->isUVI()): ?> +
;color:white;"> + + tarifa()->code ?> +
+ + +
+
+
"> +
+
+ ;">id ?> +
+
+ barcode +
+ +
+
+ + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + +
IDSK + +
CLIENTE + alias ?> +
TITULO + titulo ?> +
ISBNisbn ?>
PEDIDO CLIENTEid ?>
+
+
+
+ + + imposicion_esquema()): ?> + imposicion_esquema()->svg_schema ?> + + + +
+
+
+ + + + + +
Imposicionfull_name ?? "" ?>
+
+
+
+
+
+
IMP. INTERIOR
+
+
+ + + + + + + + + + + +
ancho ?>xalto ?> 1 tipo_presupuesto()?->codigo ?? "" ?> lomo_cubierta, 2, ',', '.') ?>
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
PáginasEjemplaresTintasFormasMáquinaClicsTiempo
paginas ?> 1 tinta() ?>formas)->formas ?>maquina()->nombre ?>rotativa_clicks_libro ?>horas_maquina * 3600 / $presupuesto->tirada) ?>
papel_impresion ?>papel_impresion()->gramaje . " " . "gr" ?> + isRotativa()): ?> + rotativa_metros_libro, 2, ',', '.') ?> metros + +
+
+
+
Comentarios impresión interior
+
+

+ comment_interior ?> +

+
+
+
+
+
+
LOGISTICA
+
+ + + + + + + + + + + +
Peso UnidadPeso PedidoCorte Pie
gr 1000 ? number_format($peso_unidad / 1000, 2, ',', '.') . " kg" : number_format($peso_unidad, 2, ',', '.') . " gr" ?> -
+
+
Comentarios logistica:
+
+

+ comment_logistica ?> +

+
+
+
+
+
+ © 2024 SAFEKAT. Todos los derechos reservados. +
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php b/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php index 5c9cd063..315a5bf6 100755 --- a/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php +++ b/ci4/app/Views/themes/vuexy/pdfs/orden_trabajo.php @@ -32,376 +32,382 @@ $settings = $session->get('settings'); - -
id . "_" . $presupuesto->titulo ?>"> -
-
-
titulo ?>
- format("d/m/Y H:i:s") ?> -
-
- -
-
-
- full_path): ?> - full_path)) : '/assets/img/portada_not_found.png' ?>" /> - - - - - -
-
;color:;"> +
+
id . "_" . $presupuesto->titulo ?>">
-
-
;color:;"> - fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?> - Comercial: first_name . " " . $cliente->comercial()->last_name ?> -
-
-
-
- ;color:;"> - - POD - presupuestoLineaImpresion()->isRotativa()): ?> - ROTATIVA - - GENERAL - - - - -
-
-
- -
-
-
-
- ;">fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?> -
-
-
- - - - - - - - - - - - - - - - - - - - - -
IN
PORT.
ACABAD.
ENCUAD.
MANIPUL.
-
- -
-
-
-
;color:;"> - tarifa()->code ?? "" : "" ?> -
-
-
-
;color:;"> - papel_impresion()->papel_code_ot ?> -
-
"> - -
-
;color:;"> - papel_impresion()->papel_code_ot ?> -
-
;color:;"> - tarifa()->code : "" ?> -
- $acabado): ?> - tarifa()->isUVI()): ?> -
;color:white;"> - + tarifa()->code ?> -
- - -
-
-
"> -
-
- ;">id ?> -
-
- barcode -
- -
+
+
titulo ?>
+ format("d/m/Y H:i:s") ?>
-
-
-
- - - - - - - - - - - - - - - - - - - - - - -
IDSK +
+
+ full_path): ?> + full_path)) : '/assets/img/portada_not_found.png' ?>" /> + + -
CLIENTE - alias ?> -
TITULO - titulo ?> -
ISBNisbn ?>
PEDIDO CLIENTEid ?>
-
-
-
- - - imposicion_esquema()): ?> - imposicion_esquema()->svg_schema ?> -
-
-
- - - - - -
Imposicionfull_name ?? "" ?>
+
;color:;"> +
+
+
;color:;"> + fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?> + Comercial: first_name . " " . $cliente->comercial()->last_name ?> +
+
+
+
+ ;color:;"> + + POD + presupuestoLineaImpresion()->isRotativa()): ?> + ROTATIVA + + GENERAL + + + + +
+
+ +
+
+
+
+ ;">fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?> +
+
+
+ + + + + + + + + + + + + + + + + + + + + +
IN
PORT.
ACABAD.
ENCUAD.
MANIPUL.
+
+ +
+
+
+
;color:;"> + +
+
+
+
;color:;"> + papel_impresion()->papel_code_ot ?> +
+
"> + +
+
;color:;"> + papel_impresion()->papel_code_ot ?> +
+
;color:;"> + tarifa()->code : "" ?> +
+ $acabado): ?> + tarifa()->isUVI()): ?> +
;color:white;"> + + tarifa()->code ?> +
+ + +
+
+
"> +
+
+ ;">id ?> +
+
+ barcode +
+ +
+
+
+
-
-
-
IMP. INTERIOR
-
-
- +
+
+
- - - - - - - - - -
ancho ?>xalto ?> tirada ?> + merma ?> tipo_presupuesto()?->codigo ?? "" ?> lomo_cubierta, 2, ',', '.') ?>
- - - - - - - - - - + + - - - - - - - + + - - - + + + + + + + + +
PáginasEjemplaresTintasFormasMáquinaClicsTiempoIDSK + +
paginas ?> tirada ?> tinta() ?>formas)->formas ?>maquina()->nombre ?>rotativa_clicks_total ?>horas_maquina * 3600) ?>CLIENTE + alias ?> +
papel_impresion ?>papel_impresion()->gramaje . " " . "gr" ?> - isRotativa()): ?> - rotativa_metros_total, 2, ',', '.') ?> metros - + TITULO + titulo ?>
ISBNisbn ?>
PEDIDO CLIENTEid ?>
-
-
Comentarios impresión interior
-
-

-

-
-

-

+
+
+ + + imposicion_esquema()): ?> + imposicion_esquema()->svg_schema ?> + + + +
+
+
+ + + + + +
Imposicionfull_name ?? "" ?>
+
-
-
-
IMP. CUBIERTA
+
IMP. INTERIOR
+
+ + + + + + + + + + + +
ancho ?>xalto ?> tirada ?> + merma ?> tipo_presupuesto()?->codigo ?? "" ?> lomo_cubierta, 2, ',', '.') ?>
+ + + + + + + + + + + + + + + + + + + + + + + + + +
PáginasEjemplaresTintasFormasMáquinaClicsTiempo
paginas ?> tirada ?> tinta() ?>formas)->formas ?>maquina()->nombre ?>rotativa_clicks_total ?>horas_maquina * 3600) ?>
papel_impresion ?>papel_impresion()->gramaje . " " . "gr" ?> + isRotativa()): ?> + rotativa_metros_total, 2, ',', '.') ?> metros + +
+
+
+
+
+

+ comment_interior ?> +

+
+
+
+
+ +
+
IMP. CUBIERTA
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TintasEjemplaresMaquinaMarcapaginasTiempo
tinta() ?>tirada ?>maquina()->nombre ?>marcapaginas ? "SI" : "NO" ?>horas_maquina * 3600) ?>
formas)->maquina_ancho ?>xformas)->maquina_alto ?>ancho ?>xalto ?>papel_impresion ?>papel_impresion()->gramaje . " " . "gr" ?>
+
+
+ +
+

+ comment_cubierta ?> +

+
+
+
+ +
+ +
+
ACABADOS/ENCUADERNACIÓN
+
+
;color:;"> + +
+ + $acabado): ?> + + + + + + + + + + + + + + + + + +
Plastificadotarifa()->nombre ?>UVI EXTERNO:proveedor() ? $acabado->proveedor()->nombre : "" ?>
info_solapa_guillotina?>CORTE PIE:
+ + $encuadernacion) { + $encuadernacion_code = $encuadernacion->tarifa()->code; + try { + if ($encuadernacion_code) { + echo view("/themes/vuexy/pdfs/encuadernados/$encuadernacion_code.php", ["encuadernacion" => $encuadernacion]); + } else { + echo view("/themes/vuexy/pdfs/encuadernados/default.php", ["encuadernacion" => $encuadernacion]); + } + } catch (\Throwable $th) { + $error_message = $th->getMessage(); + echo "No se ha podido renderizar la tabla de encuadernación"; + // echo "
$error_message"; + } + } + ?> + 0): ?> + +
+
+
+

+ comment_encuadernacion ?> +

+
+
+ + +
+ +
+
+
LOGISTICA
+
- - - - - - + + + + - - - - - - - - - - - - + + + +
TintasEjemplaresMaquinaMarcapaginasTiempoPeso UnidadPeso PedidoCajasCorte Pie
tinta() ?>tirada ?>maquina()->nombre ?>marcapaginas ? "SI" : "NO" ?>horas_maquina * 3600) ?>
formas)->maquina_ancho ?>xformas)->maquina_alto ?>ancho ?>xalto ?>papel_impresion ?>papel_impresion()->gramaje . " " . "gr" ?> gr 1000 ? number_format($peso_pedido / 1000, 2, ',', '.') . " kg" : number_format($peso_pedido, 2, ',', '.') . " gr" ?> --
-
-
Comentarios cubierta
-
+
+
+ +

+ comment_logistica ?>

-
- -
-
ENCUADERNACIÓN
-
-
;color:;"> - tarifa()->code ?? "" : "" ?> -
- - - - - - - - - - - - - - - - -
Plastificadotarifa()->nombre ?>UVI EXTERNO:
Meter datos de solapas y preparación guillotinaCORTE PIE:
- - $encuadernacion) { - $encuadernacion_code = $encuadernacion->tarifa()->code; - try { - if ($encuadernacion_code) { - echo view("/themes/vuexy/pdfs/encuadernados/$encuadernacion_code.php"); - } else { - echo view("/themes/vuexy/pdfs/encuadernados/default.php"); - } - } catch (\Throwable $th) { - $error_message = $th->getMessage(); - echo view("/themes/vuexy/pdfs/encuadernados/default.php"); - echo "No se ha podido renderizar la tabla de encuadernación"; - // echo "
$error_message"; - } - } - ?> - 0): ?> - -
-
Comentarios encuadernacion:
-
-

-

-
-
- - +
+ © 2024 SAFEKAT. Todos los derechos reservados.
-
-
-
LOGISTICA
-
- - - - - - - - - - - - - -
Peso UnidadPeso PedidoCajasCorte Pie
gr 1000 ? number_format($peso_pedido / 1000, 2, ',', '.') . " kg" : number_format($peso_pedido, 2, ',', '.') . " gr" ?> --
-
-
Comentarios logistica:
-
-

-

-
-
-
-
-
- © 2024 SAFEKAT. Todos los derechos reservados. -
- - - - - - - - - - +
+ + + + + + + + + \ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/pdfs/prototipo.php b/ci4/app/Views/themes/vuexy/pdfs/prototipo.php new file mode 100755 index 00000000..53f2a8fe --- /dev/null +++ b/ci4/app/Views/themes/vuexy/pdfs/prototipo.php @@ -0,0 +1,410 @@ +get('settings'); +?> + + + + + + + + + + + + + + + + + + +<?= $presupuesto->titulo ?>[OT:<?= $ot->id ?>] + + + + + +
id . "_" . $presupuesto->titulo ?>"> +
+
+
titulo ?>
+ format("d/m/Y H:i:s") ?> +
+
+ +
+
+
+ full_path): ?> + full_path)) : '/assets/img/portada_not_found.png' ?>" /> + + + + + +
+
;color:;"> +
+
+
;color:;"> + fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?> + Comercial: first_name . " " . $cliente->comercial()->last_name ?> +
+
+
+
+ ;color:;"> + + POD + presupuestoLineaImpresion()->isRotativa()): ?> + ROTATIVA + + GENERAL + + + + +
+
+
+ +
+
+
+
+ ;">fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?> +
+
+
+ + + + + + + + + + + + + + + + + + + + + +
IN
PORT.
ACABAD.
ENCUAD.
MANIPUL.
+
+ +
+
+
+
;color:;"> + +
+
+
+
;color:;"> + papel_impresion()->papel_code_ot ?> +
+
"> + +
+
;color:;"> + papel_impresion()->papel_code_ot ?> +
+
;color:;"> + tarifa()->code : "" ?> +
+ $acabado): ?> + tarifa()->isUVI()): ?> +
;color:white;"> + + tarifa()->code ?> +
+ + +
+
+
"> +
+
+ ;">id ?> +
+
+ barcode +
+ +
+
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
IDSK + +
CLIENTE + alias ?> +
TITULO + titulo ?> +
ISBNisbn ?>
PEDIDO CLIENTEid ?>
+
+
+
+ + + imposicion_esquema()): ?> + imposicion_esquema()->svg_schema ?> + + + +
+
+
+ + + + + +
Imposicionfull_name ?? "" ?>
+
+
+
+
+
+
IMP. INTERIOR
+
+
+ + + + + + + + + + + +
ancho ?>xalto ?> tirada/$presupuesto->tirada ?> tipo_presupuesto()?->codigo ?? "" ?> lomo_cubierta, 2, ',', '.') ?>
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
PáginasEjemplaresTintasFormasMáquinaClicsTiempo
paginas ?> tirada / $presupuesto->tirada ?> tinta() ?>formas)->formas ?>maquina()->nombre ?>rotativa_clicks_libro ?>horas_maquina * 3600 / $presupuesto->tirada) ?>
papel_impresion ?>papel_impresion()->gramaje . " " . "gr" ?> + isRotativa()): ?> + rotativa_metros_libro, 2, ',', '.') ?> metros + +
+
+
+
+
+

+ comment_interior ?> +

+
+
+
+
+ +
+
IMP. CUBIERTA
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
TintasEjemplaresMaquinaMarcapaginasTiempo
tinta() ?>tirada/$presupuesto->tirada ?>maquina()->nombre ?>marcapaginas ? "SI" : "NO" ?>horas_maquina * 3600/$presupuesto->tirada) ?>
formas)->maquina_ancho ?>xformas)->maquina_alto ?>ancho ?>xalto ?>papel_impresion ?>papel_impresion()->gramaje . " " . "gr" ?>
+
+
+ +
+

+ comment_cubierta ?> +

+
+
+
+ +
+ +
+
ACABADOS/ENCUADERNACIÓN
+
+
;color:;"> + +
+ + $acabado): ?> + + + + + + + + + + + + + + + + + +
Plastificadotarifa()->nombre ?>UVI EXTERNO:proveedor() ? $acabado->proveedor()->nombre : "" ?>
info_solapa_guillotina?>CORTE PIE:
+ + $encuadernacion) { + $encuadernacion_code = $encuadernacion->tarifa()->code; + try { + if ($encuadernacion_code) { + echo view("/themes/vuexy/pdfs/encuadernados/$encuadernacion_code.php", ["encuadernacion" => $encuadernacion]); + } else { + echo view("/themes/vuexy/pdfs/encuadernados/default.php", ["encuadernacion" => $encuadernacion]); + } + } catch (\Throwable $th) { + $error_message = $th->getMessage(); + echo "No se ha podido renderizar la tabla de encuadernación"; + // echo "
$error_message"; + } + } + ?> + 0): ?> + +
+
+
+

+ comment_encuadernacion ?> +

+
+
+ + +
+ +
+
+
LOGISTICA
+
+ + + + + + + + + + + +
Peso UnidadPeso PedidoCorte Pie
gr 1000 ? number_format($peso_unidad / 1000, 2, ',', '.') . " kg" : number_format($peso_unidad, 2, ',', '.') . " gr" ?> -
+
+
+ +
+

+ comment_logistica ?> +

+
+
+
+
+
+ © 2024 SAFEKAT. Todos los derechos reservados. +
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/httpdocs/assets/js/safekat/pages/configuracion/maquinista/maquinistaTareaList.js b/httpdocs/assets/js/safekat/pages/configuracion/maquinista/maquinistaTareaList.js index 9b964203..6e7dc076 100644 --- a/httpdocs/assets/js/safekat/pages/configuracion/maquinista/maquinistaTareaList.js +++ b/httpdocs/assets/js/safekat/pages/configuracion/maquinista/maquinistaTareaList.js @@ -11,9 +11,9 @@ class MaquinistaTareaList { { data: 'otId', searchable: false, sortable: false }, { data: 'tareaName', searchable: false, sortable: false }, { data: 'tareaEstado', searchable: false, sortable: false,render : this.renderStado.bind(this)}, - { data: 'presupuesto_titulo', searchable: false, sortable: false }, - { data: 'papel_impresion', searchable: false, sortable: false }, - { data: 'papel_gramaje', searchable: false, sortable: false }, + // { data: 'presupuesto_titulo', searchable: false, sortable: false }, + // { data: 'papel_impresion', searchable: false, sortable: false }, + // { data: 'papel_gramaje', searchable: false, sortable: false }, { data: 'fecha_impresion', searchable: false, sortable: false }, { data: 'action', searchable: false, sortable: false, width: "20rem" }, ] diff --git a/httpdocs/assets/js/safekat/pages/configuracion/maquinista/maquinistaTareaView.js b/httpdocs/assets/js/safekat/pages/configuracion/maquinista/maquinistaTareaView.js index b4e20735..eb2003af 100644 --- a/httpdocs/assets/js/safekat/pages/configuracion/maquinista/maquinistaTareaView.js +++ b/httpdocs/assets/js/safekat/pages/configuracion/maquinista/maquinistaTareaView.js @@ -1,6 +1,6 @@ import Ajax from '../../../components/ajax.js' -import { alertConfirmAction } from '../../../components/alerts/sweetAlert.js' +import { alertConfirmAction, alertError, alertSuccess } from '../../../components/alerts/sweetAlert.js' class MaquinistaTareaView { constructor(domItem) { this.item = domItem @@ -84,7 +84,7 @@ class MaquinistaTareaView { handleUpdateClickInputError(error) { popErrorAlert(error) } - updateContentClick(clicks){ + updateContentClick(clicks) { this.item.find('#clicks-info').empty().html(clicks) } handleDeleteTareaProgress() { @@ -155,11 +155,13 @@ class MaquinistaTareaView { window.location.href = '/produccion/ordentrabajo/maquinista/maquinas/view' } this.showBasedOnStatus(response.data.status) + alertSuccess(response.message, null, { position: 'top' }).fire() } this.actionLoader(false) } handleUpdateTareaProgressError(error) { popErrorAlert(error.error) + alertError(error.error, null, { position: 'top' }).fire() this.actionLoader(false) } diff --git a/httpdocs/assets/js/safekat/pages/pdf/otDownload.js b/httpdocs/assets/js/safekat/pages/pdf/otDownload.js index 69747833..da577046 100644 --- a/httpdocs/assets/js/safekat/pages/pdf/otDownload.js +++ b/httpdocs/assets/js/safekat/pages/pdf/otDownload.js @@ -1,7 +1,7 @@ $(() => { var opt = { margin: 2, - filename: "PDF_OrdenTrabajo_" + $(".pdf-wrapper").data("id") + ".pdf", + filename: $(".pdf-wrapper").data("id") + ".pdf", image: { type: 'jpeg', quality: 1 }, html2canvas: { scale: 4 }, jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' } diff --git a/httpdocs/assets/js/safekat/pages/produccion/ot.js b/httpdocs/assets/js/safekat/pages/produccion/ot.js index 0f1702f1..d0e6f7a7 100644 --- a/httpdocs/assets/js/safekat/pages/produccion/ot.js +++ b/httpdocs/assets/js/safekat/pages/produccion/ot.js @@ -28,15 +28,35 @@ class OrdenTrabajo { this.otEstado = this.item.find("#ot-estado"); this.datatableColumns = [ - { data: 'orden', searchable: true, sortable: true, render: this._renderOrdenTarea.bind(this), width: "10%" }, - { data: 'nombre', searchable: true, sortable: true, width: "20%" }, - { data: 'maquina_presupuesto_linea', searchable: true, sortable: true, width: "20%" }, - { data: 'maquina_tarea', searchable: false, sortable: false, render: this._renderMaquinaSelectTable.bind(this), width: "20%" }, - { data: 'imposicion', searchable: false, sortable: false, render: this._renderImposicionSelectTable.bind(this) }, + { data: 'orden', searchable: true, sortable: true, render: this._renderOrdenTarea.bind(this) }, + { data: 'nombre', searchable: true, sortable: true }, + { + data: 'maquina_presupuesto_linea', searchable: true, sortable: true, render: (d) => { + if (d) { + + return ` +
+ + +
+ ` + } else { + return ""; + } + + } + }, + { data: 'maquina_tarea', searchable: false, sortable: false, render: this._renderMaquinaSelectTable.bind(this), width: "10%" }, + { data: 'imposicion', searchable: false, sortable: false, render: this._renderImposicionSelectTable.bind(this), width: "10%" }, + { data: 'proveedor', searchable: false, sortable: false, render: this._renderProveedorSelectTable.bind(this), width: "10%" }, { data: 'tiempo_estimado', searchable: false, sortable: false }, { data: 'tiempo_real', searchable: false, sortable: false }, { - data: 'action', searchable: false, sortable: false, width: "10%", render: this._renderActionCell.bind(this) + data: 'action', searchable: false, sortable: false, width: "5%", render: this._renderActionCell.bind(this) }, ] @@ -76,27 +96,40 @@ class OrdenTrabajo { this.pendienteFerro = new DatePicker(this.otForm.find("#ot-pendiente-ferro"), option) this.ferroCliente = new DatePicker(this.otForm.find("#ot-ferro-cliente"), option) this.ferroOk = new DatePicker(this.otForm.find("#ot-ferro-ok"), option) - this.plakeneTraslucido = new DatePicker(this.otForm.find("#ot-plakene-traslucido"), option) + // this.plakeneTraslucido = new DatePicker(this.otForm.find("#ot-plakene-traslucido"), option) this.impresionColor = new DatePicker(this.otForm.find("#ot-impresion-color"), option) this.impresionBN = new DatePicker(this.otForm.find("#ot-impresion-bn"), option) + this.cubierta = new DatePicker(this.otForm.find("#ot-cubierta"), option) + this.sobrecubierta = new DatePicker(this.otForm.find("#ot-sobrecubierta"), option) + this.guarda = new DatePicker(this.otForm.find("#ot-guarda"), option) - this.portada = new DatePicker(this.otForm.find("#ot-portada"), option) - this.plastificadoMate = new DatePicker(this.otForm.find("#ot-plastificado-mate"), option) + + this.plastificado = new DatePicker(this.otForm.find("#ot-plastificado"), option) + this.plakene = new DatePicker(this.otForm.find("#ot-plakene"), option) + this.retractilado = new DatePicker(this.otForm.find("#ot-retractilado"), option) + this.estampado = new DatePicker(this.otForm.find("#ot-estampado"), option) + this.uvi = new DatePicker(this.otForm.find("#ot-uvi"), option) + + + + this.encuadernacion = new DatePicker(this.otForm.find("#ot-encuadernacion"), option) + + this.entradaManipulado = new DatePicker(this.otForm.find("#ot-manipulado"), option) this.prepGuillotina = new DatePicker(this.otForm.find("#ot-prep-guillotina"), option) + + this.prepCosido = new DatePicker(this.otForm.find("#ot-prep-cosido"), option) this.prepGrapado = new DatePicker(this.otForm.find("#ot-prep-grapado"), option) this.prepSolapa = new DatePicker(this.otForm.find("#ot-prep-solapa"), option) - this.prepPrototipo = new DatePicker(this.otForm.find("#ot-prep-prototipo"), option) + // this.prepPrototipo = new DatePicker(this.otForm.find("#ot-prep-prototipo"), option) this.prepMarcapaginas = new DatePicker(this.otForm.find("#ot-prep-marcapaginas"), option) - this.prepRetractilado = new DatePicker(this.otForm.find("#ot-prep-retractilado"), option) - this.prepRetractilado5 = new DatePicker(this.otForm.find("#ot-prep-retractilado5"), option) - this.espiral = new DatePicker(this.otForm.find("#ot-espiral"), option) + // this.espiral = new DatePicker(this.otForm.find("#ot-espiral"), option) this.embalaje = new DatePicker(this.otForm.find("#ot-embalaje"), option) this.envio = new DatePicker(this.otForm.find("#ot-envio"), option) @@ -115,6 +148,7 @@ class OrdenTrabajo { } eventTareas() { this.otForm.on("change", ".select-maquina-tarea-datatable", this.handleTareaChange.bind(this)) + this.otForm.on("change", ".select-proveedor-tarea-datatable", this.handleUpdateProveedor.bind(this)) this.otForm.on("change", ".orden-tarea", this.handleTareaChange.bind(this)) this.otForm.on("change", ".select-imposicion-tarea-datatable", this.handleTareaChange.bind(this)) this.otForm.on("click", ".increase-order", (event) => { @@ -133,6 +167,7 @@ class OrdenTrabajo { unbindEventTareas() { this.otForm.off("change", ".select-maquina-tarea-datatable") this.otForm.off("change", ".select-imposicion-tarea-datatable") + this.otForm.off("change", ".select-proveedor-tarea-datatable") this.otForm.off("change", ".orden-tarea") this.otForm.off("click", ".increase-order") this.otForm.off("click", ".decrease-order") @@ -153,7 +188,7 @@ class OrdenTrabajo { this.item.on("click", "#btn-reset-tareas", this.handleResetTareasDeleteConfirmation.bind(this)) this.otForm.on("click", ".ot-tarea-comment", this.handleNoteTarea.bind(this)) $("#btn-update-tarea-comment").on("click", this.handleTareaNoteSubmit.bind(this)) - this.otForm.on("change", "#ot-comment", this.handleOtComment.bind(this)) + this.otForm.on("change", ".ot-comment", this.handleOtComment.bind(this)) $("#btn-update-pliegos").on('click', this.handleUpdatePliegos.bind(this)) this._handleGetData() @@ -208,6 +243,16 @@ class OrdenTrabajo { return render } + _renderProveedorSelectTable(d, t) { + if (d.proveedor) { + let render = `` + return render + } else { + return ""; + } + } _renderActionCell(d, t) { let cell = `
@@ -222,7 +267,7 @@ class OrdenTrabajo { return `
- +
@@ -232,6 +277,10 @@ class OrdenTrabajo { } createSelectMaquinaTarea() { try { + $('.select-proveedor-tarea-datatable').each((index, element) => { + console.log(element) + this.createSelectProveedor($(element)) + }) this.summaryData.tasks.forEach(async (element) => { let selectItem = this.item.find("#select-maquina-tarea-" + element.id); if (element.presupuesto_linea_id && element.is_corte == false) this.createSelectMaquinaImpresion(selectItem) @@ -262,6 +311,7 @@ class OrdenTrabajo { } }); } catch (error) { + console.error(error) } finally { this.eventTareas() @@ -270,7 +320,7 @@ class OrdenTrabajo { } createSelectMaquinaAcabado(selectItem) { let maquina_id = selectItem.data("maquina-id") - let maquinaSelects = new ClassSelect(selectItem, `/tarifas/maquinas/acabado/select`, "Seleccione una maquina", true); + let maquinaSelects = new ClassSelect(selectItem, `/tarifas/maquinas/acabado/select`, "Seleccione un máquina", true); maquinaSelects.init(); if (maquina_id) { maquinaSelects.setVal(maquina_id) @@ -278,6 +328,24 @@ class OrdenTrabajo { maquinaSelects.reset() } } + createSelectProveedor(selectItem) { + try { + + + let proveedor_id = selectItem.data("proveedor-id") + let tipo = selectItem.data("proveedor-tipo") + let proveedorSelect = new ClassSelect(selectItem, `/compras/proveedores/getProveedores`, "Seleccione una proveedor", true, { tipo_id: tipo }, this.tareasTableItem); + proveedorSelect.init(); + if (proveedor_id) { + proveedorSelect.setVal(proveedor_id) + } else { + proveedorSelect.reset() + } + } catch (error) { + console.error(error) + + } + } createSelectMaquinaManipulado(selectItem) { let maquina_id = selectItem.data("maquina-id") let maquinaSelects = new ClassSelect(selectItem, `/tarifas/maquinas/manipulado/select`, "Seleccione una maquina", true); @@ -416,21 +484,33 @@ class OrdenTrabajo { this.ferroCliente.setDate(this.summaryData.dates.ferro_en_cliente_at) this.ferroOk.setDate(this.summaryData.dates.ferro_ok_at) // this.plakeneTraslucido.setDate(this.summaryData.dates.fecha_impresion_at) - this.impresionColor.setDate(this.summaryData.dates.interior_color_at) + /**IMPRESION */ this.impresionBN.setDate(this.summaryData.dates.interior_bn_at) - this.portada.setDate(this.summaryData.dates.cubierta_at) - this.plastificadoMate.setDate(this.summaryData.dates.plastificado_at) + this.impresionColor.setDate(this.summaryData.dates.interior_color_at) + this.cubierta.setDate(this.summaryData.dates.cubierta_at) + this.sobrecubierta.setDate(this.summaryData.dates.sobrecubierta_at) + this.guarda.setDate(this.summaryData.dates.guarda_at) + /**ACABADO */ + this.plastificado.setDate(this.summaryData.dates.plastificado_at) + this.plakene.setDate(this.summaryData.dates.plakene_at) + this.retractilado.setDate(this.summaryData.dates.retractilado_at) + this.estampado.setDate(this.summaryData.dates.estampado_at) + this.uvi.setDate(this.summaryData.dates.uvi_at) + /** ENCUADERNACION */ + this.encuadernacion.setDate(this.summaryData.dates.encuadernacion_at) + this.prepGuillotina.setDate(this.summaryData.dates.corte_at) - this.prepCosido.setDate(this.summaryData.dates.cosido_at) - this.prepSolapa.setDate(this.summaryData.dates.solapa_at) - this.prepGrapado.setDate(this.summaryData.dates.grapado_at) - this.prepPrototipo.setDate(this.summaryData.dates.prototipo_at) + this.entradaManipulado.setDate(this.summaryData.dates.entrada_manipulado_at) + + // this.prepCosido.setDate(this.summaryData.dates.cosido_at) + // this.prepSolapa.setDate(this.summaryData.dates.solapa_at) + // this.prepGrapado.setDate(this.summaryData.dates.grapado_at) + + // this.prepPrototipo.setDate(this.summaryData.dates.prototipo_at) this.prepMarcapaginas.setDate(this.summaryData.dates.marcapaginas_at) - this.prepRetractilado.setDate(this.summaryData.dates.retractilado_at) - this.prepRetractilado5.setDate(this.summaryData.dates.retractilado5_at) - this.espiral.setDate(this.summaryData.dates.fecha_impresion_at) + // this.espiral.setDate(this.summaryData.dates.fecha_impresion_at) this.embalaje.setDate(this.summaryData.dates.embalaje_at) this.envio.setDate(this.summaryData.dates.envio_at) this.pedidoEnEsperaCheck.prop("checked", this.summaryData.ot.is_pedido_espera); @@ -485,17 +565,18 @@ class OrdenTrabajo { } handleTareaChangeError(error) { } handleOtComment(event) { + let name = $(event.currentTarget).attr("name") + let data = { + "orden_trabajo_id": this.modelId, + "name": name, + } + data[name] = $(event.currentTarget).val() const ajax = new Ajax( "/produccion/ordentrabajo/update", - { - "orden_trabajo_id": this.modelId, - "name": $(event.currentTarget).attr("name"), - "comentarios": $(event.currentTarget).val() - }, + data, null, (response) => { - this._handleGetData(); alertSuccess(response.message).fire() }, null @@ -864,6 +945,24 @@ class OrdenTrabajo { ajax.post() } + handleUpdateProveedor(event) { + let orden_trabajo_tarea_id = $(event.currentTarget).data('id') + let actualValue = $(event.currentTarget).val() + let ajax = new Ajax(`/produccion/ordentrabajo/update/tarea/proveedor`, + { + orden_trabajo_tarea_id: orden_trabajo_tarea_id, + proveedor_id: actualValue + }, + null, + (response) => { + alertSuccess(response.message).fire() + }, + (error) => { + alertError(error.message).fire() + }) + ajax.post() + } + } diff --git a/httpdocs/themes/vuexy/css/maquinista.css b/httpdocs/themes/vuexy/css/maquinista.css index 36a99d28..61ac1780 100644 --- a/httpdocs/themes/vuexy/css/maquinista.css +++ b/httpdocs/themes/vuexy/css/maquinista.css @@ -5,5 +5,5 @@ font-size : 20px; } .table-maquinista td{ - height : 10rem; + height : 7rem; } \ No newline at end of file diff --git a/httpdocs/themes/vuexy/css/pdf.ot.css b/httpdocs/themes/vuexy/css/pdf.ot.css index f7da222a..1a4dd39a 100644 --- a/httpdocs/themes/vuexy/css/pdf.ot.css +++ b/httpdocs/themes/vuexy/css/pdf.ot.css @@ -18,7 +18,7 @@ html { width: 210mm; height: 297mm; max-width: 210mm; - font-size: 11px; + font-size: 8px; max-height: 297mm; background-color: white; } @@ -91,7 +91,7 @@ body { } .section-title { font-weight: bold; - margin-bottom: 10px; + margin-bottom: 4px; } .cubierta { color: #007bff; @@ -105,31 +105,29 @@ body { .comments { color: #555; font-style: italic; + font-size : 12px; margin-top: 0.2rem; } .comment-content { - line-height: 0; width: 100%; - height: 50px; - border: solid; - border-width: 1px; + margin-left : 0.2rem; + font-style: normal; + color : black; + font-size: 10px; } table { width: 100%; - margin-bottom: 5px; + margin-bottom: 2px; font-size: 10px; } - +th, td { + border: 0.01px solid black; +} table td { text-align: center; } -table, -th, -td { - border: 0.1px solid rgb(0, 0, 0); - border-collapse: collapse; -} + table th { font-weight: bold; @@ -139,11 +137,7 @@ table th { table td { font-weight: bold; } -.comments { - color: #555; - font-style: italic; - margin-top: 0.2rem; -} + .t-header { color: black; width: 25%;