finish deliveries i18n
This commit is contained in:
parent
ee5f7ff1b8
commit
3f82138d84
9 changed files with 83 additions and 44 deletions
|
@ -35,7 +35,7 @@ class DeliveriesController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @delivery.save
|
if @delivery.save
|
||||||
flash[:notice] = 'Lieferung wurde erstellt. Bitte nicht vergessen die Rechnung anzulegen!'
|
flash[:notice] = I18n.t('deliveries.create.notice')
|
||||||
format.html { redirect_to([@supplier,@delivery]) }
|
format.html { redirect_to([@supplier,@delivery]) }
|
||||||
format.xml { render :xml => @delivery, :status => :created, :location => @delivery }
|
format.xml { render :xml => @delivery, :status => :created, :location => @delivery }
|
||||||
else
|
else
|
||||||
|
@ -54,7 +54,7 @@ class DeliveriesController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @delivery.update_attributes(params[:delivery])
|
if @delivery.update_attributes(params[:delivery])
|
||||||
flash[:notice] = 'Lieferung wurde aktualisiert.'
|
flash[:notice] = I18n.t('deliveries.update.notice')
|
||||||
format.html { redirect_to([@supplier,@delivery]) }
|
format.html { redirect_to([@supplier,@delivery]) }
|
||||||
format.xml { head :ok }
|
format.xml { head :ok }
|
||||||
else
|
else
|
||||||
|
@ -68,7 +68,7 @@ class DeliveriesController < ApplicationController
|
||||||
@delivery = Delivery.find(params[:id])
|
@delivery = Delivery.find(params[:id])
|
||||||
@delivery.destroy
|
@delivery.destroy
|
||||||
|
|
||||||
flash[:notice] = "Lieferung wurde gelöscht."
|
flash[:notice] = I18n.t('deliveries.destroy.notice')
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to(supplier_deliveries_url(@supplier)) }
|
format.html { redirect_to(supplier_deliveries_url(@supplier)) }
|
||||||
format.xml { head :ok }
|
format.xml { head :ok }
|
||||||
|
|
|
@ -21,28 +21,24 @@
|
||||||
Menge
|
Menge
|
||||||
= stock_change_form.text_field :quantity, size: 5, autocomplete: 'off'
|
= stock_change_form.text_field :quantity, size: 5, autocomplete: 'off'
|
||||||
= stock_change_form.hidden_field :_destroy
|
= stock_change_form.hidden_field :_destroy
|
||||||
= link_to "Artikel aus Lieferung entfernen", "#", class: 'destroy_stock_change'
|
= link_to t('.remove_article'), "#", class: 'destroy_stock_change'
|
||||||
%p
|
%p
|
||||||
= link_to "Lagerartikel der Lieferung hinzufügen", {action: 'add_stock_change', supplier_id: @supplier.id}, remote: true
|
= link_to t('.add_article'), {action: 'add_stock_change', supplier_id: @supplier.id}, remote: true
|
||||||
%p
|
%p
|
||||||
%small
|
%small= t('.note_new_article', new_link: link_to(t('.note_new_article_link'), new_stock_article_path)).html_safe
|
||||||
Ist ein Artikel noch nicht in der Lagerverwaltung, muss er erst
|
|
||||||
#{link_to("neu angelegt", new_stock_article_path)} werden.
|
|
||||||
%hr/
|
%hr/
|
||||||
= f.input :delivered_on, as: :date_picker
|
= f.input :delivered_on, as: :date_picker
|
||||||
= f.input :note, input_html: {size: '35x4'}
|
= f.input :note, input_html: {size: '35x4'}
|
||||||
.form-actions
|
.form-actions
|
||||||
= f.submit class: 'btn btn-primary'
|
= f.submit class: 'btn btn-primary'
|
||||||
= link_to "oder abbrechen", supplier_deliveries_path(@supplier)
|
= link_to t('ui.or_cancel'), supplier_deliveries_path(@supplier)
|
||||||
|
|
||||||
/
|
/
|
||||||
TODO: Fix this!!
|
TODO: Fix this!!
|
||||||
.span6
|
.span6
|
||||||
%h2 Neuen Lagerartikel anlegen
|
%h2= t '.new_article.title'
|
||||||
%p
|
%p
|
||||||
Suche nach Artikeln aus dem
|
= t('.new_article.search', supplier: @supplier.name).html_safe + ': '
|
||||||
%i= @supplier.name
|
|
||||||
Katalog:
|
|
||||||
= text_field_tag 'article_name'
|
= text_field_tag 'article_name'
|
||||||
%hr/
|
%hr/
|
||||||
#stock_article_form
|
#stock_article_form
|
||||||
|
|
|
@ -3,4 +3,4 @@
|
||||||
= form.select :stock_article_id, stock_articles_for_select(supplier)
|
= form.select :stock_article_id, stock_articles_for_select(supplier)
|
||||||
Menge
|
Menge
|
||||||
= form.text_field :quantity, :size => 5, :autocomplete => 'off'
|
= form.text_field :quantity, :size => 5, :autocomplete => 'off'
|
||||||
= link_to "Artikel aus Lieferung entfernen", "#", :class => 'remove_new_stock_change'
|
= link_to t('.remove_article'), "#", :class => 'remove_new_stock_change'
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
- title "Lieferung bearbeiten"
|
- title t('.title')
|
||||||
|
|
||||||
= render :partial => 'form'
|
= render :partial => 'form'
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
- title "#{@supplier.name}/Lieferungen"
|
- title t('.title', supplier: @supplier.name)
|
||||||
|
|
||||||
%table.table.table-striped
|
%table.table.table-striped
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th Geliefert am
|
%th= t 'simple_form.labels.delivery.delivered_on'
|
||||||
%th.numeric Rechnungsbetrag
|
%th.numeric= t 'deliveries.invoice_amount'
|
||||||
%th Notiz
|
%th= t 'simple_form.labels.defaults.note'
|
||||||
%tbody
|
%tbody
|
||||||
- for delivery in @deliveries
|
- for delivery in @deliveries
|
||||||
%tr
|
%tr
|
||||||
|
@ -13,11 +13,11 @@
|
||||||
%td.numeric= link_to_invoice(delivery)
|
%td.numeric= link_to_invoice(delivery)
|
||||||
%td= truncate delivery.note
|
%td= truncate delivery.note
|
||||||
%td
|
%td
|
||||||
= link_to 'Anzeigen', [@supplier, delivery], class: 'btn btn-mini'
|
= link_to t('ui.show'), [@supplier, delivery], class: 'btn btn-mini'
|
||||||
= link_to 'Bearbeiten', edit_supplier_delivery_path(@supplier,delivery), class: 'btn btn-mini'
|
= link_to t('ui.edit'), edit_supplier_delivery_path(@supplier,delivery), class: 'btn btn-mini'
|
||||||
= link_to 'Löschen', [@supplier,delivery], :confirm => 'Are you sure?', :method => :delete,
|
= link_to t('ui.delete'), [@supplier,delivery], :confirm => t('.confirm_delete'), :method => :delete,
|
||||||
class: 'btn btn-mini btn-danger'
|
class: 'btn btn-mini btn-danger'
|
||||||
|
|
||||||
= link_to "Neue Lieferung für #{@supplier.name} anlegen", new_supplier_delivery_path(@supplier), class: 'btn btn-primary'
|
= link_to t('.new_delivery', supplier: @supplier.name), new_supplier_delivery_path(@supplier), class: 'btn btn-primary'
|
||||||
|
|
|
|
||||||
= link_to "Lieferantenübersicht", suppliers_path
|
= link_to t('deliveries.suppliers_overview'), suppliers_path
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
- title "Neue Lieferung von #{@supplier.name}"
|
- title t('.title', supplier: @supplier.name)
|
||||||
|
|
||||||
= render 'form'
|
= render 'form'
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
- title "Lieferung anzeigen"
|
- title t('.title')
|
||||||
|
|
||||||
%dl
|
%dl
|
||||||
%dt Lieferantin
|
%dt= t 'simple_form.labels.delivery.supplier'
|
||||||
%dd= @delivery.supplier.name
|
%dd= @delivery.supplier.name
|
||||||
%dt Geliefert am
|
%dt= t 'simple_form.labels.delivery.delivered_on'
|
||||||
%dd= @delivery.delivered_on
|
%dd= @delivery.delivered_on
|
||||||
%dt Rechnungsbetrag:
|
%dt= t 'deliveries.invoice_amount'
|
||||||
%dd= link_to_invoice(@delivery)
|
%dd= link_to_invoice(@delivery)
|
||||||
- if @delivery.invoice
|
- if @delivery.invoice
|
||||||
%dt bereinigter Rechnungsbetrag:
|
%dt= t 'deliveries.invoice_net_amount'
|
||||||
%dd= number_to_currency @delivery.invoice.net_amount
|
%dd= number_to_currency @delivery.invoice.net_amount
|
||||||
%dt Notiz:
|
%dt= t 'simple_form.labels.defaults.note'
|
||||||
%dd= simple_format @delivery.note
|
%dd= simple_format @delivery.note
|
||||||
|
|
||||||
%h2 Artikel
|
%h2= t '.title_articles'
|
||||||
%table.table.table-striped(style="width:500px")
|
%table.table.table-striped(style="width:500px")
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th Artikel
|
%th= t '.article'
|
||||||
%th Einheit
|
%th= t '.unit'
|
||||||
%th.numeric Menge
|
%th.numeric= t '.amount'
|
||||||
%th.numeric Nettopreis
|
%th.numeric= t '.price'
|
||||||
%th.numeric Summe
|
%th.numeric= t '.sum'
|
||||||
%tbody
|
%tbody
|
||||||
- total_net, total_gross = 0,0
|
- total_net, total_gross = 0,0
|
||||||
- @delivery.stock_changes.all.each do |stock_change|
|
- @delivery.stock_changes.all.each do |stock_change|
|
||||||
|
@ -37,16 +37,16 @@
|
||||||
%td.numeric= number_to_currency sum
|
%td.numeric= number_to_currency sum
|
||||||
%tfoot
|
%tfoot
|
||||||
%tr
|
%tr
|
||||||
%td(colspan="4") Nettosumme
|
%td(colspan="4")= t '.sum_net'
|
||||||
%td.numeric= number_to_currency total_net
|
%td.numeric= number_to_currency total_net
|
||||||
%tr
|
%tr
|
||||||
%td(colspan="4") Bruttosumme
|
%td(colspan="4")= t '.sum_gross'
|
||||||
%td.numeric= number_to_currency total_gross
|
%td.numeric= number_to_currency total_gross
|
||||||
- if @delivery.invoice
|
- if @delivery.invoice
|
||||||
%tr
|
%tr
|
||||||
%td(colspan="4") Brutto - bereinigter Rechnungsbetrag:
|
%td(colspan="4")= t '.sum_diff'
|
||||||
%td.numeric= number_to_currency total_gross - @delivery.invoice.net_amount
|
%td.numeric= number_to_currency total_gross - @delivery.invoice.net_amount
|
||||||
|
|
||||||
%p
|
%p
|
||||||
= link_to 'Bearbeiten', edit_supplier_delivery_path(@supplier,@delivery), class: 'btn'
|
= link_to t('ui.edit'), edit_supplier_delivery_path(@supplier,@delivery), class: 'btn'
|
||||||
= link_to 'Lieferungsübersicht', supplier_deliveries_path(@supplier)
|
= link_to t('deliveries.suppliers_overview'), supplier_deliveries_path(@supplier)
|
||||||
|
|
42
config/locales/de/de.deliveries.yml
Normal file
42
config/locales/de/de.deliveries.yml
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
de:
|
||||||
|
deliveries:
|
||||||
|
suppliers_overview: 'Lieferantenübersicht'
|
||||||
|
invoice_amount: 'Rechnungsbetrag'
|
||||||
|
invoice_net_amount: 'bereinigter Rechnungsbetrag'
|
||||||
|
edit:
|
||||||
|
title: 'Lieferung bearbeiten'
|
||||||
|
form:
|
||||||
|
remove_article: 'Artikel aus Lieferung entfernen'
|
||||||
|
add_article: 'Lagerartikel der Lieferung hinzufügen'
|
||||||
|
note_new_article: 'Ist ein Artikel noch nicht in der Lagerverwaltung, muss er erst %{new_link} werden.'
|
||||||
|
note_new_article_link: 'neu angelegt'
|
||||||
|
new_article:
|
||||||
|
title: 'Neuen Lagerartikel anlegen'
|
||||||
|
search: 'Suche nach Artikeln aus dem <i>%{supplier}</i> Katalog'
|
||||||
|
index:
|
||||||
|
title: '%{supplier}/Lieferungen'
|
||||||
|
confirm_delete: 'Bist Du sicher?'
|
||||||
|
new_delivery: 'Neue Lieferung für %{supplier} anlegen'
|
||||||
|
new:
|
||||||
|
title: 'Neue Lieferung von %{supplier}'
|
||||||
|
show:
|
||||||
|
title: 'Lieferung anzeigen'
|
||||||
|
title_articles: 'Artikel'
|
||||||
|
article: 'Artikel'
|
||||||
|
unit: 'Einheit'
|
||||||
|
amount: 'Menge'
|
||||||
|
price: 'Nettopreis'
|
||||||
|
sum: 'Summe'
|
||||||
|
sum_net: 'Nettosumme'
|
||||||
|
sum_gross: 'Bruttosumme'
|
||||||
|
sum_diff: 'Brutto - bereinigter Rechnungsbetrag'
|
||||||
|
stock_change:
|
||||||
|
remove_article: 'Artikel aus Lieferung entfernen'
|
||||||
|
|
||||||
|
# used by controller
|
||||||
|
create:
|
||||||
|
notice: 'Lieferung wurde erstellt. Bitte nicht vergessen die Rechnung anzulegen!'
|
||||||
|
update:
|
||||||
|
notice: 'Lieferung wurde aktualisiert.'
|
||||||
|
destroy:
|
||||||
|
notice: 'Lieferung wurde gelöscht.'
|
|
@ -94,6 +94,7 @@ de:
|
||||||
stock_article:
|
stock_article:
|
||||||
supplier: 'Lieferant'
|
supplier: 'Lieferant'
|
||||||
delivery:
|
delivery:
|
||||||
|
supplier: 'Lieferantin'
|
||||||
delivered_on: 'Lieferdatum'
|
delivered_on: 'Lieferdatum'
|
||||||
user:
|
user:
|
||||||
nick: "Benutzername"
|
nick: "Benutzername"
|
||||||
|
|
Loading…
Reference in a new issue