Balancing: Do not update oder summary automaticly when changing group orders.

This commit is contained in:
Benjamin Meichsner 2013-03-17 15:47:50 +01:00
parent 9cc98b4662
commit c05b3e0e19
5 changed files with 12 additions and 2 deletions

View file

@ -30,6 +30,10 @@ class Finance::BalancingController < Finance::BaseController
render layout: false if request.xhr?
end
def update_summary
@order = Order.find(params[:id])
end
def edit_note
@order = Order.find(params[:id])
render :layout => false

View file

@ -24,4 +24,8 @@
%td
FC Gewinn
%small mit Aufschlag:
%td#order_profit.numeric= number_to_currency(order.profit)
%td#order_profit.numeric= number_to_currency(order.profit)
#summaryChangedWarning.alert(style="display:none;")
%strong Daten wurden verändert!
%br/
= link_to 'Zusammenfassung neu laden', update_summary_finance_order_path(order), remote: true

View file

@ -0,0 +1 @@
$('#summary').html('#{j(render('finance/balancing/summary', order: @order))}');

View file

@ -1,4 +1,4 @@
$('#modalContainer').modal('hide');
$('#order_article_#{@order_article.id}').html('#{j(render('finance/balancing/order_article', order_article: @order_article))}');
$('#group_order_articles_#{@order_article.id}').html('#{j(render('finance/balancing/group_order_articles', order_article: @order_article))}');
$('#summary').html('#{j(render('finance/balancing/summary', order: @order_article.order))}');
$('#summaryChangedWarning').show();

View file

@ -129,6 +129,7 @@ Foodsoft::Application.routes.draw do
resources :order, controller: 'balancing', path: 'balancing' do
member do
get :update_summary
get :edit_note
put :update_note