Description
Martin Renvoize (ashimema)
2021-06-30 12:27:25 UTC
Created attachment 122506 [details] [review] 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. Created attachment 122507 [details] [review] Bug 28640: Unit tests for edi_order relation Created attachment 122508 [details] [review] 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. Instead of just printing the value of edi_order.status in the template, please use and IF/ELSIF/ELSE block for all the possible statuses, so they may be translated. Created attachment 122511 [details] [review] Bug 28640: Unit tests for edi_order relation Created attachment 122512 [details] [review] 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. (In reply to Kyle M Hall from comment #4) > Instead of just printing the value of edi_order.status in the template, > please use and IF/ELSIF/ELSE block for all the possible statuses, so they > may be translated. Thanks for testing.. I've now amended the patch with a SWITCH style block as requested.. I can envisage that moving into an include at a later date should we want to include these status details in other area's.. but I thought I'd leave that to another bug ;) Created attachment 122513 [details] [review] Bug 28640: Unit tests for edi_order relation Test plan 1/ Run t/db_dependent/Koha/Acquisition/Basket.t Signed-off-by: Benjamin Veasey <B.T.Veasey@lboro.ac.uk> Created attachment 122514 [details] [review] 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> Tested by a Loughborough University and signed off.. patches attached. Created attachment 122515 [details] [review] Bug 28640: Unit tests for edi_order relation Test plan 1/ Run t/db_dependent/Koha/Acquisition/Basket.t Signed-off-by: Benjamin Veasey <B.T.Veasey@lboro.ac.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 122516 [details] [review] 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> Created attachment 122517 [details] [review] Bug 28640: (QA follow-up) Prevent unit tests from failing Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Pushed to master for 21.11, thanks to everybody involved! Enhancement not backported for 21.05 |