Bug 17976: Add overdue_fines accessor to Koha::Checkout

This patch adds a new filtered relation accessor to the Koha::Checkout
object to return just overdue fine type account lines related to the
checkout.

Whilst this is easy to chain in code, it's not available via TT and so
this accessor is useful for the notices case.

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Martin Renvoize 2024-10-01 15:55:06 +01:00 committed by Katrin Fischer
parent d11e4127ae
commit e779b8924f
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 14 additions and 0 deletions

View File

@ -93,6 +93,20 @@ sub account_lines {
return Koha::Account::Lines->_new_from_dbic( $account_lines_rs );
}
=head3 overdue_fines
my $fines = $checkout->overdue_fines;
Return the account lines for just the overdue fines
=cut
sub overdue_fines {
my ( $self ) = @_;
my $account_lines_rs = $self->_result->account_lines->search( { debit_type_code => 'OVERDUE' } );
return Koha::Account::Lines->_new_from_dbic( $account_lines_rs );
}
=head3 library
my $library = $checkout->library;