Artikelliste durch importierte BNN-Datei aktualisieren #11

Open
opened 2022-09-08 12:19:52 +02:00 by tk · 4 comments
Owner

Als Admin möchte ich, dass durch den manuellen Upload einer BNN Datei die Artikel eines Liferanten automatisch aktualisiert werden.

Über eine manuell hochgeladene BNN-Datei wird der Artikelstamm aktualisiert.
Die Funktion gibt es schon für .csv Datein.

Fallstricke:

  1. Artikel, die als verfügbar markiert sind, sollen als solche markiert bleiben
  2. Eigene "Einheiten" sollen bestehen bleiben -> bsp:
    • 3 kg Cheddar Käse kommen von NKN als 1 Einheit
    • Admin konfiguriert aus 3kg Cheddar Käse 3 Einheiten á 1kg
    • diese customized units sollen bestehen bleiben

Vorgehen

  1. Für Upload: In Lieferant + Artikelliste und BNN Datei hochladen
  2. Für ersten Upload alle Artikel als nicht verfügbar einlesen
  3. Artikel, die bereits in foodsoft existieren identifizieren und aktualisieren
    3.b) alle anderen Artiekel einlesen und "nicht-verfügbar"

Weiterhin:

Unsere Anforderungen mit Sharedlists vergleichen
PRÜFEN ob Sharedlists Gem das schon kann bzw. erweitert werden sollte.

*nützliche Links:
*
Eine Beispieldatei:
https://cloud.local-it.org/apps/files/?dir=/PT-Fund%20Docs/bnn-fileformat&fileid=129396

sharedlist:
hint: sharedlists grast api ab, vllt Umsetzung dort auffindbar
https://github.com/foodcoops/sharedlists/tree/master/lib

Schnittstellenbeschreibung
https://n-bnn.de/sites/default/dateien/bnn/sites/default/dateien/BNN3_1Schnittstelle_20.08.21.pdf

Als Admin möchte ich, dass durch den manuellen Upload einer BNN Datei die Artikel eines Liferanten automatisch aktualisiert werden. Über eine manuell hochgeladene BNN-Datei wird der Artikelstamm aktualisiert. Die Funktion gibt es schon für .csv Datein. **Fallstricke:** 1) Artikel, die als verfügbar markiert sind, sollen als solche markiert bleiben 2) Eigene "Einheiten" sollen bestehen bleiben -> bsp: - 3 kg Cheddar Käse kommen von NKN als 1 Einheit - Admin konfiguriert aus 3kg Cheddar Käse 3 Einheiten á 1kg - diese customized units sollen bestehen bleiben **Vorgehen** 1) Für Upload: In Lieferant + Artikelliste und BNN Datei hochladen 2) Für ersten Upload alle Artikel als nicht verfügbar einlesen 3) Artikel, die bereits in foodsoft existieren identifizieren und aktualisieren 3.b) alle anderen Artiekel einlesen und "nicht-verfügbar" Weiterhin: Unsere Anforderungen mit Sharedlists vergleichen PRÜFEN ob Sharedlists Gem das schon kann bzw. erweitert werden sollte. *nützliche Links: * Eine Beispieldatei: https://cloud.local-it.org/apps/files/?dir=/PT-Fund%20Docs/bnn-fileformat&fileid=129396 sharedlist: hint: sharedlists grast api ab, vllt Umsetzung dort auffindbar https://github.com/foodcoops/sharedlists/tree/master/lib Schnittstellenbeschreibung https://n-bnn.de/sites/default/dateien/bnn/sites/default/dateien/BNN3_1Schnittstelle_20.08.21.pdf
tk added this to the Bestellabwicklung milestone 2022-09-08 12:19:52 +02:00
Owner

Überschneidung #1

Überschneidung #1
philipp added this to the Kanban project 2023-01-17 12:05:23 +01:00
flip was assigned by philipp 2023-01-17 13:10:02 +01:00
tk was assigned by philipp 2023-01-17 13:10:07 +01:00
tk was unassigned by philipp 2023-01-17 13:14:09 +01:00
Owner

Ich konnte keine Auflösung der "BNN-Codes" zu Artikelkategorien oder Pfand finden.

Ich habe NKN, BNN und andere angeschrieben, mit der bitte um Auflösung der Warengruppencodes - ohne wirklichen Erfolg.

--> Daher ist gibt es die Möglichkeit eine eigene codes.yml mit in das root projekt zu packen.

aus supplier.rb:
```custom_codes_path = File.join(Rails.root, "config", "custom_codes.yml")```

Dann werden die yml im gem gemerged.

Außerdem parseable sind:

  • odin.xml -> relevant für nl
  • foodsoft.csv -> relevant für eigene csv

Es muss daher in einem Dropdown das Dateiformat angegeben werden, das geparsed werden soll.

Tests für gem und für fs geschrieben.

  • rename dnb_xml.rb -> odin.rb
  • doku schreiben
  • gem auf github veröffentlichen
Ich konnte keine Auflösung der "BNN-Codes" zu Artikelkategorien oder Pfand finden. Ich habe NKN, BNN und andere angeschrieben, mit der bitte um Auflösung der Warengruppencodes - ohne wirklichen Erfolg. --> Daher ist gibt es die Möglichkeit eine eigene codes.yml mit in das root projekt zu packen. ``` aus supplier.rb: ``` ```custom_codes_path = File.join(Rails.root, "config", "custom_codes.yml")``` Dann werden die yml im gem gemerged. Außerdem parseable sind: * odin.xml -> relevant für nl * foodsoft.csv -> relevant für eigene csv Es muss daher in einem Dropdown das Dateiformat angegeben werden, das geparsed werden soll. Tests für gem und für fs geschrieben. - [ ] rename dnb_xml.rb -> odin.rb - [ ] doku schreiben - [ ] gem auf github veröffentlichen
Owner

erster ansatz, doku:

It is now possible to manually upload files in odin, bnn and foodsoft format.
The code for parsing the functionality is outsourced to a gem that is published on gitea/github.
It is tested and also the upload through the web interface got adapted tests.
The source code was adapted and mainly taken from the sharedlists application.
I tried to give every author credits for their contribution and the gem is of course published under GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 as is the sharedlists application.

However, the "bnn-codes" are far from being complete and I did not manage to find a full mapping for bnn-codes -> language.

Somehow I think the foodcoops have to figure out themselves, which article belongs to which article category...
If your foodcoop owns a list of bnn_codes that proves to be useful, do not hesitate to share it with me.

If your foodcoop wants to use its own bnn_codes.yml, then put it in a file called app/config/custom_codes.yml and the codes will be merged with the incomplete list of the foodsoft_article_import gem.

erster ansatz, doku: It is now possible to manually upload files in odin, bnn and foodsoft format. The code for parsing the functionality is outsourced to a gem that is published on gitea/github. It is tested and also the upload through the web interface got adapted tests. The source code was adapted and mainly taken from the sharedlists application. I tried to give every author credits for their contribution and the gem is of course published under GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 as is the sharedlists application. However, the "bnn-codes" are far from being complete and I did not manage to find a full mapping for bnn-codes -> language. Somehow I think the foodcoops have to figure out themselves, which article belongs to which article category... If your foodcoop owns a list of bnn_codes that proves to be useful, do not hesitate to share it with me. If your foodcoop wants to use its own bnn_codes.yml, then put it in a file called app/config/custom_codes.yml and the codes will be merged with the incomplete list of the foodsoft_article_import gem.
Owner

Für die Erstellung einer Bestelldatei muss das article model erweitert werden.

die wahre unit und unit quantity aus der bnn muss vorhanden sein.

Momentan kann admin die unit und quantity selber splitten.
das soll weiterhin existieren, aber bei einer bestellung sollen die ursprünglichen Informationen aus der BNN Datei genommen werden.
ref.: Fallstricke 2)

so könnte ein article aussehen

#<Article:0x000055a984dd2740
 id: 130,
 name: "Tomatoes",
 supplier_id: 1,
 article_category_id: 3,
 
 #todo: add
 upload_quantity: "20",
 upload_unit: "500g",
 
 unit: "500 g",
 note: "organic",
 availability: true,
 manufacturer: "Medousa, Griechenland Importe",
 origin: "GR",
 shared_updated_on: nil,
 price: 0.12e1,
 tax: 7.0,
 deposit: 0.0,
 unit_quantity: 20,
 order_number: "1",
 created_at: Tue, 14 Feb 2023 11:37:48.000000000 UTC +00:00,
 updated_at: Tue, 14 Feb 2023 11:37:48.000000000 UTC +00:00,
 deleted_at: nil,
 type: nil,
 quantity: 0>
Für die Erstellung einer Bestelldatei muss das article model erweitert werden. die wahre unit und unit quantity aus der bnn muss vorhanden sein. Momentan kann admin die unit und quantity selber splitten. das soll weiterhin existieren, aber bei einer bestellung sollen die ursprünglichen Informationen aus der BNN Datei genommen werden. ref.: Fallstricke 2) so könnte ein article aussehen ``` #<Article:0x000055a984dd2740 id: 130, name: "Tomatoes", supplier_id: 1, article_category_id: 3, #todo: add upload_quantity: "20", upload_unit: "500g", unit: "500 g", note: "organic", availability: true, manufacturer: "Medousa, Griechenland Importe", origin: "GR", shared_updated_on: nil, price: 0.12e1, tax: 7.0, deposit: 0.0, unit_quantity: 20, order_number: "1", created_at: Tue, 14 Feb 2023 11:37:48.000000000 UTC +00:00, updated_at: Tue, 14 Feb 2023 11:37:48.000000000 UTC +00:00, deleted_at: nil, type: nil, quantity: 0> ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Foodsoft/foodsoft#11
No description provided.