From dbf93499c31db53a061f0991be32a937ba7718c0 Mon Sep 17 00:00:00 2001 From: Jacob O'Mara Date: Thu, 19 Feb 2026 15:55:42 +0000 Subject: [PATCH] Bug 38924: (follow-up) Record RENEW usage type for renewals Pass explicit type param to add_usage: ISSUE for checkouts, RENEW for renewals. Default to ISSUE in add_usage for safety. --- C4/Circulation.pm | 2 ++ Koha/Patron/Quota.pm | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 632f43e586a..6d97b5b942d 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2048,6 +2048,7 @@ sub AddIssue { { patron_id => $patron->borrowernumber, issue_id => $issue->issue_id, + type => 'ISSUE', } ); } @@ -3568,6 +3569,7 @@ sub AddRenewal { { patron_id => $patron->borrowernumber, issue_id => $issue->issue_id, + type => 'RENEW', } ); } diff --git a/Koha/Patron/Quota.pm b/Koha/Patron/Quota.pm index 33782b8105d..5bf7333fddc 100644 --- a/Koha/Patron/Quota.pm +++ b/Koha/Patron/Quota.pm @@ -172,7 +172,8 @@ sub add_usage { # Set defaults $params->{patron_id} = $self->patron_id; $params->{patron_quota_id} = $self->id; - $params->{issue_id} = undef unless exists $params->{issue_id}; + $params->{issue_id} = undef unless exists $params->{issue_id}; + $params->{type} = 'ISSUE' unless exists $params->{type}; # Create usage record my $usage = Koha::Patron::Quota::Usage->new($params)->store; -- 2.39.5