Deactivated broken links in balancing.
This commit is contained in:
parent
c49edb79a2
commit
6bd4bbec86
5 changed files with 34 additions and 35 deletions
|
@ -27,25 +27,21 @@ class Finance::BalancingController < ApplicationController
|
||||||
sort = "id"
|
sort = "id"
|
||||||
end
|
end
|
||||||
|
|
||||||
@articles = @order.order_articles.ordered.find(
|
@articles = @order.order_articles.ordered.includes(:article).order(sort)
|
||||||
:all,
|
|
||||||
:include => :article,
|
|
||||||
:order => sort
|
|
||||||
)
|
|
||||||
|
|
||||||
if params[:sort] == "order_number"
|
if params[:sort] == "order_number"
|
||||||
@articles = @articles.sort { |a,b| a.article.order_number.gsub(/[^[:digit:]]/, "").to_i <=> b.article.order_number.gsub(/[^[:digit:]]/, "").to_i }
|
@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"
|
elsif params[:sort] == "order_number_reverse"
|
||||||
@articles = @articles.sort { |a,b| b.article.order_number.gsub(/[^[:digit:]]/, "").to_i <=> a.article.order_number.gsub(/[^[:digit:]]/, "").to_i }
|
@articles = @articles.to_a.sort { |a,b| b.article.order_number.gsub(/[^[:digit:]]/, "").to_i <=> a.article.order_number.gsub(/[^[:digit:]]/, "").to_i }
|
||||||
end
|
end
|
||||||
|
|
||||||
view = params[:view]
|
view = params[:view]
|
||||||
params[:view] = nil
|
params[:view] = nil
|
||||||
|
|
||||||
case view
|
case view.try(:to_sym)
|
||||||
when 'editResults'
|
when 'editResults'
|
||||||
render :partial => 'edit_results_by_articles' and return
|
render :partial => 'edit_results_by_articles' and return
|
||||||
when 'groupsOverview'
|
when :groups_overview
|
||||||
render :partial => 'shared/articles_by_groups', :locals => {:order => @order} and return
|
render :partial => 'shared/articles_by_groups', :locals => {:order => @order} and return
|
||||||
when 'articlesOverview'
|
when 'articlesOverview'
|
||||||
render :partial => 'shared/articles_by_articles', :locals => {:order => @order} and return
|
render :partial => 'shared/articles_by_articles', :locals => {:order => @order} and return
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
%p{:style => "float:left"}
|
%p{:style => "float:left"}
|
||||||
%b Lieferung bearbeiten
|
%b Lieferung bearbeiten
|
||||||
%p{:style => "float:right"}
|
%p{:style => "float:right"}
|
||||||
= remote_link_to "Artikel hinzufügen", :url => {:action => "new_order_article", :id => @order}
|
/= remote_link_to "Artikel hinzufügen", :url => {:action => "new_order_article", :id => @order}
|
||||||
|
|
||||||
%table{:class => "ordered_articles", :style => "clear:both"}
|
%table{:class => "ordered_articles", :style => "clear:both"}
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th[sort_td_class_helper("name")]{:colspan => "1"}
|
%th{colspan: "1", class: sort_td_class_helper("name")}
|
||||||
= sort_link_helper "Artikel", "name", :action => "new", :remote => false
|
= sort_link_helper "Artikel", "name"
|
||||||
%th[sort_td_class_helper "order_number"]
|
%th{class: sort_td_class_helper("order_number")}
|
||||||
= sort_link_helper "Nr.", "order_number", :action => "new", :remote => false
|
= sort_link_helper "Nr.", "order_number"
|
||||||
%th Menge
|
%th Menge
|
||||||
%th GebGr * Einheit
|
%th GebGr * Einheit
|
||||||
%th Netto
|
%th Netto
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
%td Einheiten
|
%td Einheiten
|
||||||
%td Gesamtpreis
|
%td Gesamtpreis
|
||||||
%td{:colspan => "3",:style => "width:14em"}
|
%td{:colspan => "3",:style => "width:14em"}
|
||||||
= remote_link_to '[Gruppe hinzufügen]', :url => {:action => "new_group_order_article", :id => order_article}
|
= link_to '[Gruppe hinzufügen]', '#'
|
||||||
|
/:url => {:action => "new_group_order_article", :id => order_article}
|
||||||
%tbody
|
%tbody
|
||||||
- for group_order_article in order_article.group_order_articles.ordered.all(:include => [:group_order])
|
- for group_order_article in order_article.group_order_articles.ordered.all(:include => [:group_order])
|
||||||
%tr{:class => cycle('even', 'odd', :name => 'results')}[group_order_article]
|
%tr{:class => cycle('even', 'odd', :name => 'results')}[group_order_article]
|
||||||
|
@ -16,18 +17,19 @@
|
||||||
= group_order_article.group_order.ordergroup.name
|
= group_order_article.group_order.ordergroup.name
|
||||||
%td{:id => "group_order_article_#{group_order_article.id}_quantity", :style => "white-space:nowrap"}
|
%td{:id => "group_order_article_#{group_order_article.id}_quantity", :style => "white-space:nowrap"}
|
||||||
= group_order_article.result
|
= group_order_article.result
|
||||||
= button_to_remote( "+", :url => {:action => "update_group_order_article_result", :id => group_order_article, :modifier => '+'}, :html => {:style => "float:left"}, :success => "Element.hide('loader');", :before => "Element.show('loader');")
|
/= button_to_remote( "+", :url => {:action => "update_group_order_article_result", :id => group_order_article, :modifier => '+'}, :html => {:style => "float:left"}, :success => "Element.hide('loader');", :before => "Element.show('loader');")
|
||||||
= button_to_remote( "-", :url => {:action => "update_group_order_article_result", :id => group_order_article, :modifier => '-'}, :success => "Element.hide('loader');", :before => "Element.show('loader');")
|
/= button_to_remote( "-", :url => {:action => "update_group_order_article_result", :id => group_order_article, :modifier => '-'}, :success => "Element.hide('loader');", :before => "Element.show('loader');")
|
||||||
%td.currency
|
%td.currency
|
||||||
= number_to_currency(group_order_article.order_article.price.fc_price * group_order_article.result, :unit => "")
|
= number_to_currency(group_order_article.order_article.price.fc_price * group_order_article.result, :unit => "")
|
||||||
%td.actions{:style=>"width:1em"}
|
%td.actions{:style=>"width:1em"}
|
||||||
= remote_link_to icon(:edit), :update => 'edit_box', |
|
= link_to icon(:edit), '#'
|
||||||
:url => {:action => 'edit_group_order_article', :id => group_order_article}, |
|
/:update => 'edit_box', |
|
||||||
:success => "Element.hide('loader'); Element.show('edit_box')" |
|
/:url => {:action => 'edit_group_order_article', :id => group_order_article}, |
|
||||||
|
/:success => "Element.hide('loader'); Element.show('edit_box')" |
|
||||||
%td.actions{:style=>"width:1em"}
|
%td.actions{:style=>"width:1em"}
|
||||||
= remote_link_to icon(:delete), |
|
= link_to icon(:delete), '#'
|
||||||
:url => {:action => 'destroy_group_order_article', :id => group_order_article}, |
|
/:url => {:action => 'destroy_group_order_article', :id => group_order_article}, |
|
||||||
:confirm => 'Bist du sicher?', :method => 'post' |
|
/:confirm => 'Bist du sicher?', :method => 'post' |
|
||||||
%td
|
%td
|
||||||
%tfoot
|
%tfoot
|
||||||
%tr{:class => cycle('even', 'odd', :name => 'results')}
|
%tr{:class => cycle('even', 'odd', :name => 'results')}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%td.closed
|
%td.closed
|
||||||
= link_to_function order_article.article.name, |
|
= link_to order_article.article.name, '#'
|
||||||
"Element.toggle('group_order_articles_#{order_article.id}'); |
|
/"Element.toggle('group_order_articles_#{order_article.id}'); |
|
||||||
Element.toggleClassName(this.up('td'), 'open')" |
|
/Element.toggleClassName(this.up('td'), 'open')" |
|
||||||
%td= order_article.article.order_number
|
%td= order_article.article.order_number
|
||||||
%td
|
%td
|
||||||
= order_article.units_to_order
|
= order_article.units_to_order
|
||||||
|
@ -21,9 +21,10 @@
|
||||||
%td= order_article.price.tax
|
%td= order_article.price.tax
|
||||||
%td= order_article.price.deposit
|
%td= order_article.price.deposit
|
||||||
%td
|
%td
|
||||||
= remote_link_to icon(:edit), |
|
= link_to icon(:edit), '#'
|
||||||
:url => {:action => 'edit_order_article', :id => order_article} |
|
/:url => {:action => 'edit_order_article', :id => order_article} |
|
||||||
%td
|
%td
|
||||||
= remote_link_to icon(:delete), :confirm => 'Bist du sicher?', |
|
= link_to icon(:delete), '#'
|
||||||
:url => {:action => 'destroy_order_article', :id => order_article}, |
|
/:confirm => 'Bist du sicher?'
|
||||||
:method => :post |
|
/:url => {:action => 'destroy_order_article', :id => order_article},
|
||||||
|
/:method => :post
|
||||||
|
|
|
@ -46,11 +46,11 @@
|
||||||
.box_title
|
.box_title
|
||||||
#editOrderNav
|
#editOrderNav
|
||||||
%ul
|
%ul
|
||||||
%li= remote_link_to 'Gruppenübersicht', :update => 'results', :url => {:action => 'new', :id => @order, :view => 'groupsOverview'}
|
%li= link_to 'Gruppenübersicht', new_finance_order_path(@order, view: :groups_overview)
|
||||||
%li= remote_link_to 'Artikelübersicht', :update => 'results', :url => {:action => 'new', :id => @order, :view => 'articlesOverview'}
|
/%li= remote_link_to 'Artikelübersicht', :update => 'results', :url => {:action => 'new', :id => @order, :view => 'articlesOverview'}
|
||||||
%li= remote_link_to 'Bestellung bearbeiten', :update => 'results', :url => {:action => 'new', :id => @order, :view => 'editResults'}
|
/%li= remote_link_to 'Bestellung bearbeiten', :update => 'results', :url => {:action => 'new', :id => @order, :view => 'editResults'}
|
||||||
.column_content
|
.column_content
|
||||||
#results
|
#results
|
||||||
/= render :partial => 'edit_results_by_articles'
|
= render :partial => 'edit_results_by_articles'
|
||||||
%p= link_to_top
|
%p= link_to_top
|
||||||
#edit_box{:style => 'display:none'}
|
#edit_box{:style => 'display:none'}
|
Loading…
Reference in a new issue