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
|
# which makes received_changed? not work anymore
|
||||||
oa.attributes = oa_params
|
oa.attributes = oa_params
|
||||||
counts[0] += 1 if oa.units_received_changed?
|
counts[0] += 1 if oa.units_received_changed?
|
||||||
cunits[0] += oa.units_received * oa.article.unit_quantity
|
|
||||||
unless oa.units_received.blank?
|
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 = 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 }
|
oacounts.each_with_index {|c,i| cunits[i+1]+=c; counts[i+1]+=1 if c>0 }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue