From 1749c3dbf2a332fc923070f23a778b0689637f13 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 27 Feb 2024 14:00:06 +0100 Subject: [PATCH] Bug 36173: Display basket info when cancelling an order The basketno is missing from the 2 links in acqui/parcel.tt Better to retrieve the basketno from the order in the controller. Test plan: Create an order, receive it On the parcel view notice that the "Cancel order" link leads to a confirmation page that does not contain the info of the basket. It's fixed with this patch applied. Note: Don't fully receive, but 'Receive shipment' from vendor, choose an invoice, and cancel the order from the list to be received Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer (cherry picked from commit d704495138f93943158e2eff87fd10988fa6ff1f) Signed-off-by: Fridolin Somers --- acqui/cancelorder.pl | 4 ++-- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/acqui/cancelorder.pl b/acqui/cancelorder.pl index 50165c5911..16ae84f487 100755 --- a/acqui/cancelorder.pl +++ b/acqui/cancelorder.pl @@ -48,14 +48,14 @@ my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { my $action = $input->param('action'); my $ordernumber = $input->param('ordernumber'); my $biblionumber = $input->param('biblionumber'); -my $basketno = $input->param('basketno'); +my $order = Koha::Acquisition::Orders->find($ordernumber); +my $basketno = $order->basketno; my $basket = Koha::Acquisition::Baskets->find({ basketno => $basketno }, { prefetch => 'booksellerid' }); my $referrer = $input->param('referrer') || $input->referer; my $delete_biblio = $input->param('del_biblio') ? 1 : 0; if( $action and $action eq "confirmcancel" ) { my $reason = $input->param('reason'); - my $order = Koha::Acquisition::Orders->find($ordernumber); my @messages; if( !$order ) { push @messages, Koha::Object::Message->new({ message => 'error_order_not_found', type => 'error' }); 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 82953258d6..413a94aff5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -702,10 +702,10 @@ [% IF ( books_loo.left_holds_on_order ) %] Can't cancel order
[% ELSE %] - Cancel order
+ Cancel order
[% END %] [% IF ( books_loo.can_del_bib ) %] - Cancel order and delete catalog record
+ Cancel order and delete catalog record
[% ELSE %] Can't cancel order and delete catalog record
[% END %] -- 2.39.5