From fe65245580b30a0c78da07f32937dd54a20538ad 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 --- .../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 30ec194ff8..9065e0dbea 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