foodsoft/app/views/deliveries/show.html.haml

52 lines
1.3 KiB
Text
Raw Normal View History

- title "Lieferung anzeigen"
%p
%b Lieferantin:
=h @delivery.supplier.name
%p
%b Geliefert am:
2009-01-18 17:42:51 +01:00
= @delivery.delivered_on
%p
%b Rechnungsbetrag:
= link_to_invoice(@delivery)
- if @delivery.invoice
%p
%b bereinigter Rechnungsbetrag:
= number_to_currency @delivery.invoice.net_amount
%h2 Artikel
%table.list{:style => "width:30em"}
%tr
%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= 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
- if @delivery.invoice
%p
%b Brutto - bereinigter Rechnungsbetrag:
= number_to_currency total_gross - @delivery.invoice.net_amount
%br/
= link_to 'Bearbeiten', edit_supplier_delivery_path(@supplier,@delivery)
|
= link_to 'Lieferungsübersicht', supplier_deliveries_path(@supplier)