Move StockChanges#index to StockArticles#history

This commit is contained in:
Julius 2013-07-13 09:32:27 +02:00
parent edaf91b029
commit 730dc7cf2a
7 changed files with 25 additions and 30 deletions

View file

@ -1,8 +0,0 @@
#encoding: utf-8
class StockChangesController < ApplicationController
def index
@stock_article = StockArticle.undeleted.find(params[:stock_article_id])
@stock_changes = @stock_article.stock_changes.order('stock_changes.created_at DESC').each {|s| s.readonly!}
end
end

View file

@ -55,4 +55,9 @@ class StockitController < ApplicationController
render :partial => 'form', :locals => {:stock_article => stock_article} render :partial => 'form', :locals => {:stock_article => stock_article}
end end
def history
@stock_article = StockArticle.undeleted.find(params[:stock_article_id])
@stock_changes = @stock_article.stock_changes.order('stock_changes.created_at DESC').each {|s| s.readonly!}
end
end end

View file

@ -56,7 +56,7 @@
%td= article.article_category.name %td= article.article_category.name
%td %td
= link_to t('ui.edit'), edit_stock_article_path(article), class: 'btn btn-mini' = link_to t('ui.edit'), edit_stock_article_path(article), class: 'btn btn-mini'
= link_to t('ui.history'), stock_article_stock_changes_path(article), class: 'btn btn-mini' = link_to t('ui.history'), stock_article_history_path(article), class: 'btn btn-mini'
= link_to t('ui.delete'), article, :method => :delete, :confirm => t('.confirm_delete'), = link_to t('ui.delete'), article, :method => :delete, :confirm => t('.confirm_delete'),
class: 'btn btn-mini btn-danger', :remote => true class: 'btn btn-mini btn-danger', :remote => true
%p %p

View file

@ -1637,16 +1637,6 @@ de:
mark: ! '*' mark: ! '*'
text: benötigt text: benötigt
'yes': Ja 'yes': Ja
stock_changes:
index:
change_quantity: Veränderung
datetime: Zeitpunkt
delivery: Lieferung
new_quantity: Neuer Bestand
order: Bestellung
reason: Ereignis
stock_changes: Verlauf anzeigen für »%{article_name}«
stock_taking: Inventur
stock_takings: stock_takings:
create: create:
notice: Inventur wurde erfolgreich angelegt. notice: Inventur wurde erfolgreich angelegt.
@ -1687,6 +1677,15 @@ de:
title: Lagerartikel bearbeiten title: Lagerartikel bearbeiten
form: form:
price_hint: Um Chaos zu vermeiden können bis auf weiteres die Preise von angelegten Lagerartikeln nicht mehr verändert werden. price_hint: Um Chaos zu vermeiden können bis auf weiteres die Preise von angelegten Lagerartikeln nicht mehr verändert werden.
history:
change_quantity: Veränderung
datetime: Zeitpunkt
delivery: Lieferung
new_quantity: Neuer Bestand
order: Bestellung
reason: Ereignis
stock_changes: Verlauf anzeigen für »%{article_name}«
stock_taking: Inventur
index: index:
article: article:
article: Artikel article: Artikel

View file

@ -1639,16 +1639,6 @@ en:
mark: ! '*' mark: ! '*'
text: required text: required
'yes': 'Yes' 'yes': 'Yes'
stock_changes:
index:
change_quantity: Change
datetime: Time
delivery: Delivery
new_quantity: New quantity
order: Order
reason: Reason
stock_changes: Stock quantity changes of %{article_name}
stock_taking: Inventory
stock_takings: stock_takings:
create: create:
notice: Inventory was created successfully. notice: Inventory was created successfully.
@ -1689,6 +1679,15 @@ en:
title: Edit stock articles title: Edit stock articles
form: form:
price_hint: To avoid choas, it is not possible to edit the prices of already added stock articles until further notice. price_hint: To avoid choas, it is not possible to edit the prices of already added stock articles until further notice.
history:
change_quantity: Change
datetime: Time
delivery: Delivery
new_quantity: New quantity
order: Order
reason: Reason
stock_changes: Stock quantity changes of %{article_name}
stock_taking: Inventory
index: index:
article: article:
article: Article article: Article

View file

@ -97,7 +97,7 @@ Foodsoft::Application.routes.draw do
get :fill_new_stock_article_form get :fill_new_stock_article_form
end end
resources :stock_changes, :only => [:index], :to => 'stock_changes' get :history
end end
resources :suppliers do resources :suppliers do