From 71c6cc7d52d4ee020fd84af91b7ac2a975e1d15d Mon Sep 17 00:00:00 2001 From: Devinim Date: Thu, 3 Oct 2019 15:59:37 +0000 Subject: [PATCH] Bug 22773: Message appearing if any invoice selected Signed-off-by: Kelly McElligott Signed-off-by: Katrin Fischer --- .../intranet-tmpl/prog/en/modules/acqui/invoices.tt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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 047fed16bf..ae2d17a564 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt @@ -105,7 +105,7 @@ [% IF tab == 'closed' %] Reopen selected invoices [% ELSE %] - Close selected nvoices + Close selected invoices [% END %] [% END %] @@ -370,11 +370,15 @@ var referer = $(this).attr("data-referer"); var op = $(this).attr("data-op"); var invoice_link = "invoice.pl?op="+op; - $('.select-invoice:checked').each(function () { - var row = $(this).parents('tr'); - invoice_link = invoice_link + "&invoiceid="+$(row).attr('data-invoiceid'); - }); - window.location.href =invoice_link +"&"+referer; + if ($('.select-invoice:checked').length) { + $('.select-invoice:checked').each(function () { + var row = $(this).parents('tr'); + invoice_link = invoice_link + "&invoiceid="+$(row).attr('data-invoiceid'); + }); + window.location.href =invoice_link +"&"+referer; + } else { + alert ("Please select at least one invoice." ); + } }); $('.merge').click(function (ev) { -- 2.11.0