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}
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

View File

@ -56,7 +56,7 @@
%td= article.article_category.name
%td
= 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'),
class: 'btn btn-mini btn-danger', :remote => true
%p

View File

@ -1637,16 +1637,6 @@ de:
mark: ! '*'
text: benötigt
'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:
create:
notice: Inventur wurde erfolgreich angelegt.
@ -1687,6 +1677,15 @@ de:
title: Lagerartikel bearbeiten
form:
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:
article:
article: Artikel

View File

@ -1639,16 +1639,6 @@ en:
mark: ! '*'
text: required
'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:
create:
notice: Inventory was created successfully.
@ -1689,6 +1679,15 @@ en:
title: Edit stock articles
form:
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:
article:
article: Article

View File

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