fix receive exception when input is set to nil
This commit is contained in:
parent
41ea9ed66e
commit
a28c6031a4
1 changed files with 1 additions and 1 deletions
|
@ -171,8 +171,8 @@ class OrdersController < ApplicationController
|
|||
# which makes received_changed? not work anymore
|
||||
oa.attributes = oa_params
|
||||
counts[0] += 1 if oa.units_received_changed?
|
||||
cunits[0] += oa.units_received * oa.article.unit_quantity
|
||||
unless oa.units_received.blank?
|
||||
cunits[0] += oa.units_received * oa.article.unit_quantity
|
||||
oacounts = oa.redistribute oa.units_received * oa.price.unit_quantity, rest_to
|
||||
oacounts.each_with_index {|c,i| cunits[i+1]+=c; counts[i+1]+=1 if c>0 }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue