Bug 28640: Expose EDI Status on basket details page
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 30 Jun 2021 11:37:59 +0000 (12:37 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 26 Jul 2021 10:46:32 +0000 (12:46 +0200)
commit33dd62d66110e498236903a65f8aa7f5946a2ee3
treeba751ba8d2087391d066580f9e52b62b82fe9caf
parentb17b691e01bb5fe28d2c8c6a6f4deac50ebe037f
Bug 28640: Expose EDI Status on basket details page

This patch adds the edi_order relationship method to
Koha::Acquisition::Basket to return the most recently attached
edi_message of type 'ORDER' for the basket.

NOTE: EDI currently returns raw DBIC results. I have opted to maintain
that approach here, but would like to work on upgradeing the
Koha::EDIFACT::Order class to be a subclass of Koha::Object at a later
date.

We then use this new relationship in acqui/basket to display the EDI
status for such baskets.

Test plan
1/ Setup a vendor with EDI Ordering enabled
2/ Add a new basket for the vendor.
3/ Note the new 'EDI status' field displays and reads 'Not ordered'
4/ Close the basker
5/ The 'EDI status' should continue to display 'Not ordered'
6/ Re-open the basket
7/ Close the basket via 'Create EDIFACT order'
8/ Navigate back to the now closed basket
9/ Note the 'EDI status' field now displays 'Pending' and the transfer
date.
10/ Progress the EDI order by running the edi_cron.pl script
11/ The EDI status field should now reflect that the message has been
sent.

Signed-off-by: Benjamin Veasey <B.T.Veasey@lboro.ac.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Acquisition/Basket.pm
acqui/basket.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt