Bugzilla – Attachment 110081 Details for
Bug 15329
Show budget in addition to fund for late orders in acquisition
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15329: Add new column for budget to the late orders table
Bug-15329-Add-new-column-for-budget-to-the-late-or.patch (text/plain), 4.14 KB, created by
Katrin Fischer
on 2020-09-14 23:19:23 UTC
(
hide
)
Description:
Bug 15329: Add new column for budget to the late orders table
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-09-14 23:19:23 UTC
Size:
4.14 KB
patch
obsolete
>From cc8bb6ca17ff036c409277c6d02901d01024555b Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >Date: Sun, 13 Sep 2020 21:45:25 +0000 >Subject: [PATCH] Bug 15329: Add new column for budget to the late orders table > >The table currently displays the fund, but as late orders can be >from a past budget with the same fund names, this can be confusing. >So adding the budget in addition to the fund will be helpful. > >To test: >- Add a basket and an order, close the basket >- Go to the late oder page >- Make sure your order shows up there >- Apply the patch >- Reload the late orders page >- Verify a new column budget shows in the table >- Verify the table configuration settings work for the new column >- Run t/db_dependent/Koha/Acquisition/Fund.t >--- > Koha/Acquisition/Fund.pm | 16 ++++++++++++++++ > admin/columns_settings.yml | 2 ++ > .../intranet-tmpl/prog/en/modules/acqui/lateorders.tt | 5 +++-- > t/db_dependent/Koha/Acquisition/Fund.t | 19 ++++++++++++++++++- > 4 files changed, 39 insertions(+), 3 deletions(-) > >diff --git a/Koha/Acquisition/Fund.pm b/Koha/Acquisition/Fund.pm >index d32f46af6b..80ef0b2f4a 100644 >--- a/Koha/Acquisition/Fund.pm >+++ b/Koha/Acquisition/Fund.pm >@@ -17,6 +17,7 @@ package Koha::Acquisition::Fund; > > use Modern::Perl; > >+use Koha::Acquisition::Budgets; > use Koha::Database; > > use base qw(Koha::Object); >@@ -29,6 +30,21 @@ Koha::Acquisition::Fund object class > > =head2 Class methods > >+=head3 budget >+ >+ my $budget = $fund->budget; >+ >+Returns the I<Koha::Acquisition::Budget> object for the budget (aqbudgetperiods) >+associated to the fund. >+ >+=cut >+ >+sub budget { >+ my ( $self ) = @_; >+ my $budget_rs = $self->_result->budget; >+ return Koha::Acquisition::Budget->_new_from_dbic( $budget_rs ); >+} >+ > =head3 to_api > > my $json = $fund->to_api; >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 96b3a31a68..70ba76b18f 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -60,6 +60,8 @@ modules: > - > columnname: library > - >+ columnname: budget >+ - > columnname: fund > - > columnname: claims_count >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >index 1c81debcab..73fc10bf50 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >@@ -67,6 +67,7 @@ > <th>Basket</th> > <th>Basket group</th> > <th>Library</th> >+ <th>Budget</th> > <th>Fund</th> > <th>Claims count</th> > <th class="title-string">Claimed date</th> >@@ -131,8 +132,8 @@ > </td> > <td>[% Branches.GetName( lateorder.basket.authorizer.branchcode ) | html %] > </td> >- <td>[% lateorder.fund.budget_name | html %] >- </td> >+ <td>[% lateorder.fund.budget.budget_period_description | html %]</td> >+ <td>[% lateorder.fund.budget_name | html %]</td> > <td>[% lateorder.claims.count | html %]</td> > <td> > [% FOR claim IN lateorder.claims %] >diff --git a/t/db_dependent/Koha/Acquisition/Fund.t b/t/db_dependent/Koha/Acquisition/Fund.t >index 98ab1dcbf9..38dae6297a 100755 >--- a/t/db_dependent/Koha/Acquisition/Fund.t >+++ b/t/db_dependent/Koha/Acquisition/Fund.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 1; >+use Test::More tests => 2; > > use t::lib::TestBuilder; > >@@ -42,3 +42,20 @@ subtest 'to_api() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'budget' => sub { >+ plan tests => 1; >+ >+ $schema->storage->txn_begin; >+ my $f = $builder->build_object( >+ { >+ class => 'Koha::Acquisition::Funds', >+ } >+ ); >+ >+ my $fund = Koha::Acquisition::Funds->find( $f->budget_id ); >+ is( ref( $fund->budget ), >+ 'Koha::Acquisition::Budget', >+ '->fund should return a Koha::Acquisition::Budget object' ); >+ $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 15329
:
110081
|
110214
|
111747