From f870e59a74d9ccfbde4f94c2385617cb78aea93a Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 16 Jul 2020 09:40:23 +0100 Subject: [PATCH] Bug 25998: Add 'library' relation to Koha::Account::Line Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart (cherry picked from commit 16413beea6a2f5667a3a68971158ad1d7ea4b48a) Signed-off-by: Lucas Gass --- Koha/Account/Line.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm index 155ae4e29b..ce00de0623 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -85,6 +85,19 @@ sub checkout { return $self->{_checkout}; } +=head3 library + +Returns a Koha::Library object representing where the accountline was recorded + +=cut + +sub library { + my ( $self ) = @_; + my $rs = $self->_result->branchcode; + return unless $rs; + return Koha::Library->_new_from_dbic($rs); +} + =head3 credit_type Return the credit_type linked to this account line -- 2.39.5