diff --git a/ci4/app/Database/Migrations/2024-10-06-085437_OrdenTrabajoTable.php b/ci4/app/Database/Migrations/2024-10-06-085437_OrdenTrabajoTable.php new file mode 100644 index 00000000..2c861651 --- /dev/null +++ b/ci4/app/Database/Migrations/2024-10-06-085437_OrdenTrabajoTable.php @@ -0,0 +1,449 @@ + [ + "type" => "INT", + "unsigned" => true, + "auto_increment" => true + ], + "pedido_id" => [ + "type" => "INT", + "constraint" => 10, + "comment" => "Pedido asociado", + ], + "user_created_id" => [ + "type" => "INT", + "constraint" => 10, + ], + "user_update_id" => [ + "type" => "INT", + "constraint" => 10, + ], + "maquina_orden_negro_id" => [ + "type" => "INT", + "constraint" => 10, + "null" => true + ], + "maquina_orden_color_id" => [ + "type" => "INT", + "constraint" => 10, + "null" => true + + ], + "maquina_orden_portada_id" => [ + "type" => "INT", + "constraint" => 10, + "null" => true + + ], + "maquina_orden_cubierta_id" => [ + "type" => "INT", + "constraint" => 10, + "null" => true + + ], + "negro_forma_id" => [ + "type" => "INT", + "constraint" => 10, + "null" => true + + ], + "color_forma_id" => [ + "type" => "INT", + "constraint" => 10, + "null" => true + + ], + "portada_forma_id" => [ + "type" => "INT", + "constraint" => 10, + "null" => true + + ], + "cubierta_forma_id" => [ + "type" => "INT", + "constraint" => 10, + "null" => true + + ], + "tirada" => [ + "type" => "DOUBLE", + ], + "negro_pliegos_pedido" => [ + "type" => "DOUBLE", + "null" => true + ], + "color_pliegos_pedido" => [ + "type" => "DOUBLE", + "null" => true + ], + "portada_pliegos_pedido" => [ + "type" => "DOUBLE", + "null" => true + ], + "cubierta_pliegos_pedido" => [ + "type" => "DOUBLE", + "null" => true + ], + "negro_clicks_pedido" => [ + "type" => "DOUBLE", + ], + "color_clicks_pedido" => [ + "type" => "DOUBLE", + ], + "portada_clicks_pedido" => [ + "type" => "DOUBLE", + ], + "cubierta_clicks_pedido" => [ + "type" => "DOUBLE", + ], + "pliegos1" => [ + "type" => "INT", + "constraint" => 11, + ], + "paginas1" => [ + "type" => "INT", + "constraint" => 11, + ], + "pliegos2" => [ + "type" => "INT", + "constraint" => 11, + ], + "paginas2" => [ + "type" => "INT", + "constraint" => 11, + ], + "negro_proveedor_nombre" => [ + "type" => "VARCHAR", + "constraint" => 225 + ], + "color_proveedor_nombre" => [ + "type" => "VARCHAR", + "constraint" => 225 + ], + "portada_proveedor_nombre" => [ + "type" => "VARCHAR", + "constraint" => 225 + ], + "corte_pie" => [ + "type" => "DOUBLE", + ], + "lomo" => [ + "type" => "INT", + "constraint" => 11, + "null" => true, + ], + "tipo_entrada" => [ + "type" => "ENUM", + "constraint" => ["in", "out"], + "default" => "out" + ], + "fecha_entrada_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "fecha_entrega_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "fecha_entrega_change_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "fecha_entrega_change_user_id" =>[ + "type" => "INT", + "constraint" => 11, + "null" => true, + + ], + "fecha_entrega_real_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "fecha_entrega_real_warning" => [ + "type" => "BOOLEAN", + "default" => false, + ], + "fecha_impresion_at" => [ + "type" => "DATE", + "null" => true, + ], + "fecha_encuardernado_at" => [ + "type" => "DATE", + "null" => true, + ], + "fecha_externo_at" => [ + "type" => "DATE", + "null" => true, + ], + "fecha_entrega_warning" => [ + "type" => "BOOLEAN", + "default" => false + ], + "fecha_entrega_warning_revised" => [ + "type" => "BOOLEAN", + "default" => false + ], + "inaplazable_revised_change_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "pendiente_ferro_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "ferro_en_cliente_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "ferro_ok_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "interior_bn_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "interior_color_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "preparacion_interiores_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "cubierta_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "plastificado_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "encuadernacion_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "corte_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "embalaje_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "envio_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "entrada_manipulado_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "ferro_disponible" => [ + "type" => "TINYINT", + "constraint" => 4, + ], + "ferro_disponible_thread_id" => [ + "type" => "INT", + "constraint" => 10, + ], + "ferro_disponible_hecho_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "ferro_disponible_hecho_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "ferro_disponible_ok_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "ferro_disponible_ok_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "ferro_entregado_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "ferro_entregado_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "pendiente_ferro_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "ferro_en_cliente_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "ferro_ok_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "ferro_cp" => [ + "type" => "VARCHAR", + "constraint" => 10, + "null" => true + ], + "ferro_proveedor" => [ + "type" => "INT", + "unsigned" => true, + "constraint" => 10, + ], + "ferro_tracking" => [ + "type" => "VARCHAR", + "constraint" => 100, + "null" => true, + ], + "interior_bn_user_id" => [ + "type" => "INT", + "constraint" => 10, + ], + "interior_color_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "preparacion_interior_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "cubierda_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "plastificado_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "encuadernacion_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "corte_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "embalaje_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "envio_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "entrada_manipulado_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "pre_formato" => [ + "type" => "BOOLEAN", + "default" => false + ], + "pre_formato_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "pre_formato_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "pre_lomo" => [ + "type" => "BOOLEAN", + "default" => 0, + ], + "pre_lomo_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "pre_lomo_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "pre_solapa" => [], + "pre_solapa_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "pre_solapa_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "pre_isbn" => [], + "pre_isbn_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "pre_codbarras" => [], + "pre_codbarras_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "pre_codbarras_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "pre_imposicion" => [], + "pre_imposicion_at" => [ + "type" => "DATETIME", + "null" => true, + ], + "pre_imposicion_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "pre_imprimir" => [], + "pre_imprimir_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "pre_faltan_materiales" => [], + "pre_imprimir_user_id" => [ + "type" => "INT", + "constraint" => 11, + ], + "pre_faltan_materiales_note" => [], + "progreso" => [], + "message_production_send" => [], + "finalizado" => [], + "comentarios" => [] + ]; + public function up() + { + $this->forge->addField($this->COLUMNS); + $currenttime = new RawSql("CURRENT_TIMESTAMP"); + $this->forge->addField([ + "created_at" => [ + "type" => "TIMESTAMP", + "default" => $currenttime, + + ], + "updated_at" => [ + "type" => "TIMESTAMP", + "null" => true, + + ], + "deleted_at" => [ + "type" => "TIMESTAMP", + "null" => true, + + ], + ]); + $this->forge->createTable("ots", true); + } + + public function down() + { + $this->forge->dropTable("ots"); + } +} diff --git a/ci4/app/Models/OrdenTrabajo/OrdenTrabajoModel.php b/ci4/app/Models/OrdenTrabajo/OrdenTrabajoModel.php new file mode 100644 index 00000000..72128ba2 --- /dev/null +++ b/ci4/app/Models/OrdenTrabajo/OrdenTrabajoModel.php @@ -0,0 +1,152 @@ +