view · edit · sidebar · attach · print · history

Index>

20160823-bauerfeind-problems

Summary

  • Some products don't show up correctly after update bauerfeind
  • Test importing E-Mails for vetoquinol
  • Use Pillbox to download zipped transfer.dat
  • Keep in Mind

Commits

Index

Some products don't show up correctly after update bauerfeind

The query for http://ch.oddb.org/de/gcc/search/zone/migel/search_query/Genutrain? does not show the product defined by the following line in the /var/www/migel/data/csv/update_migel_bauerfeind.csv

  11041403080601;4046445600104;GenuTrain P3,titan,rechts,1;GenuTrain P3,titane,droit,1;2244775;05.04.05.00.1; Fr. 160.60 ;GenuTrain P3,titan,rechts,1;GenuTrain P3,titane,droit,1

The query by the barcode (EAN13) via http://ch.oddb.org/de/gcc/search/zone/migel/search_query/4046445600104? shows two entries, one active and one inactive.

  2244775	4046445600104	GENUTRAIN P3 Kniebandage rechts titan Gr1 28-31cm	1 Stk	I	Bauerfeind AG	160.60
  2244775	4046445600104	GenuTrain P3, titan, rechts, 1	 	A	Bauerfeind AG	160.60

I had seen the same problem on oddb-ci2, too, but the same query by barcode shows there only one hit

  2244775	4046445600104	GenuTrain P3, titan, rechts, 1	 	A	Bauerfeind AG	160.60

But the product does not show up now when searching via http://oddb-ci2.dyndns.org/de/gcc/search/zone/migel/search_query/GENUTRAIN.

To get rid of the problem , I will delete all products from Bauerfeind, instead of deactivating them.

In bin/admin of migel: Trying to solve the problem, that my first delete command resulted in a exception

  migel> Migel::Model::Product.all.delete_if{|x| x.status == 'I' && x.companyname && /bauerfeind/i.match(x.companyname.to_s)}
  -> incompatible character encodings: UTF-8 and ASCII-8BIT
  migel> Migel::Model::Product.all.collect{|x| x.companyname.de.encoding}.uniq
  -> undefined method `encoding' for nil:NilClass
  migel> Migel::Model::Product.all.collect{|x| x.companyname.de && x.companyname.de.encoding}.uniq
  -> [#<Encoding:UTF-8>, #<Encoding:ASCII-8BIT>, nil]
  Migel::Model::Productall.delete_if{|x| x.companyname && x.companyname.de && /bauerfeind/i.match(x.companyname.de.force_encoding('UTF-8'))}

Reloading the database. The last statement above does not delete the correct product from the array of products of the concerned migel_code

migel> Migel::Model::Product.all.size
-> 30742
migel> Migel::Model::Migelid.all.find{ |x| x.migel_code.eql?('05.04.03.00.1')}.products.size
-> 170
migel> Migel::Model::Migelid.all.find{ |x| x.migel_code.eql?('05.04.03.00.1')}
-> Stück
migel> Migel::Model::Migelid.all.find{ |x| x.migel_code.eql?('05.04.03.00.1')}.products.size
-> 170
Migel::Model::Migelid.all.find{ |x| x.migel_code.eql?('05.04.03.00.1')}.products.delete_if{|x| x.companyname && x.companyname.de && /bauerfeind/i.match(x.companyname.de.force_encoding('UTF-8'))}
migel> Migel::Model::Product.all.size
-> 30742
migel> Migel::Model::Migelid.all.find{ |x| x.migel_code.eql?('05.04.03.00.1')}.products.odba_store
-> Array
migel> Migel::Model::Migelid.all.find{ |x| x.migel_code.eql?('05.04.03.00.1')}.products.size
-> 130
migel> Migel::Model::Product.all.size
-> 30742

Somehow call odba_store on a single migel_id is not sufficient. To we have to store Migelid.all, too?

Or do we have somewhere a circular loop in the database which prevents operations like delete and odba_delete to finish?

migel> Migel::Model::Product.all.find{|x| x.pharmacode.eql?('2534527')}.odba_id
-> 3066
migel> Migel::Model::Product.all.find{|x| x.pharmacode.eql?('2534527')}.odba_target_ids
-> [114]
migel> Migel::Model::Product.all.find{|x| x.pharmacode.eql?('2534527')}.odba_delete
GENUTRAIN P3 Kniebandage links titan Gr 0 25-28cm

Running the new import.

Test importing E-Mails for vetoquinol

Creating a test for the following https://mail.google.com/mail/u/3/#inbox/156b030e0bf93119. Must test

  • That the email gets separated correctly
  • That the attachements are parsed correctly

Made test for splitting the e-mail. This works fine. Working on reading the articles (plain ascii) and the custormer (ISO-8859-1).

Use Pillbox to download zipped transfer.dat

Changed the code and it looks that oddb2xml -e works. Waiting for run to complete.

Must change the spec-tests too. There are problemsparsing the downloaded spec/run/medreg/Personen.xlsx file. Why?

workbook= RubyXL::Parser.parse '/mnt/oddb_org/git/migel/Betriebe_20160823.xlsx'
RuntimeError: Unknown child node [x:fileVersion] for element [workbook]
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubyXL-3.3.21/lib/rubyXL/objects/ooxml_object.rb:155:in `block in parse'
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.8/lib/nokogiri/xml/node_set.rb:187:in `block in each'
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.8/lib/nokogiri/xml/node_set.rb:186:in `upto'
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.8/lib/nokogiri/xml/node_set.rb:186:in `each'
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubyXL-3.3.21/lib/rubyXL/objects/ooxml_object.rb:144:in `parse'
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubyXL-3.3.21/lib/rubyXL/objects/ooxml_object.rb:440:in `block in parse_file'
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubyzip-1.2.0/lib/zip/entry.rb:495:in `get_input_stream'
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubyXL-3.3.21/lib/rubyXL/objects/ooxml_object.rb:440:in `parse_file'
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubyXL-3.3.21/lib/rubyXL/objects/relationships.rb:91:in `block in load_related_files'
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubyXL-3.3.21/lib/rubyXL/objects/relationships.rb:76:in `each'
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubyXL-3.3.21/lib/rubyXL/objects/relationships.rb:76:in `load_related_files'
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubyXL-3.3.21/lib/rubyXL/objects/relationships.rb:179:in `load_relationships'
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubyXL-3.3.21/lib/rubyXL/objects/root.rb:66:in `parse_zip_file'
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubyXL-3.3.21/lib/rubyXL/parser.rb:8:in `block in parse'
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubyzip-1.2.0/lib/zip/file.rb:102:in `open'
        from /home/niklaus/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubyXL-3.3.21/lib/rubyXL/parser.rb:7:in `parse'
        from (irb):2
        from /home/niklaus/.rbenv/versions/2.2.3/bin/irb:11:in `<main>'irb(main):003:0> 

Opened the issue https://github.com/weshatheleopard/rubyXL/issues/240.

Pushed commits

Spec tests still have failures. I do not yet handle correctly the zipped transfer.dat from pillbox.

view · edit · sidebar · attach · print · history
Page last modified on August 24, 2016, at 09:46 AM