This commit is contained in:
amazuecos
2024-12-15 16:07:54 +01:00
parent 71157bfda5
commit d5719b70a1
31 changed files with 970 additions and 502 deletions

View File

@ -15,256 +15,57 @@ class OrdenTrabajoTable extends Migration
],
"pedido_id" => [
"type" => "INT",
"constraint" => 10,
"comment" => "Pedido asociado",
"unsigned" => true,
"constraint" => 16,
"comment" => "Pedido original asociado",
],
"user_created_id" => [
"type" => "INT",
"unsigned" => true,
"constraint" => 10,
"comment" => "Usuario que ha pasado el pedido a producción",
],
"user_update_id" => [
"user_updated_id" => [
"type" => "INT",
"unsigned" => true,
"constraint" => 10,
"comment" => "Usuario que ha actualizado la orden de trabajo",
],
"maquina_orden_negro_id" => [
"type" => "INT",
"constraint" => 10,
"null" => true,
"comment" => "Maquina para impresion en negro",
],
"maquina_orden_color_id" => [
"type" => "INT",
"constraint" => 10,
"null" => true,
"comment" => "Maquina para impresion en color",
],
"maquina_orden_portada_id" => [
"type" => "INT",
"constraint" => 10,
"null" => true,
"comment" => "Maquina para impresion portada",
],
"maquina_orden_cubierta_id" => [
"type" => "INT",
"constraint" => 10,
"null" => true,
"comment" => "Maquina para impresion cubierta",
],
"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" => [
"total_tirada" => [
"type" => "DOUBLE",
"null" => true
],
"color_pliegos_pedido" => [
"total_precio" => [
"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"
"default" => "out",
"comment" => "Tipo de entrada"
],
"fecha_entrega_real_warning" => [
"type" => "BOOLEAN",
"default" => false,
],
"fecha_entrega_warning" => [
"type" => "BOOLEAN",
"default" => false
],
"fecha_entrega_warning_revised" => [
"type" => "BOOLEAN",
"default" => false
],
"ferro_disponible" => [
"type" => "TINYINT",
"constraint" => 4,
],
"ferro_disponible_thread_id" => [
"type" => "INT",
"constraint" => 10,
],
"ferro_cp" => [
"type" => "VARCHAR",
"constraint" => 10,
"null" => true
],
"ferro_proveedor" => [
"type" => "INT",
"unsigned" => true,
"constraint" => 10,
],
"ferro_tracking" => [
"type" => "VARCHAR",
"constraint" => 100,
"null" => true,
],
"pre_formato" => [
"type" => "BOOLEAN",
"default" => false
],
"pre_lomo" => [
"type" => "BOOLEAN",
"default" => 0,
],
"pre_solapa" => [
"type" => "BOOLEAN",
"default" => 0,
],
"pre_isbn" => [
"type" => "BOOLEAN",
"default" => 0,
],
"pre_codbarras" => [
"type" => "BOOLEAN",
"default" => 0,
],
"pre_imposicion" => [
"type" => "BOOLEAN",
"default" => 0,
],
"pre_imprimir" => [
"type" => "BOOLEAN",
"default" => 0,
],
"pre_faltan_materiales" => [
"type" => "BOOLEAN",
"default" => 0,
],
"pre_faltan_materiales_note" => [
"type" => "TEXT",
"null" => true,
],
"progreso" => [
"type" => "DOUBLE",
"default" => 0.00,
"comment" => "Progreso de 0 a 100"
],
"message_production_send" => [
"type" => "BOOLEAN",
"default" => 0,
],
"finalizado" => [
"type" => "BOOLEAN",
"default" => 0,
"estado" => [
"type" => "ENUM",
"constraint" => ["I","F","P","E"],
"default" => "I",
"comment" => "I => INICIADO, F => FINALIZADO, P => PROGRESO , E => ERROR"
],
"comentarios" => [
"type" => "TEXT",
"null" => true,
"default" => null,
"comment" => "Comentarios orden de trabajo"
]
];
public function up()
@ -289,10 +90,10 @@ class OrdenTrabajoTable extends Migration
],
]);
$this->forge->addPrimaryKey("id");
// $this->forge->addForeignKey(["maquina_orden_portada_id"],"lg_maquinas",["id"]);
// $this->forge->addForeignKey(["maquina_orden_negro_id"],"lg_maquinas",["id"]);
// $this->forge->addForeignKey(["maquina_orden_cubierta_id"],"lg_maquinas",["id"]);
// $this->forge->addForeignKey(["maquina_orden_color_id"],"lg_maquinas",["id"]);
$this->forge->addForeignKey("pedido_id","pedidos","id");
$this->forge->addForeignKey("user_created_id","users","id");
$this->forge->addForeignKey("user_updated_id","users","id");
$this->forge->createTable("ordenes_trabajo", true);
}

View File

@ -11,17 +11,60 @@ class OrdenTrabajoTareasTable extends Migration
"id" => [
"type" => "INT",
"unsigned" => true,
"autoincrement" => true
],
"tarea_servicio_id" => [
"type" => "INT",
"unsigned" => true,
"auto_increment" => true
],
"orden_trabajo_id" => [
"type" => "INT",
"unsigned" => true,
"constraint" => 10,
"comment" => "Orden de trabajo a la que pertenece esta tarea",
],
"presupuesto_linea_id" => [
"type" => "INT",
"unsigned" => true,
"constraint" => 10,
"null" => true,
"comment" => "Presupuesto linea asociada a esta tarea. Puede ser NULL porque se podría añadir una tarea manual",
],
"nombre" => [
"type" => "VARCHAR",
"constraint" => 255,
"comment" => "Nombre de la tarea",
],
"orden" => [
"type" => "INT",
"unsigned" => true,
"comment" => "Orden de ejecución del tarea. Por defecto el orden será la de la máquina asociada a la línea de presupuesto."
],
"maquina_id" =>
[
"type" => "INT",
"unsigned" => true,
"constraint" => 10,
"null" => true,
"comment" => "Máquina asociada a la tarea. Por defecto será la asociada a la linea de presupuesto"
],
"imposicion_id" => [
"type" => "INT",
"null" => true,
"constraint" => 11,
"default" => null,
"comment" => "Imposicion aplicada a la tarea. Default null"
],
"tiempo_estimado" => [
"type" => "DOUBLE",
"default" => 0.00,
"null" => true,
"comment" => "Tiempo ejecución estimado de la tarea en minutos",
],
"tiempo_real" => [
"type" => "DOUBLE",
"default" => 0.00,
"null" => true,
"comment" => "Tiempo ejecución real de la tarea",
]
];
public function up()
{
@ -43,14 +86,17 @@ class OrdenTrabajoTareasTable extends Migration
"null" => true,
],
]);
// $this->forge->addPrimaryKey("id");
// $this->forge->addForeignKey("orden_trabajo_id","ordenes_trabajo","id");
// $this->forge->addForeignKey("tarea_servicio_id","tareas_servicio","id");
$this->forge->createTable("orden_trabajo_tareas", true);
$this->forge->addPrimaryKey("id");
$this->forge->addForeignKey("orden_trabajo_id","ordenes_trabajo","id","CASCADE","CASCADE");
$this->forge->addForeignKey("presupuesto_linea_id","presupuesto_linea","id");
$this->forge->addForeignKey("imposicion_id","lg_imposiciones","id");
$this->forge->addForeignKey("maquina_id","lg_maquinas","id");
$this->forge->createTable("orden_trabajo_tareas");
}
public function down()
{
$this->forge->dropTable("orden_trabajo_tareas");
$this->forge->dropTable("orden_trabajo_tareas",true);
}
}

View File

@ -8,6 +8,10 @@ use CodeIgniter\Database\RawSql;
class OrdenTrabajoDatesTable extends Migration
{
protected array $COLUMNS = [
"orden_trabajo_id" => [
"type" => "INT",
"unsigned" => true,
],
"fecha_entrada_at" => [
"type" => "DATETIME",
"null" => true,
@ -33,11 +37,11 @@ class OrdenTrabajoDatesTable extends Migration
"type" => "DATE",
"null" => true,
],
"fecha_encuardernado_at" => [
"fecha_encuadernado_at" => [
"type" => "DATE",
"null" => true,
],
"fecha_externo_at" => [
"fecha_entrega_externo" => [
"type" => "DATE",
"null" => true,
],
@ -161,6 +165,8 @@ class OrdenTrabajoDatesTable extends Migration
"null" => true,
],
]);
$this->forge->addPrimaryKey('orden_trabajo_id');
$this->forge->addForeignKey("orden_trabajo_id","ordenes_trabajo","id","CASCADE","CASCADE");
$this->forge->createTable("orden_trabajo_dates", true);
}