From 43486fc580622d168b661c03a7d592502ca70c3f Mon Sep 17 00:00:00 2001 From: phette23 Date: Thu, 3 Oct 2024 14:34:10 -0700 Subject: [PATCH] fix: hide 'item was not checked in' warning --- admin-js/circ-returns.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/admin-js/circ-returns.js b/admin-js/circ-returns.js index c90d87a..db83e43 100644 --- a/admin-js/circ-returns.js +++ b/admin-js/circ-returns.js @@ -4,11 +4,19 @@ if (path.match('/cgi-bin/koha/circ/returns.pl')) { $(function(){ // loop over each row in the checkin table $('#checkedintable tr').each(function(){ - var row = $(this) - var home = row.find('td.ci-homelibrary') - var holding = row.find('td.ci-holdinglibrary') - // compare home branch to branch where the item's being checked in - if (home.text() !== holding.text()) { + let row = $(this) + + // 1 misleading warning when item that wasn't checked out is checked in + let duedate = row.find('td.ci-duedate') + if (duedate.find('.problem').text().toLowerCase().trim() === 'item was not checked in' && + duedate.find('span').eq(1).text().toLowerCase().trim() === 'not checked out') { + duedate.find('.problem').hide() + } + + // 2 extra warning for books that need to be returned to their home library + let home = row.find('td.ci-homelibrary') + let holding = row.find('td.ci-holdinglibrary') + if (home.text().trim() !== holding.text().trim()) { // if they differ, show an alert with on-hover helper text holding.addClass('error alert-error') .css({'cursor': 'help', 'font-weight': 'bold'})