Calculate total prices correctly. (Closes #6)
This commit is contained in:
parent
e32e97d178
commit
b1f16d5342
1 changed files with 2 additions and 2 deletions
|
@ -79,12 +79,12 @@ class OrderArticle < ActiveRecord::Base
|
|||
|
||||
# Calculate price for ordered quantity.
|
||||
def total_price
|
||||
units_to_order * price.price
|
||||
units_to_order * price.unit_quantity * price.price
|
||||
end
|
||||
|
||||
# Calculate gross price for ordered qunatity.
|
||||
def total_gross_price
|
||||
units_to_order * price.gross_price
|
||||
units_to_order * price.unit_quantity * price.gross_price
|
||||
end
|
||||
|
||||
def ordered_quantities_equal_to_group_orders?
|
||||
|
|
Loading…
Reference in a new issue