Deactivated broken links in balancing.

This commit is contained in:
benni 2012-05-12 11:18:46 +02:00
parent c49edb79a2
commit 6bd4bbec86
5 changed files with 34 additions and 35 deletions

View file

@ -27,25 +27,21 @@ class Finance::BalancingController < ApplicationController
sort = "id"
end
@articles = @order.order_articles.ordered.find(
:all,
:include => :article,
:order => sort
)
@articles = @order.order_articles.ordered.includes(:article).order(sort)
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"
@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
view = params[:view]
params[:view] = nil
case view
case view.try(:to_sym)
when 'editResults'
render :partial => 'edit_results_by_articles' and return
when 'groupsOverview'
when :groups_overview
render :partial => 'shared/articles_by_groups', :locals => {:order => @order} and return
when 'articlesOverview'
render :partial => 'shared/articles_by_articles', :locals => {:order => @order} and return

View file

@ -1,15 +1,15 @@
%p{:style => "float:left"}
%b Lieferung bearbeiten
%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"}
%thead
%tr
%th[sort_td_class_helper("name")]{:colspan => "1"}
= sort_link_helper "Artikel", "name", :action => "new", :remote => false
%th[sort_td_class_helper "order_number"]
= sort_link_helper "Nr.", "order_number", :action => "new", :remote => false
%th{colspan: "1", class: sort_td_class_helper("name")}
= sort_link_helper "Artikel", "name"
%th{class: sort_td_class_helper("order_number")}
= sort_link_helper "Nr.", "order_number"
%th Menge
%th GebGr * Einheit
%th Netto

View file

@ -7,7 +7,8 @@
%td Einheiten
%td Gesamtpreis
%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
- 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]
@ -16,18 +17,19 @@
= group_order_article.group_order.ordergroup.name
%td{:id => "group_order_article_#{group_order_article.id}_quantity", :style => "white-space:nowrap"}
= 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 => '-'}, :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');")
%td.currency
= number_to_currency(group_order_article.order_article.price.fc_price * group_order_article.result, :unit => "")
%td.actions{:style=>"width:1em"}
= remote_link_to icon(:edit), :update => 'edit_box', |
:url => {:action => 'edit_group_order_article', :id => group_order_article}, |
:success => "Element.hide('loader'); Element.show('edit_box')" |
= link_to icon(:edit), '#'
/:update => '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"}
= remote_link_to icon(:delete), |
:url => {:action => 'destroy_group_order_article', :id => group_order_article}, |
:confirm => 'Bist du sicher?', :method => 'post' |
= link_to icon(:delete), '#'
/:url => {:action => 'destroy_group_order_article', :id => group_order_article}, |
/:confirm => 'Bist du sicher?', :method => 'post' |
%td
%tfoot
%tr{:class => cycle('even', 'odd', :name => 'results')}

View file

@ -1,7 +1,7 @@
%td.closed
= link_to_function order_article.article.name, |
"Element.toggle('group_order_articles_#{order_article.id}'); |
Element.toggleClassName(this.up('td'), 'open')" |
= link_to order_article.article.name, '#'
/"Element.toggle('group_order_articles_#{order_article.id}'); |
/Element.toggleClassName(this.up('td'), 'open')" |
%td= order_article.article.order_number
%td
= order_article.units_to_order
@ -21,9 +21,10 @@
%td= order_article.price.tax
%td= order_article.price.deposit
%td
= remote_link_to icon(:edit), |
:url => {:action => 'edit_order_article', :id => order_article} |
= link_to icon(:edit), '#'
/:url => {:action => 'edit_order_article', :id => order_article} |
%td
= remote_link_to icon(:delete), :confirm => 'Bist du sicher?', |
:url => {:action => 'destroy_order_article', :id => order_article}, |
:method => :post |
= link_to icon(:delete), '#'
/:confirm => 'Bist du sicher?'
/:url => {:action => 'destroy_order_article', :id => order_article},
/:method => :post

View file

@ -46,11 +46,11 @@
.box_title
#editOrderNav
%ul
%li= remote_link_to 'Gruppenübersicht', :update => 'results', :url => {:action => 'new', :id => @order, :view => 'groupsOverview'}
%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= 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 'Bestellung bearbeiten', :update => 'results', :url => {:action => 'new', :id => @order, :view => 'editResults'}
.column_content
#results
/= render :partial => 'edit_results_by_articles'
= render :partial => 'edit_results_by_articles'
%p= link_to_top
#edit_box{:style => 'display:none'}