Added net|gross sum for deliveries-show-page. (Fixed #193)

This commit is contained in:
Benjamin Meichsner 2009-03-11 18:03:28 +01:00
parent 35251576fa
commit 20d4177990
3 changed files with 26 additions and 11 deletions

View file

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

View file

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

View file

@ -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)
= link_to 'Lieferungsübersicht', supplier_deliveries_path(@supplier)