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
|
||||
|
||||
def create
|
||||
create!(:notice => "Inventur wurde erfolgreich angelegt.")
|
||||
create!(:notice => I18n.t('stockit.stock_taking_create.notice'))
|
||||
end
|
||||
|
||||
def update
|
||||
update!(:notice => "Inventur wurde aktualisiert.")
|
||||
update!(:notice => I18n.t('stockit.stock_taking_update.notice'))
|
||||
end
|
||||
|
||||
def fill_new_stock_article_form
|
||||
|
|
|
@ -12,7 +12,7 @@ class StockitController < ApplicationController
|
|||
def create
|
||||
@stock_article = StockArticle.new(params[:stock_article])
|
||||
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
|
||||
render :action => 'new'
|
||||
end
|
||||
|
@ -25,7 +25,7 @@ class StockitController < ApplicationController
|
|||
def update
|
||||
@stock_article = StockArticle.find(params[:id])
|
||||
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
|
||||
render :action => 'edit'
|
||||
end
|
||||
|
@ -35,7 +35,7 @@ class StockitController < ApplicationController
|
|||
StockArticle.find(params[:id]).destroy
|
||||
redirect_to stock_articles_path
|
||||
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
|
||||
end
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class StockArticle < Article
|
|||
protected
|
||||
|
||||
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
|
||||
|
||||
# Overwrite Price history of Article. For StockArticles isn't it necessary.
|
||||
|
|
|
@ -9,9 +9,8 @@
|
|||
= f.input :tax
|
||||
= f.input :deposit
|
||||
- else
|
||||
= f.input :price, :input_html => {:disabled => 'disabled'},
|
||||
:hint => "Um Chaos zu vermeiden können bis auf weiteres die Preise von angelegten Lagerartikeln nicht mehr verändert werden."
|
||||
= f.input :price, :input_html => {:disabled => 'disabled'}, :hint => t('.form.price_hint')
|
||||
= f.association :article_category
|
||||
.form-actions
|
||||
= 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-group.pull-right
|
||||
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn dropdown-toggle' do
|
||||
Ansichtsoptionen
|
||||
= t '.view_options'
|
||||
%span.caret
|
||||
%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
|
||||
= 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'
|
||||
= link_to "Neuen Lagerartikel anlegen", new_stock_article_path, class: 'btn'
|
||||
= link_to "Inventur anlegen", new_stock_taking_path, class: 'btn'
|
||||
= link_to "Inventurübersicht", stock_takings_path, class: 'btn'
|
||||
= link_to t('.new_stock_article'), new_stock_article_path, class: 'btn'
|
||||
= link_to t('.new_stock_taking'), new_stock_taking_path, class: 'btn'
|
||||
= link_to t('.show_stock_takings'), stock_takings_path, class: 'btn'
|
||||
|
||||
.btn-group
|
||||
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn dropdown-toggle' do
|
||||
Neue Lieferung ..
|
||||
= t '.new_delivery'
|
||||
%span.caret
|
||||
%ul.dropdown-menu
|
||||
- Supplier.all.each do |supplier|
|
||||
|
@ -33,15 +33,15 @@
|
|||
%table.table.table-hover#articles
|
||||
%thead
|
||||
%tr
|
||||
%th Artikel
|
||||
%th im Lager
|
||||
%th davon bestellt
|
||||
%th verfügbar
|
||||
%th Einheit
|
||||
%th Preis
|
||||
%th MwSt
|
||||
%th Lieferantin
|
||||
%th Kategorie
|
||||
%th= t '.article.article'
|
||||
%th= t '.article.stock'
|
||||
%th= t '.article.ordered'
|
||||
%th= t '.article.available'
|
||||
%th= t '.article.unit'
|
||||
%th= t '.article.price'
|
||||
%th= t '.article.vat'
|
||||
%th= t '.article.supplier'
|
||||
%th= t '.article.category'
|
||||
%th
|
||||
%tbody
|
||||
- for article in @stock_articles
|
||||
|
@ -56,13 +56,13 @@
|
|||
%td= link_to article.supplier.name, article.supplier
|
||||
%td= article.article_category.name
|
||||
%td
|
||||
= link_to "Bearbeiten", edit_stock_article_path(article), class: 'btn btn-mini'
|
||||
= link_to "Löschen", article, :method => :delete, :confirm => "Bist Du sicher?",
|
||||
= link_to t('ui.edit'), edit_stock_article_path(article), class: 'btn btn-mini'
|
||||
= link_to t('ui.delete'), article, :method => :delete, :confirm => t('.confirm_delete'),
|
||||
class: 'btn btn-mini btn-danger'
|
||||
%p
|
||||
Aktueller Lagerwert:
|
||||
= t '.stock_worth'
|
||||
= number_to_currency StockArticle.stock_value
|
||||
|
|
||||
Artikelanzahl:
|
||||
=t '.stock_count'
|
||||
= StockArticle.available.count
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- title "Neuen Lagerartikel anlegen"
|
||||
- title t('.title')
|
||||
|
||||
- content_for :head do
|
||||
:javascript
|
||||
|
@ -16,7 +16,7 @@
|
|||
/
|
||||
TODO: Fix this
|
||||
%p
|
||||
Suche nach Artikeln aus allen Katalogen:
|
||||
= t '.search_text'
|
||||
= text_field_tag 'article_search'
|
||||
#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