diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 4947116f0d..7c586adeed 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -96,6 +96,8 @@ $(document).ready(function() { // Handle renewals and returns $("#RenewCheckinChecked").on("click",function(){ + + let refresh_table = true; $(".checkin:checked:visible").each(function() { itemnumber = $(this).val(); @@ -125,6 +127,7 @@ $(document).ready(function() { } else { content = __("Unable to check in"); $(id).parent().parent().addClass('warn'); + refresh_table = false; } $(id).replaceWith( content ); @@ -203,6 +206,7 @@ $(document).ready(function() { } else { content += __("reason unknown"); } + refresh_table = false; } $(id).replaceWith( content ); @@ -217,6 +221,10 @@ $(document).ready(function() { $("#barcode").focus(); } + if ( refresh_table ) { + RefreshIssuesTable(); + } + // Prevent form submit return false; }); @@ -247,10 +255,6 @@ $(document).ready(function() { return false; }); - $('#RenewCheckinChecked').on('click', function(){ - RefreshIssuesTable(); - }); - if ( Cookies.get("issues-table-load-immediately-" + script) == "true" ) { LoadIssuesTable(); $('#issues-table-load-immediately').prop('checked', true);