remove scale_quantity

This commit is contained in:
viehlieb 2023-01-31 12:54:23 +01:00
parent 77474c0811
commit cf40a53785
4 changed files with 4 additions and 6 deletions

View file

@ -76,7 +76,7 @@ module FoodsoftArticleImport
article.merge!(:deposit => self.translate(:deposit, row[26])) if self.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?
# article.merge!(:scale_quantity => row[40], :scale_price => row[41]) unless row[40].nil? or row[41].nil?
if row[62] != nil
# consider special prices

View file

@ -45,8 +45,6 @@ module FoodsoftArticleImport::Foodsoft
:price => row[7],
:tax => row[8],
:unit_quantity => row[10],
:scale_quantity => row[11],
:scale_price => row[12],
:article_category => row[13]}
article.merge!(:deposit => row[9]) unless row[9].nil?
FoodsoftArticleImport.generate_number(article) if article[:order_number].to_s.strip.empty?

View file

@ -9,7 +9,7 @@ describe FoodsoftArticleImport do
dummy_article = { name: 'Greek Dressing - Kräuter Mix', order_number: '64721', note: 'Oregano, Basilikum und Minze',
manufacturer: 'Medousa, Griechenland Importe', origin: 'GR', article_category: 'Kräutermischungen', unit: '35g', price: '2,89', tax: 7.0, unit_quantity: '6'}
article = dummy_article.merge({scale_price: "3", scale_quantity: "2", deposit: 0.08})
article = dummy_article.merge({ deposit: 0.08})
article_special = article.merge(note: 'Sonderpreis: 2,89 von 20230101 bis 20230201')
article_2 = dummy_article.merge({manufacturer: nil, article_category: nil})

View file

@ -6,10 +6,10 @@ describe FoodsoftArticleImport do
files_path = File.expand_path '../../files', __dir__
foodsoft_files_path = File.join(files_path, 'foodsoft')
dummy_article = {:order_number=>"1", :name=>"product", :note=>"bio", :manufacturer=>"someone", :origin=>"eu", :unit=>"1 kg", :price=>"1.23", :tax=>"6", :unit_quantity=>"10", :scale_quantity=>nil, :scale_price=>nil, :article_category=>"coolstuff", :deposit=>"0"}
dummy_article = {:order_number=>"1", :name=>"product", :note=>"bio", :manufacturer=>"someone", :origin=>"eu", :unit=>"1 kg", :price=>"1.23", :tax=>"6", :unit_quantity=>"10", :article_category=>"coolstuff", :deposit=>"0"}
dummy_article_2 = {:order_number=>"12", :name=>"other product", :note=>"bio", :manufacturer=>"someone", :origin=>"eu", :unit=>"2 kg", :price=>"3.45", :tax=>"6", :unit_quantity=>"10", :scale_quantity=>nil, :scale_price=>nil, :article_category=>"coolstuff", :deposit=>"0"}
dummy_article_2 = {:order_number=>"12", :name=>"other product", :note=>"bio", :manufacturer=>"someone", :origin=>"eu", :unit=>"2 kg", :price=>"3.45", :tax=>"6", :unit_quantity=>"10", :article_category=>"coolstuff", :deposit=>"0"}
articles=[dummy_article, dummy_article_2]