This is a bug to create a process for automatically creating order lines from a MARC record. Users can nominate a directory for a particular vendor and then set a cronjob to periodically check that directory for new files. The cronjob will then stage the file, import biblios/items as required and then create order lines
Koha has already EDI functionnality, that can do what you describe. See https://koha-community.org/manual/23.05/en/html/acquisitions.html#edi-process
This enhancement would be for non-edi vendors and libraries who receive marc files.
Created attachment 154705 [details] [review] Bug 34355: DB schema and atomic update file
Created attachment 154706 [details] [review] Bug 34355: Update menus
Created attachment 154707 [details] [review] Bug 34355: Add account creation
Created attachment 154708 [details] [review] Bug 34355: Add cronjob, MarcOrder object and refactored addorderiso2709 script
Created attachment 154709 [details] [review] Bug 34355: Make item addition dependent on MarcItemFieldsToOrder mappings and introduce MarcFieldsToOrder to cronjob
Created attachment 154710 [details] [review] Bug 34355: Fix form rendering issue This patch also fixes the referencing of import_record_id_selected
I feel like we will need a nice and concise test plan here as there already was some confusion about the functionality!
There is a nice, detailed (ish) test plan that I've written but I'm trying to write unit tests before submitting everything and marking as needing signoff. I'm also weighing up Nick's point from Kohacon about splitting this into multiple bugs as there's some refactoring of the addorderiso2709.pl script at the heart of the enhancement
(In reply to Matt Blenkinsop from comment #10) > There is a nice, detailed (ish) test plan that I've written but I'm trying > to write unit tests before submitting everything and marking as needing > signoff. > > I'm also weighing up Nick's point from Kohacon about splitting this into > multiple bugs as there's some refactoring of the addorderiso2709.pl script > at the heart of the enhancement +1 :)
Created attachment 157092 [details] [review] Bug 34355: DB schema and atomic update file
Created attachment 157093 [details] [review] Bug 34355: Update menus
Created attachment 157094 [details] [review] Bug 34355: Add account creation
Created attachment 157095 [details] [review] Bug 34355: Add cronjob, MarcOrder object and refactored addorderiso2709 script
Created attachment 157096 [details] [review] Bug 34355: Make item addition dependent on MarcItemFieldsToOrder mappings and introduce MarcFieldsToOrder to cronjob
Created attachment 157097 [details] [review] Bug 34355: Fix form rendering issue This patch also fixes the referencing of import_record_id_selected
Created attachment 157098 [details] [review] Bug 34355: Add match_field and match_value to allow multiple accounts in the same file directory
Created attachment 157099 [details] [review] Bug 34355: Add a plugin hook - before_orderline_create
Created attachment 157100 [details] [review] Bug 34355: Rebase changes made in bug 33170
We need a test plan please.
(In reply to Katrin Fischer from comment #21) > We need a test plan please. ... and in general please more commit messages ;)
Created attachment 160858 [details] [review] Bug 34355: DB schema and atomic update file
Created attachment 160859 [details] [review] Bug 34355: Update menus
Created attachment 160860 [details] [review] Bug 34355: Add account creation
Created attachment 160861 [details] [review] Bug 34355: Add cronjob, MarcOrder object and refactored addorderiso2709 script
Created attachment 160862 [details] [review] Bug 34355: Make item addition dependent on MarcItemFieldsToOrder mappings and introduce MarcFieldsToOrder to cronjob
Created attachment 160863 [details] [review] Bug 34355: Fix form rendering issue This patch also fixes the referencing of import_record_id_selected
Created attachment 160864 [details] [review] Bug 34355: Add match_field and match_value to allow multiple accounts in the same file directory
Created attachment 160865 [details] [review] Bug 34355: Add a plugin hook - before_orderline_create
Created attachment 160866 [details] [review] Bug 34355: Rebase changes made in bug 33170
Created attachment 160867 [details] [review] Bug 34355: DB schema and atomic update file
Created attachment 160868 [details] [review] Bug 34355: Update menus
Created attachment 160869 [details] [review] Bug 34355: Add account creation
Created attachment 160870 [details] [review] Bug 34355: Add cronjob, MarcOrder object and refactored addorderiso2709 script
Created attachment 160871 [details] [review] Bug 34355: Make item addition dependent on MarcItemFieldsToOrder mappings and introduce MarcFieldsToOrder to cronjob
Created attachment 160872 [details] [review] Bug 34355: Fix form rendering issue This patch also fixes the referencing of import_record_id_selected
Created attachment 160873 [details] [review] Bug 34355: Add match_field and match_value to allow multiple accounts in the same file directory
Created attachment 160874 [details] [review] Bug 34355: Add a plugin hook - before_orderline_create
Created attachment 160875 [details] [review] Bug 34355: Rebase changes made in bug 33170
Test Plan 1) Create an sFTP server (1 set up for each unique vendor) and share the credentials with the vendor who will be sending the test data 2)apply patch 3) navigate to Administration -> Acquisition parameters -> MARC order accounts 4) click New Account 5)Enter the following details a) Vendor: b) Budget:This budget will be used as the fallback value if the MARC records do not contain a mapped value for a budget code. c)Description: d)Download directory:The download directory specifies the directory in your koha installation that should be searched for new files. e)Match field:(Optional): If you have files from multiple vendors in the same file directory, the match field is the field in the marc record that will be checked to see if the file should be processed by this account. f)Match value: (Optional): This is the value that will be checked against the match field to see if the file matches this account. If it does it will be processed by this account, if not it will be skipped. 6) enter File import settings 7) enter Record matching settings 8) select if it should check for embedded item record data 9) click submit 10) drop test file in sFTP server (run manually or have a cron run to pick up the file) 11) file should load in basket for said vendor and create orders.
Is the setup of the mentioned SFTP server something done in Koha or something done outside? Are you expected to set it up on the Koha server itself? Maybe this works similar like picking up files for EDI?