Fixed bug order.profit calculation.

Order.profit will also be saved, when order is closed.
This commit is contained in:
Benjamin Meichsner 2009-03-17 19:43:41 +01:00
parent 843e4a7233
commit da08365816
32 changed files with 408 additions and 34 deletions

View file

@ -17,7 +17,7 @@
%td= number_to_currency(order.sum(:groups))
%tr
%td FC Gewinn ohne Aufschlag:
%td= number_to_currency(order.profit(:with_markup => false))
%td= number_to_currency(order.profit(:without_markup => true))
%tr
%td FC Gewinn mit Aufschlag:
%td#order_profit= number_to_currency(order.profit)

View file

@ -20,7 +20,7 @@
%tr{:class => cycle("even","odd", :name => "order")}
%td= link_to truncate(order.name), :action => "new", :id => order
%td=h format_time(order.ends) unless order.ends.nil?
%td= order.closed? ? "abgerechnet (#{number_to_currency order.profit})" : "beendet"
%td= order.closed? ? "abgerechnet (#{number_to_currency order.foodcoop_result})" : "beendet"
%td= order.updated_by.nil? ? '??' : order.updated_by.nick
%td
- unless order.closed?