From 75c2cbed874f32fafe4df31f832e9c3259b5e887 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 20 Nov 2019 10:17:27 +0000 Subject: [PATCH] Bug 23805: (RM follow-up) Add credit_type relation to Koha::Account::Line The credit_type relation was missing when I pushed this patchset originally; It is already referenced in the account description include files and as such should be added Signed-off-by: Martin Renvoize --- Koha/Account/Line.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm index 9004f97df1..571c26a986 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -22,6 +22,7 @@ use Data::Dumper; use C4::Log qw(logaction); +use Koha::Account::CreditType; use Koha::Account::DebitType; use Koha::Account::Offsets; use Koha::Database; @@ -83,6 +84,19 @@ sub checkout { return $self->{_checkout}; } +=head3 credit_type + +Return the credit_type linked to this account line + +=cut + +sub credit_type { + my ( $self ) = @_; + my $rs = $self->_result->credit_type_code; + return unless $rs; + return Koha::Account::CreditType->_new_from_dbic( $rs ); +} + =head3 debit_type Return the debit_type linked to this account line -- 2.20.1