Bugzilla – Attachment 122506 Details for
Bug 28640
Add EDI order status to basket details display
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28640: Expose EDI Status on basket details page
Bug-28640-Expose-EDI-Status-on-basket-details-page.patch (text/plain), 4.25 KB, created by
Martin Renvoize (ashimema)
on 2021-06-30 12:36:51 UTC
(
hide
)
Description:
Bug 28640: Expose EDI Status on basket details page
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-06-30 12:36:51 UTC
Size:
4.25 KB
patch
obsolete
>From 6a1d16817dd7f8a976cbcd48129fedc0a0a4ed07 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 30 Jun 2021 12:37:59 +0100 >Subject: [PATCH] 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. >--- > Koha/Acquisition/Basket.pm | 17 +++++++++++++++++ > acqui/basket.pl | 4 ++++ > .../prog/en/modules/acqui/basket.tt | 7 +++++++ > 3 files changed, 28 insertions(+) > >diff --git a/Koha/Acquisition/Basket.pm b/Koha/Acquisition/Basket.pm >index 4f10557901..cd9b3359d2 100644 >--- a/Koha/Acquisition/Basket.pm >+++ b/Koha/Acquisition/Basket.pm >@@ -96,6 +96,23 @@ sub orders { > return Koha::Acquisition::Orders->_new_from_dbic( $orders_rs ); > } > >+=head3 edi_order >+ >+ my $edi_order = $basket->edi_order; >+ >+Returns the most recently attached EDI order object if one exists for the basket. >+ >+=cut >+ >+sub edi_order { >+ my ($self) = @_; >+ >+ my $order_rs = >+ $self->_result->edifact_messages( { message_type => 'ORDERS' }, >+ { order_by => { '-desc' => 'transfer_date' }, rows => 1 } ); >+ return $order_rs->single; >+} >+ > =head3 effective_create_items > > Returns C<create_items> for this basket, falling back to C<AcqCreateItem> if unset. >diff --git a/acqui/basket.pl b/acqui/basket.pl >index 09545ee3cc..f82050677f 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -380,6 +380,9 @@ if ( $op eq 'list' ) { > last; > } > >+ my $basket_obj = Koha::Acquisition::Baskets->find($basketno); >+ my $edi_order = $basket_obj->edi_order; >+ > $template->param( > basketno => $basketno, > basket => $basket, >@@ -391,6 +394,7 @@ if ( $op eq 'list' ) { > basketcontractname => $contract->{contractname}, > branches_loop => \@branches_loop, > creationdate => $basket->{creationdate}, >+ edi_order => $edi_order, > authorisedby => $basket->{authorisedby}, > authorisedbyname => $basket->{authorisedbyname}, > users_ids => join(':', @basketusers_ids), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >index dce2567228..b905f4e303 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -314,6 +314,13 @@ > [% IF ( closedate ) %] > <li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li> > [% END %] >+ [% IF ( ediaccount ) %] >+ [% IF ( edi_order && !edi_order.deleted ) %] >+ <li><span class="label">EDI status:</span> [% edi_order.status | html %] ([% edi_order.transfer_date | $KohaDates %])</li> >+ [% ELSE %] >+ <li><span class="label">EDI status:</span> Not ordered</li> >+ [% END %] >+ [% END %] > [% IF ( estimateddeliverydate ) %] > <li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates %]</li> > [% END %] >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28640
:
122506
|
122507
|
122508
|
122511
|
122512
|
122513
|
122514
|
122515
|
122516
|
122517