Refactored ordering part two. Integrated stock order.
This commit is contained in:
parent
eb4705857b
commit
38b5dcba1f
17 changed files with 177 additions and 374 deletions
|
|
@ -99,6 +99,13 @@ class OrderArticle < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
# Units missing for the next full unit_quantity of the article
|
||||
def missing_units
|
||||
units = article.unit_quantity - ((quantity % article.unit_quantity) + tolerance)
|
||||
units = 0 if units < 0
|
||||
units
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def article_and_price_exist
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue