diff --git a/app/controllers/finance/balancing_controller.rb b/app/controllers/finance/balancing_controller.rb index 8f40a01..18031db 100644 --- a/app/controllers/finance/balancing_controller.rb +++ b/app/controllers/finance/balancing_controller.rb @@ -21,10 +21,9 @@ def new sort = "id" end - @articles = @order.order_articles.ordered.includes(:order, :article, :article_price, + @articles = @order.order_articles.ordered.includes(:order, :article_price, group_order_articles: {group_order: :ordergroup}).order(sort) - if params[:sort] == "order_number" @articles = @articles.to_a.sort { |a,b| a.article.order_number.gsub(/[^[:digit:]]/, "").to_i <=> b.article.order_number.gsub(/[^[:digit:]]/, "").to_i } elsif params[:sort] == "order_number_reverse"