diff --git a/lib/foodsoft_article_import/bnn.rb b/lib/foodsoft_article_import/bnn.rb index 14b1ea0..cb69e44 100644 --- a/lib/foodsoft_article_import/bnn.rb +++ b/lib/foodsoft_article_import/bnn.rb @@ -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