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);
}