From 27761c09eee2fa4eff89617b5101bff6743fbca4 Mon Sep 17 00:00:00 2001 From: Brendan Lawlor Date: Wed, 18 Dec 2024 21:33:02 +0000 Subject: [PATCH] Bug 38155: Fix Acquisitions Reopen selected invoices button This patch updates the reopen selected invoices link button to use the form-submit.js method from bug 36246. The link needs to have a single data-invoiceid parameter, so the js on invoices.tt creates a comma separated list from the checkboxes. The list of invoiceid is split into an array in invoice.pl To test: 1. Add some invoices for a vendor using the 'receive shipments' button 2. Go to Acquisitions->Invoices 3. Select multiple invoices using the checkboxes 4. Click the 'Close selected invoices' button 5. Confirm it works 6. Go to the Closed invoices tab 7. Select multiple invoices using the checkboxes 8. Click the 'Reopen selected invoices' button 9. Confirm it works 6. Confirm reopening individual invoices from the Actions button still works Signed-off-by: Andrew Fuerste Henry Signed-off-by: Emily Lamancusa Signed-off-by: Katrin Fischer (cherry picked from commit 8b038c880c7542f350caa28261b0058d6c4a4426) Signed-off-by: Paul Derscheid Signed-off-by: wainuiwitikapark --- acqui/invoice.pl | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/acqui/invoice.pl b/acqui/invoice.pl index f822ee4480..e2c903c4c8 100755 --- a/acqui/invoice.pl +++ b/acqui/invoice.pl @@ -87,7 +87,7 @@ if ( $op && $op eq 'cud-close' ) { elsif ( $op && $op eq 'cud-reopen' ) { output_and_exit( $input, $cookie, $template, 'insufficient_permission' ) unless $logged_in_patron->has_permission( { acquisition => 'reopen_closed_invoices' } ); - my @invoiceid = $input->multi_param('invoiceid'); + my @invoiceid = split( ',', $input->param('invoiceid') ); foreach my $invoiceid ( @invoiceid ) { ReopenInvoice($invoiceid); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt index d2fb83ce06..28f91175bc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt @@ -125,7 +125,7 @@ [% IF CAN_user_acquisition_merge_invoices %] [% IF tab == 'closed' %] Merge selected invoices - Reopen selected invoices + Reopen selected invoices [% ELSE %] Merge selected invoices Close selected invoices