add calc to gem
This commit is contained in:
parent
a9deeda32b
commit
f1cd4de3e6
1 changed files with 6 additions and 1 deletions
|
@ -67,19 +67,24 @@ module FoodsoftArticleImport
|
|||
tax: translate(:tax, row[33]),
|
||||
unit_quantity: row[22]
|
||||
}
|
||||
|
||||
# TODO: Complete deposit list....
|
||||
article.merge!(deposit: translate(:deposit, row[26])) if translate(:deposit, row[26])
|
||||
|
||||
# get scale prices if exists
|
||||
# article.merge!(:scale_quantity => row[40], :scale_price => row[41]) unless row[40].nil? or row[41].nil?
|
||||
|
||||
unless row[37].nil? && row[65].nil? && row[66].nil?
|
||||
article.merge!(:scale_unit_price => row[66].to_f * row[37].to_f)
|
||||
article.merge!(:scale_unit => row[65] )
|
||||
end
|
||||
|
||||
|
||||
if !row[62].nil?
|
||||
# consider special prices
|
||||
article[:note] = "Sonderpreis: #{article[:price]} von #{row[62]} bis #{row[63]}"
|
||||
yield article, :special, i
|
||||
|
||||
article.merge!(:scale_unit_price => row[68] * row[37].to_f ) unless row[68].nil? or row[37].nil?
|
||||
# Check now for article status, we only consider outlisted articles right now
|
||||
# N=neu, A=Änderung, X=ausgelistet, R=Restbestand,
|
||||
# V=vorübergehend ausgelistet, W=wiedergelistet
|
||||
|
|
Loading…
Reference in a new issue