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 <andrew@bywatersolutions.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8b038c880c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: wainuiwitikapark <wainuiwitikapark@catalyst.net.nz>
This commit is contained in:
Brendan Lawlor 2024-12-18 21:33:02 +00:00 committed by wainuiwitikapark
parent b00dbec4e7
commit 27761c09ee
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}

View File

@ -125,7 +125,7 @@
[% IF CAN_user_acquisition_merge_invoices %]
[% IF tab == 'closed' %]
<a class="btn btn-default merge" id="merge_closed" href="#merge_invoices" data-table="closedresultst"><i class="fa fa-compress"></i> Merge selected invoices</a>
<a class="btn btn-default" id="open_sel" href="#reopen_selected" data-table="closedresultst" data-op="reopen" data-referer="referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber | uri %]%26supplier=[% booksellerid | uri %]%26shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]%26shipmentdateto=[% shipmentdateto | $KohaDates %]%26billingdatefrom=[% billingdatefrom | $KohaDates %]%26billingdateto=[% billingdateto | $KohaDates %]%26isbneanissn=[% isbneanissn | uri %]%26title=[% title | uri %]%26author=[% author | uri %]%26publisher=[% publisher | uri %]%26publicationyear=[% publicationyear | uri %]%26branch=[% branch | uri %]"><i class="fa-solid fa-rotate"></i> Reopen selected invoices</a>
<a class="submit-form-link btn btn-default" id="open_sel" data-table="closedresultst" data-op="cud-reopen" data-action="invoice.pl" data-method="post" data-referer="/cgi-bin/koha/acqui/invoices.pl?op=do_search&invoicenumber=[% invoicenumber | html %]&supplier=[% booksellerid | html %]&shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]&shipmentdateto=[% shipmentdateto | $KohaDates %]&billingdatefrom=[% billingdatefrom | $KohaDates %]&billingdateto=[% billingdateto | $KohaDates %]&isbneanissn=[% isbneanissn | html %]&title=[% title | html %]&author=[% author | html %]&publisher=[% publisher | html %]&publicationyear=[% publicationyear | html %]&branch=[% branch | html %]"><i class="fa-solid fa-rotate"></i> Reopen selected invoices</a>
[% ELSE %]
<a class="btn btn-default merge" id="merge_open" href="#merge_invoices" data-table="openedresultst"><i class="fa fa-compress"></i> Merge selected invoices</a>
<a class="submit-form-link btn btn-default" id="close_sel" data-table="openedresultst" data-op="cud-close" data-action="invoice.pl" data-method="post" data-referer="/cgi-bin/koha/acqui/invoices.pl?op=do_search&invoicenumber=[% invoicenumber | html %]&supplier=[% booksellerid | html %]&shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]&shipmentdateto=[% shipmentdateto | $KohaDates %]&billingdatefrom=[% billingdatefrom | $KohaDates %]&billingdateto=[% billingdateto | $KohaDates %]&isbneanissn=[% isbneanissn | html %]&title=[% title | html %]&author=[% author | html %]&publisher=[% publisher | html %]&publicationyear=[% publicationyear | html %]&branch=[% branch | html %]"><i class="fa fa-times-circle"></i> Close selected invoices</a>