From 5f8935a896c3e844b2b23934a19f279be728c76e 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 | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 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 f19370f0a6..7c1b3cb96d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt @@ -118,10 +118,10 @@ [% IF tab == 'closed' %] Reopen selected invoices [% ELSE %] - Close selected nvoices + Close selected invoices [% END %] - [% END %] + [% END %]
  • Open invoices ([% openedinvoices.size || 0 | html %])
  • @@ -384,11 +384,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