Bugzilla – Attachment 75708 Details for
Bug 20726
Display acquisition details on the subscription detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20726: Add new method Koha::Acquisition::Order->fund
Bug-20726-Add-new-method-KohaAcquisitionOrder-fund.patch (text/plain), 2.25 KB, created by
Séverine Queune
on 2018-05-31 16:01:59 UTC
(
hide
)
Description:
Bug 20726: Add new method Koha::Acquisition::Order->fund
Filename:
MIME Type:
Creator:
Séverine Queune
Created:
2018-05-31 16:01:59 UTC
Size:
2.25 KB
patch
obsolete
>From 8fba3b670bd4b838c9ccd98ba798603bc8e95fd4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 7 May 2018 19:29:19 -0300 >Subject: [PATCH] Bug 20726: Add new method Koha::Acquisition::Order->fund >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Can be moved to a separate bug report. > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >--- > Koha/Acquisition/Order.pm | 15 +++++++++++++++ > t/db_dependent/Koha/Acquisition/Order.t | 19 ++++++++++++++++++- > 2 files changed, 33 insertions(+), 1 deletion(-) > >diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm >index 79fb056..702e5b6 100644 >--- a/Koha/Acquisition/Order.pm >+++ b/Koha/Acquisition/Order.pm >@@ -20,6 +20,7 @@ use Modern::Perl; > use Carp qw( croak ); > > use Koha::Acquisition::Baskets; >+use Koha::Acquisition::Funds; > use Koha::Database; > use Koha::DateUtils qw( dt_from_string output_pref ); > >@@ -113,6 +114,20 @@ sub basket { > return Koha::Acquisition::Basket->_new_from_dbic( $basket_rs ); > } > >+=head3 fund >+ >+ my $fund = $order->fund >+ >+Returns the fund (aqbudgets) associated to the order. >+ >+=cut >+ >+sub fund { >+ my ( $self ) = @_; >+ my $fund_rs = $self->_result->budget; >+ return Koha::Acquisition::Fund->_new_from_dbic( $fund_rs ); >+} >+ > =head2 Internal methods > > =head3 _type >diff --git a/t/db_dependent/Koha/Acquisition/Order.t b/t/db_dependent/Koha/Acquisition/Order.t >index f8382fa..f5a20a8 100644 >--- a/t/db_dependent/Koha/Acquisition/Order.t >+++ b/t/db_dependent/Koha/Acquisition/Order.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 2; >+use Test::More tests => 3; > > use t::lib::TestBuilder; > use t::lib::Mocks; >@@ -97,3 +97,20 @@ subtest 'store' => sub { > }; > $schema->storage->txn_rollback; > }; >+ >+subtest 'fund' => sub { >+ plan tests => 1; >+ >+ $schema->storage->txn_begin; >+ my $o = $builder->build_object( >+ { >+ class => 'Koha::Acquisition::Orders', >+ } >+ ); >+ >+ my $order = Koha::Acquisition::Orders->find( $o->ordernumber ); >+ is( ref( $order->fund ), >+ 'Koha::Acquisition::Fund', >+ '->fund should return a Koha::Acquisition::Fund object' ); >+ $schema->storage->txn_rollback; >+}; >-- >2.1.4
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 20726
:
75146
|
75147
|
75148
|
75149
|
75150
|
75650
|
75651
|
75666
|
75708
|
75709
|
75710
|
75711
|
75712
|
75713
|
75794
|
77428
|
77429
|
77430
|
77431
|
77432
|
77433
|
77434
|
77500
|
77501
|
77502
|
77503
|
77504
|
77505
|
77506
|
78062
|
78063
|
78064
|
78065
|
78066
|
78067
|
78068