make missing_units get correct details for closed orders
This commit is contained in:
parent
0b08d461fa
commit
ecf5601023
1 changed files with 2 additions and 2 deletions
|
@ -186,9 +186,9 @@ class OrderArticle < ActiveRecord::Base
|
||||||
|
|
||||||
# @return [Number] Units missing for the last +unit_quantity+ of the article.
|
# @return [Number] Units missing for the last +unit_quantity+ of the article.
|
||||||
def missing_units
|
def missing_units
|
||||||
units = article.unit_quantity - ((quantity % article.unit_quantity) + tolerance)
|
units = price.unit_quantity - ((quantity % price.unit_quantity) + tolerance)
|
||||||
units = 0 if units < 0
|
units = 0 if units < 0
|
||||||
units = 0 if units == article.unit_quantity
|
units = 0 if units == price.unit_quantity
|
||||||
units
|
units
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue