Made sort by order_number balancing view work.
This commit is contained in:
parent
596f5657bc
commit
30aa04b710
1 changed files with 6 additions and 0 deletions
|
@ -33,6 +33,12 @@ class Finance::BalancingController < ApplicationController
|
||||||
:order => sort
|
:order => sort
|
||||||
)
|
)
|
||||||
|
|
||||||
|
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 }
|
||||||
|
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 }
|
||||||
|
end
|
||||||
|
|
||||||
view = params[:view]
|
view = params[:view]
|
||||||
params[:view] = nil
|
params[:view] = nil
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue