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 <https://openfifth.co.uk/>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Martin Renvoize 2025-12-18 14:52:26 +00:00 committed by Pedro Amorim
parent c64aea8fcc
commit 507545734e
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
3 changed files with 18 additions and 2 deletions

View File

@ -1725,6 +1725,12 @@ sub check_out {
}
# We can allegedly check out, so make it so
# Mark as ILL checkout in the logs to track system-initiated checkouts.
# AddIssue signature is ( $patron, $barcode, $datedue, $cancelreserve,
# $issuedate, $sipmode, $params ) - pad to position 7 so the params
# hashref is not mistaken for $issuedate or $sipmode.
push @issue_args, undef while @issue_args < 6;
push @issue_args, { forced => ['ILL_CHECKOUT'] };
my $issue = C4::Circulation::AddIssue(@issue_args);
if ($issue) {

View File

@ -269,6 +269,10 @@
<span>Unseen renewal</span>
[% CASE 'SEEN' %]
<span>Seen renewal</span>
[% CASE 'OFFLINE_CIRCULATION' %]
<span>Offline circulation checkout</span>
[% CASE 'ILL_CHECKOUT' %]
<span>ILL system checkout</span>
[% CASE %]
<span>[% override | html %]</span>
[% END %]

View File

@ -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,