finish stockit i18n + controllers + model
This commit is contained in:
parent
0065c44b74
commit
a0a974b9ce
8 changed files with 79 additions and 34 deletions
|
@ -11,11 +11,11 @@ class StockTakingsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
create!(:notice => "Inventur wurde erfolgreich angelegt.")
|
create!(:notice => I18n.t('stockit.stock_taking_create.notice'))
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
update!(:notice => "Inventur wurde aktualisiert.")
|
update!(:notice => I18n.t('stockit.stock_taking_update.notice'))
|
||||||
end
|
end
|
||||||
|
|
||||||
def fill_new_stock_article_form
|
def fill_new_stock_article_form
|
||||||
|
|
|
@ -12,7 +12,7 @@ class StockitController < ApplicationController
|
||||||
def create
|
def create
|
||||||
@stock_article = StockArticle.new(params[:stock_article])
|
@stock_article = StockArticle.new(params[:stock_article])
|
||||||
if @stock_article.save
|
if @stock_article.save
|
||||||
redirect_to stock_articles_path, :notice => "Lagerartikel wurde gespeichert."
|
redirect_to stock_articles_path, :notice => I18n.t('stockit.stock_create.notice')
|
||||||
else
|
else
|
||||||
render :action => 'new'
|
render :action => 'new'
|
||||||
end
|
end
|
||||||
|
@ -25,7 +25,7 @@ class StockitController < ApplicationController
|
||||||
def update
|
def update
|
||||||
@stock_article = StockArticle.find(params[:id])
|
@stock_article = StockArticle.find(params[:id])
|
||||||
if @stock_article.update_attributes(params[:stock_article])
|
if @stock_article.update_attributes(params[:stock_article])
|
||||||
redirect_to stock_articles_path, :notice => "Lagerartikel wurde gespeichert."
|
redirect_to stock_articles_path, :notice => I18n.t('stockit.stock_update.notice')
|
||||||
else
|
else
|
||||||
render :action => 'edit'
|
render :action => 'edit'
|
||||||
end
|
end
|
||||||
|
@ -35,7 +35,7 @@ class StockitController < ApplicationController
|
||||||
StockArticle.find(params[:id]).destroy
|
StockArticle.find(params[:id]).destroy
|
||||||
redirect_to stock_articles_path
|
redirect_to stock_articles_path
|
||||||
rescue => error
|
rescue => error
|
||||||
flash[:error] = "Ein Fehler ist aufgetreten: " + error.message
|
flash[:error] = I18n.t('errors.general_msg', :msg => error.message)
|
||||||
redirect_to stock_articles_path
|
redirect_to stock_articles_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ class StockArticle < Article
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def check_quantity
|
def check_quantity
|
||||||
raise "#{name} kann nicht gelöscht werden. Der Lagerbestand ist nicht null." unless quantity == 0
|
raise I18n.t('stockit.check.not_empty'), :name => name) unless quantity == 0
|
||||||
end
|
end
|
||||||
|
|
||||||
# Overwrite Price history of Article. For StockArticles isn't it necessary.
|
# Overwrite Price history of Article. For StockArticles isn't it necessary.
|
||||||
|
|
|
@ -9,9 +9,8 @@
|
||||||
= f.input :tax
|
= f.input :tax
|
||||||
= f.input :deposit
|
= f.input :deposit
|
||||||
- else
|
- else
|
||||||
= f.input :price, :input_html => {:disabled => 'disabled'},
|
= f.input :price, :input_html => {:disabled => 'disabled'}, :hint => t('.form.price_hint')
|
||||||
:hint => "Um Chaos zu vermeiden können bis auf weiteres die Preise von angelegten Lagerartikeln nicht mehr verändert werden."
|
|
||||||
= f.association :article_category
|
= f.association :article_category
|
||||||
.form-actions
|
.form-actions
|
||||||
= f.submit class: 'btn'
|
= f.submit class: 'btn'
|
||||||
= link_to "oder abbrechen", stock_articles_path
|
= link_to t('.cancel'), stock_articles_path
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
- title "Lagerartikel bearbeiten"
|
- title t('.title')
|
||||||
|
|
||||||
= render :partial => 'form', :locals => {:stock_article => @stock_article}
|
= render :partial => 'form', :locals => {:stock_article => @stock_article}
|
|
@ -9,21 +9,21 @@
|
||||||
.btn-toolbar
|
.btn-toolbar
|
||||||
.btn-group.pull-right
|
.btn-group.pull-right
|
||||||
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn dropdown-toggle' do
|
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn dropdown-toggle' do
|
||||||
Ansichtsoptionen
|
= t '.view_options'
|
||||||
%span.caret
|
%span.caret
|
||||||
%ul.dropdown-menu
|
%ul.dropdown-menu
|
||||||
%li= link_to "Nicht verfügbare Artikel zeigen/verstecken", "#", 'data-toggle-this' => 'tr.unavailable', tabindex: -1
|
%li= link_to t('.toggle_unavailable'), "#", 'data-toggle-this' => 'tr.unavailable', tabindex: -1
|
||||||
|
|
||||||
.btn-group
|
.btn-group
|
||||||
= link_to_if @current_user.role_orders?, "Lagerbestellung online stellen", new_order_path(supplier_id: 0),
|
= link_to_if @current_user.role_orders?, t('.order_online'), new_order_path(supplier_id: 0),
|
||||||
class: 'btn', class: 'btn btn-primary'
|
class: 'btn', class: 'btn btn-primary'
|
||||||
= link_to "Neuen Lagerartikel anlegen", new_stock_article_path, class: 'btn'
|
= link_to t('.new_stock_article'), new_stock_article_path, class: 'btn'
|
||||||
= link_to "Inventur anlegen", new_stock_taking_path, class: 'btn'
|
= link_to t('.new_stock_taking'), new_stock_taking_path, class: 'btn'
|
||||||
= link_to "Inventurübersicht", stock_takings_path, class: 'btn'
|
= link_to t('.show_stock_takings'), stock_takings_path, class: 'btn'
|
||||||
|
|
||||||
.btn-group
|
.btn-group
|
||||||
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn dropdown-toggle' do
|
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn dropdown-toggle' do
|
||||||
Neue Lieferung ..
|
= t '.new_delivery'
|
||||||
%span.caret
|
%span.caret
|
||||||
%ul.dropdown-menu
|
%ul.dropdown-menu
|
||||||
- Supplier.all.each do |supplier|
|
- Supplier.all.each do |supplier|
|
||||||
|
@ -33,15 +33,15 @@
|
||||||
%table.table.table-hover#articles
|
%table.table.table-hover#articles
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th Artikel
|
%th= t '.article.article'
|
||||||
%th im Lager
|
%th= t '.article.stock'
|
||||||
%th davon bestellt
|
%th= t '.article.ordered'
|
||||||
%th verfügbar
|
%th= t '.article.available'
|
||||||
%th Einheit
|
%th= t '.article.unit'
|
||||||
%th Preis
|
%th= t '.article.price'
|
||||||
%th MwSt
|
%th= t '.article.vat'
|
||||||
%th Lieferantin
|
%th= t '.article.supplier'
|
||||||
%th Kategorie
|
%th= t '.article.category'
|
||||||
%th
|
%th
|
||||||
%tbody
|
%tbody
|
||||||
- for article in @stock_articles
|
- for article in @stock_articles
|
||||||
|
@ -56,13 +56,13 @@
|
||||||
%td= link_to article.supplier.name, article.supplier
|
%td= link_to article.supplier.name, article.supplier
|
||||||
%td= article.article_category.name
|
%td= article.article_category.name
|
||||||
%td
|
%td
|
||||||
= link_to "Bearbeiten", 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 "Löschen", article, :method => :delete, :confirm => "Bist Du sicher?",
|
= link_to t('ui.delete'), article, :method => :delete, :confirm => t('.confirm_delete'),
|
||||||
class: 'btn btn-mini btn-danger'
|
class: 'btn btn-mini btn-danger'
|
||||||
%p
|
%p
|
||||||
Aktueller Lagerwert:
|
= t '.stock_worth'
|
||||||
= number_to_currency StockArticle.stock_value
|
= number_to_currency StockArticle.stock_value
|
||||||
|
|
|
|
||||||
Artikelanzahl:
|
=t '.stock_count'
|
||||||
= StockArticle.available.count
|
= StockArticle.available.count
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
- title "Neuen Lagerartikel anlegen"
|
- title t('.title')
|
||||||
|
|
||||||
- content_for :head do
|
- content_for :head do
|
||||||
:javascript
|
:javascript
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
/
|
/
|
||||||
TODO: Fix this
|
TODO: Fix this
|
||||||
%p
|
%p
|
||||||
Suche nach Artikeln aus allen Katalogen:
|
= t '.search_text'
|
||||||
= text_field_tag 'article_search'
|
= text_field_tag 'article_search'
|
||||||
#stock_article_form
|
#stock_article_form
|
||||||
= render :partial => 'form', :locals => {:stock_article => @stock_article}
|
= render :partial => 'form', :locals => {:stock_article => @stock_article}
|
46
config/locales/de/de.stockit.yml
Normal file
46
config/locales/de/de.stockit.yml
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
de:
|
||||||
|
stockit:
|
||||||
|
edit:
|
||||||
|
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.'
|
||||||
|
cancel: 'or cancel'
|
||||||
|
index:
|
||||||
|
view_options: 'Ansichtsoptionen'
|
||||||
|
toggle_unavailable: 'Nicht verfügbare Artikel zeigen/verstecken'
|
||||||
|
order_online: 'Lagerbestellung online stellen'
|
||||||
|
new_stock_article: 'Neuen Lagerartikel anlegen'
|
||||||
|
new_stock_taking: 'Inventur anlegen'
|
||||||
|
show_stock_takings: 'Inventurübersicht'
|
||||||
|
new_delivery: 'Neue Lieferung ..'
|
||||||
|
article:
|
||||||
|
article: 'Artikel'
|
||||||
|
stock: 'im Lager'
|
||||||
|
ordered: 'davon bestellt'
|
||||||
|
available: 'verfügbar'
|
||||||
|
unit: 'Einheit'
|
||||||
|
price: 'Preis'
|
||||||
|
vat: 'MwSt'
|
||||||
|
supplier: 'Lieferantin'
|
||||||
|
category: 'Kategorie'
|
||||||
|
confirm_delete: 'Bist Du sicher?'
|
||||||
|
stock_worth: 'Aktueller Lagerwert:'
|
||||||
|
stock_count: 'Artikelanzahl:'
|
||||||
|
new:
|
||||||
|
title: 'Neuen Lagerartikel anlegen'
|
||||||
|
search_text: 'Suche nache Artikeln aus allen Katalogen:'
|
||||||
|
|
||||||
|
# used by controller
|
||||||
|
stock_create:
|
||||||
|
notice: 'Lagerartikel wurde gespeichert.'
|
||||||
|
stock_update:
|
||||||
|
notice: 'Lagerartikel wurde gespeichert.'
|
||||||
|
stock_taking_create:
|
||||||
|
notice: 'Inventur wurde erfolgreich angelegt.'
|
||||||
|
stock_taking_update:
|
||||||
|
notice: 'Inventur wurde aktualisiert.'
|
||||||
|
|
||||||
|
# used by model
|
||||||
|
check:
|
||||||
|
not_empty: '%{name} kann nicht gelöscht werden. Der Lagerbestand ist nicht null.'
|
||||||
|
|
Loading…
Reference in a new issue