Bugzilla – Attachment 107348 Details for
Bug 24157
Additional acquisitions permissions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24157: Add new method Acq::Invoice::Adjustement->fund
Bug-24157-Add-new-method-AcqInvoiceAdjustement-fun.patch (text/plain), 2.47 KB, created by
Alex Arnaud
on 2020-07-24 13:08:13 UTC
(
hide
)
Description:
Bug 24157: Add new method Acq::Invoice::Adjustement->fund
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2020-07-24 13:08:13 UTC
Size:
2.47 KB
patch
obsolete
>From 416c1571c927819b486ae2830135b64afec3328d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 13 Dec 2019 17:37:36 +0100 >Subject: [PATCH] Bug 24157: Add new method Acq::Invoice::Adjustement->fund > >Moving to its own commit in case we want to cherry-pick or move it to >its own bug report. > >Sponsored-by: Galway-Mayo Institute of Technology > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> >--- > Koha/Acquisition/Invoice/Adjustment.pm | 18 +++++++++++++++++- > t/db_dependent/Koha/Acquisition/Invoice/Adjustments.t | 10 +++++++++- > 2 files changed, 26 insertions(+), 2 deletions(-) > >diff --git a/Koha/Acquisition/Invoice/Adjustment.pm b/Koha/Acquisition/Invoice/Adjustment.pm >index 4dbe90225d..0d0bac7353 100644 >--- a/Koha/Acquisition/Invoice/Adjustment.pm >+++ b/Koha/Acquisition/Invoice/Adjustment.pm >@@ -20,7 +20,8 @@ use Modern::Perl; > use Carp; > > use Koha::Database; >-use Koha::Acquisition::Invoice; >+use Koha::Acquisition::Invoices; >+use Koha::Acquisition::Funds; > > use base qw(Koha::Object); > >@@ -48,6 +49,21 @@ sub invoice { > return Koha::Acquisition::Invoice->_new_from_dbic( $invoice_rs ); > } > >+=head3 fund >+ >+my $fund = $adjustment->fund; >+ >+Return the fund for this adjustment >+ >+=cut >+ >+sub fund { >+ my ( $self ) = @_; >+ my $fund_rs = $self->_result->budget; >+ return unless $fund_rs; >+ return Koha::Acquisition::Fund->_new_from_dbic( $fund_rs ); >+} >+ > =head3 type > > =cut >diff --git a/t/db_dependent/Koha/Acquisition/Invoice/Adjustments.t b/t/db_dependent/Koha/Acquisition/Invoice/Adjustments.t >index d5e2309eb0..3419672b79 100644 >--- a/t/db_dependent/Koha/Acquisition/Invoice/Adjustments.t >+++ b/t/db_dependent/Koha/Acquisition/Invoice/Adjustments.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 7; >+use Test::More tests => 8; > > use Koha::Database; > >@@ -72,4 +72,12 @@ subtest 'invoice' => sub { > is( $invoice->invoiceid, $retrieved_adj->invoiceid, 'Koha::Acquisition::Invoice::Adjustment->invoice should return the correct invoice' ); > }; > >+subtest 'fund' => sub { >+ plan tests => 2; >+ >+ my $fund = $retrieved_adj->fund; >+ is( ref( $fund ), 'Koha::Acquisition::Fund', 'Koha::Acquisition::Invoice::Adjustment->fund should return a Koha::Acquisition::Fund' ); >+ is( $fund->budget_id, $retrieved_adj->budget_id, 'Koha::Acquisition::Invoice::Adjustment->fund should return the correct fund ' ); >+}; >+ > $schema->storage->txn_rollback; >-- >2.11.0
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 24157
:
96274
|
96275
|
96276
|
96277
|
96278
|
98651
|
98652
|
98653
|
98654
|
98655
|
100283
|
100284
|
100285
|
100286
|
100287
|
100288
|
107132
|
107133
|
107134
|
107135
|
107136
|
107137
|
107138
|
107139
|
107309
|
107346
|
107347
| 107348 |
107349
|
107350
|
107351
|
107352
|
107353
|
107354