add calc to gem

This commit is contained in:
viehlieb 2023-02-20 22:36:20 +01:00
parent a9deeda32b
commit f1cd4de3e6

View file

@ -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