Bugzilla – Attachment 96363 Details for
Bug 24252
Add credits, debits, credit_offsets and debit_offsets relationships to Koha::Account::Line
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24252: Add relations to Koha::Account::Line
Bug-24252-Add-relations-to-KohaAccountLine.patch (text/plain), 2.12 KB, created by
Martin Renvoize (ashimema)
on 2019-12-17 11:35:44 UTC
(
hide
)
Description:
Bug 24252: Add relations to Koha::Account::Line
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-12-17 11:35:44 UTC
Size:
2.12 KB
patch
obsolete
>From 9f5bf4d91bc79f4d210957d14687321d476fb73e Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 13 Sep 2019 14:03:11 +0100 >Subject: [PATCH] Bug 24252: Add relations to Koha::Account::Line > >This patch adds two new relationships to the Koha::Account::Line object. > >* credit_offsets - returns all credit type Koha::Account::Offsets > related to this Koha::Account::Line. >* debit_offsets - returns all debit type Koha::Account::Offsets related > to this Koha::Account::Line. >--- > Koha/Account/Line.pm | 47 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 47 insertions(+) > >diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm >index 6f1e5b6e00..3061b46dd5 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -110,6 +110,53 @@ sub debit_type { > return Koha::Account::DebitType->_new_from_dbic( $rs ); > } > >+=head3 credit_offsets >+ >+ my $credit_offsets = $accountline->credit_offsets; >+ my $credit_offsets = $accountline->credit_offsets( $cond, $attr); >+ >+Return the credit_offsets linked to this account line if some exist. >+Search conditions and attributes may be passed if you wish to filter >+the resultant resultant resultset. >+ >+=cut >+ >+sub credit_offsets { >+ my ( $self, $cond, $attr ) = @_; >+ my $rs; >+ if ( defined($cond) || defined($attr) ) { >+ $rs = >+ $self->_result->search_related( 'account_offsets_credits', $cond, >+ $attr ); >+ } >+ else { >+ $rs = $self->_result->account_offsets_credits; >+ } >+ return unless $rs; >+ return Koha::Account::Offsets->_new_from_dbic($rs); >+} >+ >+=head3 debit_offsets >+ >+Return the debit_offsets linked to this account line if some exist >+ >+=cut >+ >+sub debit_offsets { >+ my ( $self, $cond, $attr ) = @_; >+ my $rs; >+ if ( defined($cond) || defined($attr) ) { >+ $rs = >+ $self->_result->search_related( 'account_offsets_debits', $cond, >+ $attr ); >+ } >+ else { >+ $rs = $self->_result->account_offsets_debits; >+ } >+ return unless $rs; >+ return Koha::Account::Offsets->_new_from_dbic($rs); >+} >+ > =head3 void > > $payment_accountline->void(); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24252
:
96363
|
96371
|
96518
|
96995
|
110639