diff --git a/app/views/deliveries/_stock_article_form.html.haml b/app/views/deliveries/_stock_article_form.html.haml index 2af1fd43..6cb13334 100644 --- a/app/views/deliveries/_stock_article_form.html.haml +++ b/app/views/deliveries/_stock_article_form.html.haml @@ -3,27 +3,27 @@ = form.hidden_field :supplier_id %p - = form.label :name + Name %br/ = form.text_field :name %p - = form.label :unit + Einheit %br/ = form.text_field :unit %p - = form.label :note + Notiz %br/ = form.text_field :note %p - = form.label :price + Preis %br/ = form.text_field :price %p - = form.label :tax + MwSt %br/ = form.text_field :tax, :value => (stock_article.tax || 7.0) %p - = form.label :deposit + Pfand %br/ = form.text_field :deposit %p diff --git a/app/views/deliveries/edit.html.haml b/app/views/deliveries/edit.html.haml index 7159de06..03e6977a 100644 --- a/app/views/deliveries/edit.html.haml +++ b/app/views/deliveries/edit.html.haml @@ -11,7 +11,7 @@ = f.error_messages = f.hidden_field :supplier_id %p - %b= f.label :delivered_on + %b Geliefert am: = f.date_select :delivered_on %h2 Artikel diff --git a/app/views/deliveries/show.html.haml b/app/views/deliveries/show.html.haml index 99ceacf9..f8087956 100644 --- a/app/views/deliveries/show.html.haml +++ b/app/views/deliveries/show.html.haml @@ -4,7 +4,7 @@ %b Lieferant: =h @delivery.supplier.name %p - %b Delivered on: + %b Geliefert am: = @delivery.delivered_on %p %b Rechnungsbetrag: @@ -16,13 +16,28 @@ %th Artikel %th Einheit %th Menge + %th Nettopreis + %th Summe + - total_net, total_gross = 0,0 - for stock_change in @delivery.stock_changes.find :all, :include => :stock_article + - quantity = stock_change.quantity + - sum = quantity * stock_change.stock_article.price + - total_net += sum + - total_gross += quantity * stock_change.stock_article.gross_price %tr %td= stock_change.stock_article.name %td= stock_change.stock_article.unit - %td= stock_change.quantity + %td= quantity + %td= number_to_currency stock_change.stock_article.price + %td= number_to_currency sum +%p + Nettosumme: + = number_to_currency total_net +%p + Bruttosumme: + = number_to_currency total_gross %br/ -= link_to 'Edit', edit_supplier_delivery_path(@supplier,@delivery) += link_to 'Bearbeiten', edit_supplier_delivery_path(@supplier,@delivery) | -= link_to 'Back', supplier_deliveries_path(@supplier) \ No newline at end of file += link_to 'Lieferungsübersicht', supplier_deliveries_path(@supplier) \ No newline at end of file