Bug 38489

Summary: EDI should be updated to use the new FTP/SFTP Servers management page
Product: Koha Reporter: Jake Deery <jake.deery>
Component: Architecture, internals, and plumbingAssignee: Jake Deery <jake.deery>
Status: Patch doesn't apply --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: andrew, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 35761    
Bug Blocks:    
Attachments: Bug 35761: Integrate EDI into new FTP/SFTP management UI
Bug 38489: (follow-up) tidy EDIfact files
Bug 38489: Integrate EDI into new FTP/SFTP management UI
Bug 38489: (follow-up) tidy EDIfact files
Bug 38489: Integrate EDI into new FTP/SFTP management UI
Bug 38489: (follow-up) tidy EDIfact files
Bug 38489: (follow-up) tidy EDIfact files

Description Jake Deery 2024-11-20 09:23:09 UTC
See Bug 35761. This bug should continue this work, by moving the EDI transport information to the sftp_servers table, replacing the FTP/SFTP server details instead with a foreign key.
Comment 1 Jake Deery 2024-12-04 17:41:17 UTC Comment hidden (obsolete)
Comment 2 Jake Deery 2024-12-04 17:41:28 UTC Comment hidden (obsolete)
Comment 3 Jake Deery 2024-12-04 17:42:39 UTC Comment hidden (obsolete)
Comment 4 Jake Deery 2024-12-04 17:42:48 UTC Comment hidden (obsolete)
Comment 5 Jake Deery 2025-01-03 13:19:32 UTC
Created attachment 176118 [details] [review]
Bug 38489: Integrate EDI into new FTP/SFTP management UI

This patch integrates the EDI Transport.pm module into the new FTP/SFTP
management UI by tweaking the existing methods to look at the new SftpServer
object, instead of its own.

Included also is a change to the database structure to make use of the new
sftp_servers table, as well as an atomic update to copy the schema changes,
and existing config to the new sftp_servers table.

NOTE:       To test this bug, you'll need to have access to a valid FTP/SFTP
  server, within which you are able to generate exemplar quotes, orders,
  and invoices. If you do not have access to this, contact me, and I will
  try to arrange something. Thanks

To test:
a)  Apply Bug 35761, follow that test plan, and enable EDIFACT syspref
b)  Notice how there is a duplication of FTP/SFTP details in Koha, between
    EDI and FTP/SFTP Servers
c)  APPLY THIS BUG, reset_all, and enable EDIFACT syspref
d)  Create an FTP/SFTP Server under Koha Administration -> FTP/SFTP Server
e)  Create an EDI account
    1)  Notice how there is now two dropdowns for upload & download server
    2)  Choose the same server for both options
    3)  Set valid download & upload directories
    4)  Enable quotes, orders, and invoices
f)  Run ./misc/cronjobs/edi_cron.pl
    1)  Check that a quote is now in Koha from the EDI vendor
    2)  Confirm the quote via the staff client
g)  Run ./misc/cronjobs/edi_cron.pl
    1)  Check that the order is now on the FTP/SFTP server
    2)  Generate an invoice on the FTP/SFTP server
h)  Run ./misc/cronjobs/edi_cron.pl
    1)  Confirm Koha has received the invoice
    2)  Mark the invoice as paid in the staff client
i)  Run ./misc/cronjobs/edi_cron.pl
    1)  Check that the invoice is now on the FTP/SFTP server
j)  SIGN OFF!
Comment 6 Jake Deery 2025-01-03 13:25:21 UTC
Created attachment 176119 [details] [review]
Bug 38489: (follow-up) tidy EDIfact files

This patch follows-up by by tidying the following files:
*   Koha/Edifact/Transport.pm
*   admin/edi_accounts.pl
Comment 7 Jake Deery 2025-01-06 15:50:24 UTC
Created attachment 176161 [details] [review]
Bug 38489: (follow-up) tidy EDIfact files

This patch follows-up by by tidying the following files:
*   Koha/Edifact/Transport.pm
*   admin/edi_accounts.pl
Comment 8 Andrew Fuerste-Henry 2025-02-14 16:16:29 UTC
Please rebase for signoff. Thanks!