Description
Kyle M Hall (khall)
2019-09-26 14:55:19 UTC
Created attachment 93170 [details] [review] Bug 23682 - Add ability to manually import EDI invoices as an alternative to automatic importing on download Some library would like to delay the importing of invoices until a time of their choosing. The invoices should be imported into the database as they do now, but the invoice processing should be skipped. Instead, any invoice file with a status of 'new' should have an 'Import' button to process the invoice. Created attachment 93171 [details] [review] Bug 23682 - Add ability to manually import EDI invoices as an alternative to automatic importing on download Some library would like to delay the importing of invoices until a time of their choosing. The invoices should be imported into the database as they do now, but the invoice processing should be skipped. Instead, any invoice file with a status of 'new' should have an 'Import' button to process the invoice. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Enable the new syspref EdifactInvoiceImport 4) Run the edi cronjob to import a new invoice file 5) View EDI messages table at /acqui/edifactmsgs.pl 6) Note the invoice files is not processes, and retains the status of 'new' 7) Use the 'import' button to process the invoice 8) Note the invoice is now marked 'received' and the 'import' button is gone 9) Verify the invoice was actually processes Created attachment 105927 [details] [review] Bug 23682 - Add ability to manually import EDI invoices as an alternative to automatic importing on download Some library would like to delay the importing of invoices until a time of their choosing. The invoices should be imported into the database as they do now, but the invoice processing should be skipped. Instead, any invoice file with a status of 'new' should have an 'Import' button to process the invoice. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Enable the new syspref EdifactInvoiceImport 4) Run the edi cronjob to import a new invoice file 5) View EDI messages table at /acqui/edifactmsgs.pl 6) Note the invoice files is not processes, and retains the status of 'new' 7) Use the 'import' button to process the invoice 8) Note the invoice is now marked 'received' and the 'import' button is gone 9) Verify the invoice was actually processes Created attachment 108210 [details] [review] Bug 23682 - Add ability to manually import EDI invoices as an alternative to automatic importing on download Some library would like to delay the importing of invoices until a time of their choosing. The invoices should be imported into the database as they do now, but the invoice processing should be skipped. Instead, any invoice file with a status of 'new' should have an 'Import' button to process the invoice. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Enable the new syspref EdifactInvoiceImport 4) Run the edi cronjob to import a new invoice file 5) View EDI messages table at /acqui/edifactmsgs.pl 6) Note the invoice files is not processes, and retains the status of 'new' 7) Use the 'import' button to process the invoice 8) Note the invoice is now marked 'received' and the 'import' button is gone 9) Verify the invoice was actually processes Signed-off-by: Debi Stears <DDStears@washoecounty.us> Created attachment 108943 [details] [review] Bug 23682: Add ability to manually import EDI invoices as an alternative to automatic importing on download Some library would like to delay the importing of invoices until a time of their choosing. The invoices should be imported into the database as they do now, but the invoice processing should be skipped. Instead, any invoice file with a status of 'new' should have an 'Import' button to process the invoice. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Enable the new syspref EdifactInvoiceImport 4) Run the edi cronjob to import a new invoice file 5) View EDI messages table at /acqui/edifactmsgs.pl 6) Note the invoice files is not processes, and retains the status of 'new' 7) Use the 'import' button to process the invoice 8) Note the invoice is now marked 'received' and the 'import' button is gone 9) Verify the invoice was actually processes Signed-off-by: Debi Stears <DDStears@washoecounty.us> Hi Kyle, can you please help me with testing this? I don't have any invoice data to use. From review: 1) Pref description " automatically import EDIFACT invoice message file when they are downloaded." Small typo, I think it should read "files"? 2) Why pref driven and not an EDI account option? From looking at the options available, I was wondering why this is our first EDIFACT preference. I would have expected this on the EDI account level, where we also have the "Automatic ordering:" and other workflow relevant options. (In reply to Katrin Fischer from comment #6) > Hi Kyle, > > can you please help me with testing this? I don't have any invoice data to > use. > > From review: > > 1) Pref description > " automatically import EDIFACT invoice message file when they are > downloaded." > Small typo, I think it should read "files"? You are correct! > 2) Why pref driven and not an EDI account option? > From looking at the options available, I was wondering why this is our first > EDIFACT preference. I would have expected this on the EDI account level, > where we also have the "Automatic ordering:" and other workflow relevant > options. This was a sponsored development and the spec was decided upon my the sponsor. I think as a general rule, if a library wants to manually import invoices from one vendor, they want to manually import invoices from *all* vendors. This change would be out of scope for the development. That being said, I think it would make a fine future enhancement. The syspref value could be imported into a new column in the vendors table and then removed from the database. Created attachment 109030 [details] [review] Bug 23682: (QA follow-up) Fix typo in syspref description I'll still need some data to test with please :) Created attachment 109064 [details]
Test Database
Created attachment 109065 [details] [review] Bug 23682: Add ability to manually import EDI invoices as an alternative to automatic importing on download Some library would like to delay the importing of invoices until a time of their choosing. The invoices should be imported into the database as they do now, but the invoice processing should be skipped. Instead, any invoice file with a status of 'new' should have an 'Import' button to process the invoice. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Enable the new syspref EdifactInvoiceImport 4) Run the edi cronjob to import a new invoice file 5) View EDI messages table at /acqui/edifactmsgs.pl 6) Note the invoice files is not processes, and retains the status of 'new' 7) Use the 'import' button to process the invoice 8) Note the invoice is now marked 'received' and the 'import' button is gone 9) Verify the invoice was actually processes Signed-off-by: Debi Stears <DDStears@washoecounty.us> Created attachment 109066 [details] [review] Bug 23682: (QA follow-up) Fix typo in syspref description (In reply to Katrin Fischer from comment #9) > I'll still need some data to test with please :) Due to the amount of setup required for EDI, I've attached a database dump already set up for the kohadev instance. Test Plan: 1) Check out master with this patch applied 2) Load the attached test database 3) Note there is one basket with two items in it, not received. 4) Browse to http://127.0.0.1:8081/cgi-bin/koha/acqui/edifactmsgs.pl and see the 'new' edifact invoice 5) Import the invoice using the import button 6) Note the items in the basket are now marked as recieved 7) Browse to http://127.0.0.1:8081/cgi-bin/koha/acqui/invoices.pl?op=do_search and note the newly created invoice You are mean, the admin admin account doesn't work :) But koha - koha does. Created attachment 109212 [details] [review] Bug 23682: Add ability to manually import EDI invoices as an alternative to automatic importing on download Some library would like to delay the importing of invoices until a time of their choosing. The invoices should be imported into the database as they do now, but the invoice processing should be skipped. Instead, any invoice file with a status of 'new' should have an 'Import' button to process the invoice. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Enable the new syspref EdifactInvoiceImport 4) Run the edi cronjob to import a new invoice file 5) View EDI messages table at /acqui/edifactmsgs.pl 6) Note the invoice files is not processes, and retains the status of 'new' 7) Use the 'import' button to process the invoice 8) Note the invoice is now marked 'received' and the 'import' button is gone 9) Verify the invoice was actually processes Signed-off-by: Debi Stears <DDStears@washoecounty.us> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 109213 [details] [review] Bug 23682: (QA follow-up) Fix typo in syspref description Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 109214 [details] [review] Bug 23682: INSERT IGORE systen preference in database update Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Kyle, should not we move the plugin hook (edifact_process_invoice) inside process_invoice? Created attachment 109374 [details] [review] Bug 23682: Dedup plugin calls my moving to a single call in process_invoice() Created attachment 109619 [details] [review] Bug 23682: Fix use Koha::Plugins::Handler statements Pushed to master for 20.11, thanks to everybody involved! enhancement will not be backported to 20.05.x series |