Calculate total prices correctly. (Closes #6)

This commit is contained in:
sandoz 2009-04-18 18:08:33 +02:00
parent e32e97d178
commit b1f16d5342

View file

@ -79,12 +79,12 @@ class OrderArticle < ActiveRecord::Base
# Calculate price for ordered quantity. # Calculate price for ordered quantity.
def total_price def total_price
units_to_order * price.price units_to_order * price.unit_quantity * price.price
end end
# Calculate gross price for ordered qunatity. # Calculate gross price for ordered qunatity.
def total_gross_price def total_gross_price
units_to_order * price.gross_price units_to_order * price.unit_quantity * price.gross_price
end end
def ordered_quantities_equal_to_group_orders? def ordered_quantities_equal_to_group_orders?