From 93f2aaa676406953b7f56f35b24e52a0f0f976f9 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 18 Dec 2025 14:52:26 +0000 Subject: [PATCH] Bug 41358: Log forced overrides for offline and ILL checkouts This patch updates offline circulation and ILL checkouts to properly record their nature in circulation logs as forced transactions. Offline circulation (process_koc.pl): - Offline transactions have already occurred without access to normal circulation checks - Now marks these as forced with 'OFFLINE_CIRCULATION' override code - This helps identify historical transactions that bypassed checks ILL checkouts (Koha/ILL/Request.pm): - ILL checkouts are system-initiated and may bypass certain restrictions by design - Now marks these as forced with 'ILL_CHECKOUT' override code - This helps track and report on ILL circulation activity separately Display updates (action-logs.inc): - Added translation strings for both new override codes: - OFFLINE_CIRCULATION: "Offline circulation checkout" - ILL_CHECKOUT: "ILL system checkout" - These will now display properly in Tools > Log viewer This ensures these special checkout types are properly identified in reporting and analysis, making it easier to understand the context of historical transactions. Sponsored-by: OpenFifth --- Koha/ILL/Request.pm | 2 ++ .../intranet-tmpl/prog/en/includes/action-logs.inc | 4 ++++ offline_circ/process_koc.pl | 10 ++++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm index 5e76fc5889e..b561e24c33d 100644 --- a/Koha/ILL/Request.pm +++ b/Koha/ILL/Request.pm @@ -1695,6 +1695,8 @@ sub check_out { } # We can allegedly check out, so make it so + # Mark as ILL checkout in the logs to track system-initiated checkouts + push @issue_args, undef, undef, { forced => ['ILL_CHECKOUT'] }; my $issue = C4::Circulation::AddIssue(@issue_args); if ($issue) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc index b863662511d..898d094655a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc @@ -259,6 +259,10 @@ Unseen renewal [% CASE 'SEEN' %] Seen renewal + [% CASE 'OFFLINE_CIRCULATION' %] + Offline circulation checkout + [% CASE 'ILL_CHECKOUT' %] + ILL system checkout [% CASE %] [% override | html %] [% END %] diff --git a/offline_circ/process_koc.pl b/offline_circ/process_koc.pl index 36bed2d1486..5fecdf8b9b1 100755 --- a/offline_circ/process_koc.pl +++ b/offline_circ/process_koc.pl @@ -229,7 +229,10 @@ sub kocIssueItem { if ( Date_to_Days( $i_y, $i_m, $i_d ) < Date_to_Days( $c_y, $c_m, $c_d ) ) { ## Current issue to a different persion is older than this issue, return and issue. - C4::Circulation::AddIssue( $patron, $circ->{'barcode'}, undef, undef, $circ->{'date'} ) unless (DEBUG); + C4::Circulation::AddIssue( + $patron, $circ->{'barcode'}, undef, undef, $circ->{'date'}, undef, + { forced => ['OFFLINE_CIRCULATION'] } + ) unless (DEBUG); push @output, { issue => 1, title => $biblio->title, @@ -250,7 +253,10 @@ sub kocIssueItem { } } } else { ## Item is not checked out to anyone at the moment, go ahead and issue it - C4::Circulation::AddIssue( $patron, $circ->{'barcode'}, undef, undef, $circ->{'date'} ) unless (DEBUG); + C4::Circulation::AddIssue( + $patron, $circ->{'barcode'}, undef, undef, $circ->{'date'}, undef, + { forced => ['OFFLINE_CIRCULATION'] } + ) unless (DEBUG); push @output, { issue => 1, title => $biblio->title, -- 2.52.0