From 0e4ed397ed984a85173d65907db5cf44bf4aa4b4 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 1dcc3bd2ce..646b7240e6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt @@ -123,10 +123,10 @@ [% IF tab == 'closed' %] Reopen selected invoices [% ELSE %] - Close selected nvoices + Close selected invoices [% END %] - [% END %] + [% END %]
  • Open invoices ([% openedinvoices.size || 0 | html %])
  • @@ -388,11 +388,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