diff --git a/app/controllers/finance/balancing_controller.rb b/app/controllers/finance/balancing_controller.rb index 30d907d3..d2292d9a 100644 --- a/app/controllers/finance/balancing_controller.rb +++ b/app/controllers/finance/balancing_controller.rb @@ -34,9 +34,9 @@ class Finance::BalancingController < ApplicationController ) if params[:sort] == "order_number" - @articles = @articles.sort { |a,b| a.article.order_number.gsub(/[a-zA-Z]/, "").to_i <=> b.article.order_number.gsub(/[a-zA-Z]/, "").to_i } + @articles = @articles.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" - @articles = @articles.sort { |a,b| b.article.order_number.gsub(/[a-zA-Z]/, "").to_i <=> a.article.order_number.gsub(/[a-zA-Z]/, "").to_i } + @articles = @articles.sort { |a,b| b.article.order_number.gsub(/[^[:digit:]]/, "").to_i <=> a.article.order_number.gsub(/[^[:digit:]]/, "").to_i } end view = params[:view] diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index a13790d8..3461e105 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -47,8 +47,8 @@ %p %b= @ordergroup.name | - Kontostand: - = number_to_currency(@ordergroup.account_balance) + Verfügbares Guthaben: + = number_to_currency(@ordergroup.get_available_funds()) %span{:style => "color:grey"} (zuletzt aktualisiert vor = distance_of_time_in_words(Time.now, @ordergroup.account_updated) + "(n))" diff --git a/app/views/home/ordergroup.html.erb b/app/views/home/ordergroup.html.erb index 8f23abfb..d8f772fb 100644 --- a/app/views/home/ordergroup.html.erb +++ b/app/views/home/ordergroup.html.erb @@ -5,7 +5,7 @@

Beschreibung: <%=h @ordergroup.description %> <%= link_to '(ändern)', :controller => 'foodcoop', :action => 'edit_group', :id => @ordergroup %>

-

Kontostand: <%= number_to_currency(@ordergroup.account_balance) %>

+

Verfügbares Guthaben: <%= number_to_currency(@ordergroup.get_available_funds()) %>

Personen