From 5e6621ceb2fc2e8ea50ef9b7ba3a50c339a11644 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 28 Apr 2025 12:37:26 +0200 Subject: [PATCH] Bug 38010: (bugfix) Show contract of the basket if inactive If the contract is inactive it should be displayed on the basket edit view. --- acqui/basketheader.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/acqui/basketheader.pl b/acqui/basketheader.pl index 0b43cfc5e3a..d6ee1e24b7b 100755 --- a/acqui/basketheader.pl +++ b/acqui/basketheader.pl @@ -76,18 +76,24 @@ $template->param( available_additional_fields => Koha::AdditionalFields->search( if ( $op eq 'add_form' ) { my $bookseller = Koha::Acquisition::Booksellers->find($booksellerid); - my $contracts = $bookseller->contracts->search( { contractenddate => { '>=' => \'now()' } } ); - + my $basket; if ($basketno) { #this is an edit - my $basket = Koha::Acquisition::Baskets->find($basketno); + $basket = Koha::Acquisition::Baskets->find($basketno); $template->param( basket => $basket ); $template->param( additional_field_values => Koha::Acquisition::Baskets->find($basketno)->get_additional_field_values_for_template ); } + my $contracts = $bookseller->contracts->search( + [ + { contractenddate => { '>=' => \'now()' } }, + { $basket ? ( contractnumber => $basket->contractnumber ) : () } + ] + ); + $template->param( add_form => 1, vendor => $bookseller, -- 2.34.1